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.

<strong>Flash</strong> <strong>MX</strong> <strong>2004</strong> <strong>Games</strong><br />

Figure 8.7 Specifying which font outlines <strong>to</strong> embed<br />

But where do we put the code? Simply click on the movie clip then press F9 <strong>to</strong> open the Actions<br />

panel or alternatively you can click on the arrow icon highlighted in the Properties window for<br />

the ‘Box’ movie clip, shown circled in Figure 8.8.<br />

Figure 8.8 Properties window for the ‘Box’ movie clip<br />

When you use movie clips you will often be placing code in an ‘event’. Movie clips have several<br />

events; one that occurs many times a second is the ‘enterFrame’ event. This occurs as many times<br />

per second as the movie ‘fps’ setting. So if this is set <strong>to</strong> 20 fps, for example, this event will occur<br />

20 times per second. All movie clip events have the same basic syntax: i.e. the call ‘onClipEvent’<br />

followed by brackets containing a parameter. We will look at using other events as you progress<br />

through the book, but for now we will just look at this one. After the brackets we use the usual<br />

curly brackets <strong>to</strong> contain the code that will be executed when this event occurs. Finally we come<br />

110

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

Saved successfully!

Ooh no, something went wrong!