Monday, June 2, 2008

Adobe Air - Keyboard Event in Fullscreen Mode

Recently, I get error when launching my custom movie browser. It says:
“This application requires a version of the Adobe Integrated Runtime (AIR) which is no longer supported. Please contact the application author”
I go to Adobe site to download the latest AIR and also the latest AIR SDK for Flash. After I install everything, I open Flash and start generating the new AIR installer for my application.

I get error message when trying to install the application. The error says:
"The application could not be installed because the AIR file is damaged. Try obtaining a new AIR file from the publisher."
Ehm ... very weird, I am the publisher and I just generate the installer file. I try generating new installer several times but no luck. I uninstall AIR and reinstall it again, and it works !!! Weird ...

Next problem I encounter is that my program does not allow me to trigger KeyboardEvent while I am in fullscreen mode. The KeyboardEvent is working fine if I am not in fullscreen mode. This reminds me of restriction I encountered in Flash AS 3.0. It is very confusing, it still worked the last time I make changes to my application, which is about two months ago.

Then, after googling around, I find that Adobe changes the AIR API, I need to set display state to FULL_SCREEN_INTERACTIVE instead of FULL_SCREEN only to allow KeyboardEvent in fullscreen mode.
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
Two hours wasted trying to solve this problem :)

7 comments:

Anonymous said...

Great work.

Benjamin said...

I know this is an old post.. but you just saved 2 hours of my life :) tnx

Xavier said...

Thanks. I having been finding for a solution for hours!

Anonymous said...

Well I already wasted 30 minutes searching for a solution why AIR doesn't respond to keyboard events. So thanks for saving 90 minutes of my life :)

Anonymous said...

Thank you very much for sharing this.

Cheers

Thangaraj said...

Thank you very much for timely help.

Zach said...

Thanks! This post saved precious hours of my life.