28
Creating Interactivity and Navigation
3.
In the Timeline, select the Content layer.
4.
Using the Text tool, create a static text field named Left (or text of your choice) and
position it in the lower-left corner of the Stage, above the Left soft key on the device.
5.
Create another static text field named Right, and position it in the lower-right corner of
the Stage, above the Right soft key on the device.
6.
Using the Text tool, create another dynamic text field and position it in the middle of
the Stage.
This text field displays a message when you run the application and press the Left and
Right soft keys. Your document’s Stage should look like the following image:
7.
With the status text field still selected, in the Property inspector, type
status
in the Var
text box.
8.
Create a key catcher button (see
“Creating a key catcher button (Flash Professional Only)”
on page 14
). In the Actions panel, attach the following code to the button:
// Handle Left soft keypress event
on(keyPress "<PageUp>") {
status = "You pressed the Left soft key.";
}
// Handle Right soft keypress event
on(keyPress "<PageDown>") {
status = "You pressed the Right soft key.";
}
9.
In the Timeline, select Frame 1 on the Actions layer.
NO
T
E
In a real-world application, you might want to use something other than ordinary text
fields for the soft key labels, such as graphic or movie clip symbols.
Status message text field
Soft key labels