Use an event Listener and a timer to change the selection of the button.
Here is a quick and dirty example:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
     applicationComplete="onApplicationComplete()">
     <mx:Script>
         <![CDATA[
             import flash.utils.Timer;
             import flash.events.TimerEvent;

             private function onApplicationComplete():void
             {
                 stage.addEventListener(KeyboardEvent.KEY_DOWN,
onKeyDown, true);
                 stage.addEventListener(KeyboardEvent.KEY_DOWN,
onKeyDown, false);
             }

             private function onKeyDown(event:KeyboardEvent):void
             {
                 var myTimer:Timer = new Timer(100);
                 myTimer.addEventListener("timer", timerHandler);
                 myTimer.start();
                 switch(event.keyCode)
                 {
                     case 49:
                         one.selected = true;
                     break;
                 }
             }

             public function timerHandler(event:TimerEvent):void
             {
                 one.selected = false;
             }
         ]]>
     </mx:Script>
     <mx:Grid>
         <mx:GridRow>
             <mx:GridItem>
                 <mx:Button id="one" label="1" width="100"/>
             </mx:GridItem>
         </mx:GridRow>
     </mx:Grid>
</mx:Application>


HTH


Steve


--- In [email protected], "vladakg85" <vladak...@...> wrote:
>
> Hi,
>
> I have a list of buttons in my VBox (1,2,3,4,5,6...) and I can click
with mouse on each of them. Now I need to make numeric keyboard to
register click on some of this buttons. If I press 5 on numpad button on
the screen must flash a little (like it is pressed for real with mouse).
But I can't figure out how to do this, help please?
>
> Thanks
>

Reply via email to