One help needed,
In my application after the application starts, I want to listen left
and right arrow key to navigate.
for that I have override the keyDownHandler(event:KeyboardEvent) in
I invoke the onApplicationcomplet() on ' applicationComplete '
event.
private function onApplicationComplete(event:FlexEvent):void
{
this.addEventListener(KeyboardEvent.KEY_DOWN,keyDownHandler);
//stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownHandler);
}
protected override function keyDownHandler(event:KeyboardEvent):void
{
super.keyDownHandler(event);
switch(event.keyCode)
{
case 37 :
nextPage();
break;
case 39 :
previousPage();
break;
default :
}
}
But till I click on stage / application some where, I am not being
able to use left and right arrow key functionality.
Once I click some where on my application, afterwards it runs fine.
Even I have tried to use :
//stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownHandler);
But I want it should run without any click / other inputs.
Thanking in advance.
Mor