Not able to add the soft key and its functinality to the flash(CS3) and actionscript(AS2) app. | developer.brewmp.com Not able to add the soft key and its functinality to the flash(CS3) and actionscript(AS2) app. | developer.brewmp.com

Developer

Not able to add the soft key and its functinality to the flash(CS3) and actionscript(AS2) app.

Hi,

I am develoing a sample application using flash(CS3) and actionscript(AS2).
The application will run on the BrewMP simulator.

The main menu for that application is ready and i am able to handle the Up/Down/Left/Right and select key, and it runs till here well on the BrewMP simulator.

Next i wish to add the device left soft key (LSK) and right soft key (RSK).
LSK & RSK will have the functionality to move to next screen.

Please suggest me how i can do this.

One alernative i tried was making the softkey as invisble buttons and use on keyPress.
But no sucess as i cant get keyCode for the softkey.

Do i need to handle the softkeys in brew?
If yes, how?

Let me know what best i can do in order to achieve this requirement.

Thanks!
Shweta

Shweta-
Here is the code I use:
var keyListener = new Object();
keyListener.onKeyDown = function(evtObj){
var keyCode = Key.getCode();
switch (keyCode) {
case Key.PGUP:
case "SOFT1":
handleLeftSoftKeyClick();
break;
case Key.PGDN:
case "SOFT2":
handleRightSoftKeyClick();
break;
case Key.UP:
handleUpArrow();
break;
case Key.DOWN:
handleDownArrow();
break;
case Key.ENTER:
handleSelection();
break
default:
break;
}

Key.addListener(keyListener);
You will note that I use both the Key.PGUP and "SOFT1". This allows me to run my Flash file out side the BMP simulator for testing and debugging. The "SOFT1" is what the BMP will send as the keycode.
Hope this helps.
Chris

Shweta-
Here is the code I use:
var keyListener = new Object();
keyListener.onKeyDown = function(evtObj){
var keyCode = Key.getCode();
switch (keyCode) {
case Key.PGUP:
case "SOFT1":
handleLeftSoftKeyClick();
break;
case Key.PGDN:
case "SOFT2":
handleRightSoftKeyClick();
break;
case Key.UP:
handleUpArrow();
break;
case Key.DOWN:
handleDownArrow();
break;
case Key.ENTER:
handleSelection();
break
default:
break;
}

Key.addListener(keyListener);
You will note that I use both the Key.PGUP and "SOFT1". This allows me to run my Flash file out side the BMP simulator for testing and debugging. The "SOFT1" is what the BMP will send as the keycode.
Hope this helps.
Chris

Thanks Chris!
The Soft keys are working gr8 for me.
Would also like to know the AS 2.0 code to exit the application.
Please help....
Thanks!
Shweta

Thanks Chris!
The Soft keys are working gr8 for me.
Would also like to know the AS 2.0 code to exit the application.
Please help....
Thanks!
Shweta

To quit an Flash application you can use this code:
fscommand2("quit");
Note: Only applications running in external stand-alone mode can use this fscommand2.

To quit an Flash application you can use this code:
fscommand2("quit");
Note: Only applications running in external stand-alone mode can use this fscommand2.

Thanks Chris!

Thanks Chris!

Hi Shweta,
I had posted few queries regarding flash in forum and I got to know that BREW MP supports AS1.0 only. But you are creating an application in AS2.0. Can you please tell me how you are achieving this on BMP.
Regards!
RV

Hi Shweta,
I had posted few queries regarding flash in forum and I got to know that BREW MP supports AS1.0 only. But you are creating an application in AS2.0. Can you please tell me how you are achieving this on BMP.
Regards!
RV

Hi RV,
In Publish Setting there is a option asking for ActionScript Version.
In the drop down i have selected AS 2.0 and i am able to publish the application well on BMP simulators.
Try this at your end.
Regards!
Shweta

Hi RV,
In Publish Setting there is a option asking for ActionScript Version.
In the drop down i have selected AS 2.0 and i am able to publish the application well on BMP simulators.
Try this at your end.
Regards!
Shweta

Hi Shweta/RV,
If I use AS 2.0, will it work on the actual device? I mean the device does not have any Flashlite version installed. It only has the default AMC 1.1.
Warm Regards,
Arun

Hi Shweta/RV,
If I use AS 2.0, will it work on the actual device? I mean the device does not have any Flashlite version installed. It only has the default AMC 1.1.
Warm Regards,
Arun

The AMC Flash player supports *some* AS2. Please see the document Adobe Mobile Solutions ActionScript Language Reference in the Library.
Hope this helps,
Mike

The AMC Flash player supports *some* AS2. Please see the document Adobe Mobile Solutions ActionScript Language Reference in the Library.
Hope this helps,
Mike