User Guide
Handling key and button events (Flash Professional only) 25
9. With the new text field still selected, do the following in the Property inspector:
a. Select Dynamic Text from the Text Type pop-up menu.
b. Ty p e txt_status in the Instance Name text box.
The Stage should look something like the following image:
10. In the Timeline, select Frame 1 in the layer named ActionScript.
11. Open the Actions panel (Window > Actions) and enter the following code:
// Disable the focus rectangle because buttons have an over state
_focusRect = false;
btn_news.onRollOver = function() {
txt_status.text = "Press to select News"
}
btn_news.onPress = function() {
txt_status.text = "You selected News"
}
btn_sports.onRollOver = function() {
txt_status.text = "Press to select Sports";
}
btn_sports.onPress = function() {
txt_status.text = "You selected Sports";
}
btn_weather.onRollOver = function() {
txt_status.text = "Press to select Weather";
}
btn_weather.onPress = function() {
txt_status.text = "You selected Weather";
}