Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Android Options Menu in Adobe AIR? (not Java)

I would like to create an Options Menu in my Flash AIR application for Android.

I've figured out already, that this ActionScript code could be used for capturing the hardware Menu button press event:

stage.addEventListener(KeyboardEvent.KEY_DOWN, _onKeyDown);

function onKeyDown(event:KeyboardEvent):void {
    if(event.keyCode == Keyboard.MENU) {
        event.preventDefault();
        trace("Menu Pressed");
    }
}

but how do you create the actual menu?

If you can't do it with AIR, then has anybody tried to recreate/mimic it manually already and could you please share the properties (colors, transparency, any gradients?) and transitions (sliding in/out) you've used?

I've found some guidelines already, but would appreciate any Flash-specific tips/properties (like which easing to use for sliding transitions?) you have

Thank you, Alex

alt text

like image 579
Alexander Farber Avatar asked Oct 29 '10 14:10

Alexander Farber


2 Answers

Hi dude I recently was searching for the same issue and I've found this nice snippet. You can use AS3 and Air to develop your mobile apps and build your android like menu! It really worked for me so that I decided to share it

Try this: http://myappsnippet.com/android-menu-air-extension/

like image 173
Arash Avatar answered Sep 21 '22 17:09

Arash


You can't access Androids native menu from AIR, it is available only from Android SDK. So you have to build something similar in Flex (if you plan to develop your app using AIR).

like image 30
Hullabaloo Avatar answered Sep 25 '22 17:09

Hullabaloo