Flash CS3 Documentation |
|||
| Developing Flash Lite 1.x Applications > Creating Interactivity and Navigation > Handling button events > Creating a simple menu using buttons and tab navigation | |||
This section shows you how to create a simple menu using buttons and tab navigation. To create the menu, you'll use three button symbols, one for each menu option. You'll attach event handling code to each button instance that displays a message when the user rolls over each menu item--that is, when the user gives focus to the corresponding button--and when the user selects the menu item by pressing the Select key on their device. For more information about handling button events in Flash Lite, see Handling button events.
You'll start with a partially completed Flash document that is preconfigured to target the Nokia 7610 and the Standalone Player content type. You can change these settings to target a different device and content type (see the Adobe Device Central help for more information).
Notice that the Library contains three buttons symbols named News Button, Weather Button, and Sports Button.
This text field displays a short message when the user rolls over each menu item.
on(rollOver) {
status = "Press to select News"
}
on(press) {
status = "You selected news"
}
This code assigns some text to the dynamic text field when the user rolls over the News menu button.
on(rollOver) {
status = "Press to select Sports";
}
on(press) {
status = "You selected Sports";
}
on(rollOver) {
status = "Press to select Weather";
}
on(press) {
status = "You selected Weather";
}
_focusRect = false;
This disables the yellow focus rectangle that Flash Lite draws by default around buttons and text fields that have focus (see About the focus rectangle).
At this point, the Stage should look something like the following image:
Click the Down Arrow key with your mouse (or press the Down Arrow key on your computer's keyboard) to navigate between menu options; to select a menu item, click the Select key by using your mouse (or press the Enter key on your computer's keyboard).
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00005651.html