![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/2/38/2388e2db-29fd-4cb4-ba34-dd210e2d1db6/2388e2db-29fd-4cb4-ba34-dd210e2d1db6-bg99.png)
Macromedia MAX 2005 - Anaheim, CA What’s New In Flash 8
153
In the Timeline, select the keyframe on Frame 10 on the layer named Key Catcher.
From the Library, drag the Key Catcher button symbol and place it in the work area off the
Stage.
1.
The purpose of this button is to "catch" ActionScript keypress events initiated by the user, and
then take the appropriate action.
Select the key catcher button, and in the Actions panel, enter the following code:
// Handle right soft key event ("Next" button):
on(keyPress "<PageDown>") {
play();
}
// Handle left soft key event ("Home" button):
on(keyPress "<PageUp>") {
gotoAndStop("main");
}
The first on(keyPress) handler advances the image animation to the next image in the
sequence; the second one sends the playhead to the main application screen.
Choose Control > Test Movie to test the final application in the emulator.