scene to the MC and the scene respectively keyboard enter listening :
function Keyenter (event:keyboardevent): void {
if (event.keycode==13) {
switch (event.target) {
& Nbsp; case My_text:
trace ("it");
break;
default:
trace ("You Clicked Stage ");
break;
}
}
Stage.addeventlistener (Keyboardevent.key_down, keyenter);
Add the mouse monitor to the scene stage and MC separately :
function Testit (e:mouseevent): void {
Switch (e.target) {
Case My_text:
Trace ("You click my_text!");
Break
Case stage:
Trace ("You clicked stage!");
Break
}
}
Stage.addeventlistener (Mouseevent.click,testit);
to set the default focus in the stage :
Stage.focus=my_text;
If you want to make the MC effective. Need to add:
My_mc.buttonmode=true;
the keyboard enter key for the general MC listens on :
_pager_mc.addeventlistener (Keyboardevent.key_down, Keyenter);
Function Keyenter (event:keyboardevent): void {
if (event.keycode==13) {
& Nbsp;_pager_mc.removeeventlistener (Keyboardevent.key_down, Keyenter);
trace ("it");
}
}
Thanks for the help of Volcano brother. Learned A:
generally as long as the keyboard-related code, the direct test, you must remember to disable shortcut keys .
At the time of the test. On the control---"Disable shortcut key" before the tick.