![MACROMEDIA FLASH 8-DEVELOPING FLASH LITE 2.X Develop Manual Download Page 15](http://html1.mh-extra.com/html/macromedia/flash-8-developing-flash-lite-2-x/flash-8-developing-flash-lite-2-x_develop-manual_3346288015.webp)
Handling key events (Flash Professional Only)
15
To create and use a key catcher button:
1.
Create a new document from the Flash Lite 1.1 Series 60 template, and save it as
keycatcher.fla.
For more information on creating documents from the Flash Lite templates, see “Using
Flash Lite document templates (Flash Professional Only)” in
Getting Started with
Flash Lite
.
2.
Select the layer in the Timeline named Content.
3.
Using the Oval tool, create a oval or circle on the Stage and convert it to a movie clip.
4.
With the new movie clip selected, in the Property inspector, type
circle
in the Instance
Name text box.
5.
Using the Text tool, create a text field that contains the text
key catcher
, and convert it to
a button symbol.
6.
Position the new button symbol in the work area around the Stage. To view the work area
around the Stage, select View > Work Area.
7.
Select the key catcher button instance, and open the Actions panel (Window > Actions).
8.
Enter the following code in the Actions panel:
on(keyPress "<Left>") {
circle._x -= 10;
}
on(keyPress "<Right>") {
circle._x += 10;
}
on(keyPress "<Up>") {
circle._y -= 10;
}
on(keyPress "<Down>") {
circle._y += 10;
}
Key catcher button
Movie clip instance
circle