- Click the input text field where users enter the quantity of CD players. Press Alt and drag the copy of the field down to the Shocks QTY area.
- Alt-click the input text field that you just dragged; then drag the new copy of the field to the Cover QTY area.
- Alt-click the dynamic text field for the CD player's price; then drag the copy of the field to the Shocks price area.
- Alt-click the field that you just dragged; then drag the copy to the Cover price area.
Name text fields
Before you can specify values for the text fields in ActionScript, you first need to give each text field an instance name in the Property inspector. Appending the instance name with "txt" identifies the object as a text object.
- Click the top input text field in the QTY column. In the Instance Name text box of the Property inspector (Window > Properties), type qty1_txt.
- Follow the previous procedure to name the middle and bottom input text fields qty2_txt and qty3_txt, respectively.
- Click the top dynamic text field in the Price column. In the Instance Name text box of the Property inspector, type price1_txt.
- Follow the previous procedure to name the middle and bottom text fields in the column price2_txt and price3_txt, respectively.
Add and name a Button component
Components are movie clips that offer an easy way of adding advanced functionality to your document without having to know advanced ActionScript. You'll use the Button component to create a Calculate button that totals prices. Because the component you're using is based onv ActionScript 2.0, you first need to configure your Publish Settings dialog box to ensure your Flash content plays as expected.
1.
|
Select File > Publish Settings.
|
2.
|
On the Flash tab of the Publish Settings dialog box, select ActionScript 2.0 in the ActionScript Version pop-up menu, if it's not already selected.
|
3.
|
In the Timeline, click the Components layer to select it.
|
4.
|
From the Components panel (Window > Components), drag the Button component to the Stage and place it over the Calculate guide.
|
5.
|
On the Parameters tab of the Property inspector, with the Button component selected, click the Button text on the Label row, and type Calculate. Then press Enter or Return.
The text that you type in the Label text box is the text that appears on the component. |
6.
|
In the Instance Name text box, enter calculate to provide the button with an instance name.
|
by
updated