Adobe Flash

Declare variables and values for the prices

For your application to multiply the quantity of parts selected by the price of the part, you need to define a variable for each part in ActionScript. The value for the variable is the cost of the part.

1.
In the Timeline, click Frame 1 of the Actions layer and open the Actions panel (Window > Actions).

2.
In the Script pane, type the following:

// Declare variables and values for car part prices.

The parallel slashes (//) indicate that the text that follows is a comment. As a best practice, always add comments that offer an explanation of your ActionScript.

Note

As you take this lesson, you might find that you'd like to turn off code hints-the tooltips that prompt you with the correct ActionScript syntax. If so, you can turn off code hinting by clicking the pop-up menu in the upper-right corner of the Actions panel. Select Preferences, and then deselect Code Hints on the ActionScript tab.

3.
Press Enter (Windows) or Return (Macintosh) and type the following to indicate the cost of each part:

var priceCD = 320;

var priceShocks = 150;

var priceCover = 125;