MACROMEDIA FLASH 8-FLASH Specifikace Strana 101

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 290
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 100
Declare variables and values for the prices 101
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.
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;
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.
Zobrazit stránku 100
1 2 ... 96 97 98 99 100 101 102 103 104 105 106 ... 289 290

Komentáře k této Příručce

Žádné komentáře