-
NumericStepper + keyboardEvent = :(
Hi, I have a keyboardEvent which listens for pressed keys.
I also have a NumericStepper. If I change the value in the NumericStepper,
the keyboardEvent stops working (I think the reason is that the textField in the numericStepper, or the numericStepper itself, gets active)
So, I've tried alot of things.
numericstepper.textField.enabled = false
numericstepper.textField.selectable = false
numericstepper.textField.editable = false
ect...
But nothing seems to work. Please help!
-
Throw a button component out on stage somewhere it won't be seen (ie. out of the screen bounds) and when you detect a focusIn event on your numericStepper, immediately call setFocus back to the button. This way the stepper never holds focus of the keyboard.
Please use [php] or [code] tags, and mark your threads resolved 8)
-
Ok, thanks, I'll try!
Is there any other way, like make it impossible to set focus on the numeric stepper?
-
Now it works!
This is how I solved it:
PHP Code:
stage.addEventListener(MouseEvent.MOUSE_UP, release);
function release(e:MouseEvent):void {
stage.focus = null;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|