Declare Variables And Values For The Prices - MACROMEDIA FLASH 8-FLASH Tutorials Manual

Hide thumbs Also See for FLASH 8-FLASH:
Table of Contents

Advertisement

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.
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;

Declare variables and values for the prices 101

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-FLASH and is the answer not in the manual?

Table of Contents

Save PDF