Firstly, you will need to create a symbol as a button. After placing it on stage, right-click on it to select Actions and enter this:
on(keyPress "
//put in response here
trace("Pressed Enter");
}
"
*Note: "
Cellphone Button Keypress Designation
0-9, *, #
Select key
Left Arrow key
Right Arrow key
Up Arrow key
Down Arrow key
Left soft key
Right soft key
0, 1, 2, 3, 4, 5, 6, 7, 8, -9, *, #
compile to see what happens. In our example, you can see what happens:
It's important to keep in mind that this method does not require you to physically place the button somewhere. In the subsequent flash menu tutorials, you will see that the button is placed off of the stage so it can not be seen. Thus, for a flash menu, it acts more of a listener than anything.
In Flash Lite 2.0, you can actually create movie clip listeners that will listen for any key being pressed and return the identity of the key being pressed. For more indepth differences,
No comments:
Post a Comment