02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 7: So what is a variable?<br />

a frame action. As you experiment with code, you are encouraged <strong>to</strong> keep one layer of the timeline<br />

for frame actions; do not place frame actions in any other layer. To add a frame action, follow<br />

these simple steps:<br />

1 Create the empty layer that you will use for frame actions. If the layer already exists then<br />

skip this step and go on <strong>to</strong> stage 2.<br />

2 Click on the timeline in the frame action layer at the<br />

frame in which you want <strong>to</strong> add, or edit, the action.<br />

Open the Action panel using ‘Window/Development Figure 7.3 Icon used <strong>to</strong> open<br />

Panels/Action’, by pressing F9 or by selecting the arrow the Action panel<br />

icon shown in Figure 7.3, which is found in the<br />

Properties panel.<br />

3 The panel shown in Figure 7.4 opens. The pane in the <strong>to</strong>p left shows the many objects and<br />

functions you can use. The pane in the bot<strong>to</strong>m left gives an overview of your movie. For<br />

the purposes of this chapter and <strong>to</strong> keep things as simple as possible click the small left arrow<br />

on the divide between the left and right panes. This will close the left-hand panes.<br />

4 Enter code simply by typing in<strong>to</strong> the biggest pane. Remember every line of <strong>ActionScript</strong><br />

finishes with a semi-colon.<br />

Figure 7.4 Entering <strong>ActionScript</strong> for a frame action<br />

85

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!