Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>actually its not a flash bug its component's bug. if space bar is no need for your radio buttons(i think its useless) you can disable it with creating your own MyRadioButton which extends RadioButton class this will be disable space key input</p> <pre><code>package { import flash.events.KeyboardEvent; import fl.controls.RadioButton; import flash.ui.Keyboard; public class MyRadioButton extends RadioButton{ public function MyRadioButton() { super(); } override protected function keyUpHandler(event:KeyboardEvent):void { if(event.keyCode != Keyboard.SPACE){ super.keyUpHandler(event); } } override protected function keyDownHandler(event:KeyboardEvent):void { if(event.keyCode != Keyboard.SPACE){ super.keyDownHandler(event); } } } </code></pre> <p>}</p> <p>just you need to change class property fl.controls.RadioButton to MyRadioButton from your library element:"RadioButton". (i assume MyRadioButton is near fla)</p> <p>------>edit </p> <p>here is another solution without disabling spacebar. this time when user makes anykeydown before spacebar keyup code runs spacebar keyup before anykeydown. and focus get removed from radio button also you can add anyother solutions like if spacebar keystate is down donot let any keydown. </p> <pre><code>package { import flash.events.KeyboardEvent; import fl.controls.RadioButton; import flash.ui.Keyboard; import flash.events.Event; public class MyRadioButton extends RadioButton{ private var _isSpaceDown:Boolean = false; public function MyRadioButton() { super(); } override protected function handleChange(event:Event):void { if (_isSpaceDown) { keyUpHandler(new KeyboardEvent(KeyboardEvent.KEY_UP, true, true, 0, Keyboard.SPACE)); setMouseState('up'); } super.handleChange(event); } override protected function keyUpHandler(event:KeyboardEvent):void { if(event.keyCode == Keyboard.SPACE){ if(_isSpaceDown){ _isSpaceDown = false; }else{ return; } } super.keyUpHandler(event); } override protected function keyDownHandler(event:KeyboardEvent):void { if(event.keyCode == Keyboard.SPACE){ _isSpaceDown = true; }else{ if(_isSpaceDown){ var e:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN); e.keyCode = Keyboard.SPACE; super.keyUpHandler(e); _isSpaceDown = false; } } super.keyDownHandler(event); } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload