Write an event handler for the componentFor your SWF file to react to events such as a mouse click, you can use event handlers-ActionScript associated with a particular object and event. You'll use an on() event handler for the Button component that calculates the total price when users click the button. For more information about event handlers, see "Handling Events" in Flash Help.
The event handler that you typed specifies that the text in the priceTotal_txt field should be the sum of the values in the price1_txt, price2_txt, and price3_txt fields. |
Test your applicationYou'll test your application to ensure that it executes as expected.
|
Summary
Congratulations on learning how to create an application. In a few minutes, you learned how to complete the following tasks:
-
Copy input and dynamic text fields.
-
Assign instance names to text fields.
-
Add a Button component.
-
Declare variables and values.
-
Specify values for text fields.
-
Write a function.
-
Write an event handler for the component.
To learn more about ActionScript, see the ActionScript tutorials starting with Tutorial 18, "ActionScript: Use Script Assist mode".