actionscript 3.0

These files are not mentioned in the book.

ActionScript 3 is radically different from Actionscript 1 or 2. Most of the script in the book works fine with ActionScript 2. You can set the ActionScript version either when you start a new file in Flash, or later by opening Publish Settings and changing it there, under the tab labeled "Flash."

For some basic tasks in Flash journalism, I have created a tutorial FLA (saved for Flash CS3; will work in CS4 also) that contains the ActionScript 3 script for you to copy and paste.

Everything is in the FLA file. Download, open, view script and comments in the Actions panel.

Buttons

Basic buttons
Two buttons stop and play the Timeline. ActionScript 3 for the simplest buttons (see Frame 1 in the FLA).
> SWF   > FLA

Sound

Loading an external MP3 and playing it
This file does exactly that -- no buttons, no nothing. One frame.
> SWF   > FLA   > Download the MP3 (940 KB)*

Loading an external MP3 and controlling it (play and stop)
This file includes the ActionScript for a replay button and a stop button for an audio file.
> SWF   > FLA   > Download the MP3 (940 KB)*

*This is the same MP3 file. If you want to use one of your own without changing the script, then change the name of your MP3 to "guitar.mp3"; make sure the MP3 is inside the same folder with the FLA when you test it.

Updated 30 March 2009