A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: NumericStepper + keyboardEvent = :(

  1. #1
    Member
    Join Date
    Oct 2004
    Posts
    57

    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!

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    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)

  3. #3
    Member
    Join Date
    Oct 2004
    Posts
    57
    Ok, thanks, I'll try!
    Is there any other way, like make it impossible to set focus on the numeric stepper?

  4. #4
    Member
    Join Date
    Oct 2004
    Posts
    57

    Now it works!

    This is how I solved it:
    PHP Code:
    stage.addEventListener(MouseEvent.MOUSE_UPrelease);
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center