therobot
August 7th, 2008, 02:16 PM
I've got one class listening for KeyboardEvents. If the Space bar is down and the mouse is down over an object, drag the object. This works fine until I click a Numeric Stepper in a different MovieClip. I've traced it out, and the keyboard presses no longer register once I use the Numeric Stepper.
The question is: How can I bring the focus back?
EDIT: solved. I added this code to the class listening for keyboard events. (duh)
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
function onMouseDown(evt:MouseEvent):void
{
stage.focus = this;
}
The question is: How can I bring the focus back?
EDIT: solved. I added this code to the class listening for keyboard events. (duh)
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
function onMouseDown(evt:MouseEvent):void
{
stage.focus = this;
}