Posts from March 2009.

Easy code for loading sound

Open a new Actionscript 3.0 Flash document. Save it to a folder. Copy an MP3 into the same folder.

Open the ActionScript window on frame one and add the following code, replacing the name of the MP3 with yours (remove the spaces from the filename in the finder or you’ll be scratching your head):

var mySong:Sound = new Sound();
mySong.load(new URLRequest(”TheNationalAnthem.mp3″));
mySong.play();

Run it and listen to your MP3 play back. You’ve just loaded your first external file (no linkage needed). You can call mySong.play() from anywhere, including a function that’s called from a button or rollover! You can also load multiple sounds, so as long as you create new instance names (MySong1, MySong2, etc).

Flash Examples post-midterm

CREATING CUSTOM BUTTONS
custom buttons

ADDCHILD
Displaying library content in AS3
Advanced – The Display List, The Stage, and “addChild” in Flash CS3

PLAYING BACK FLV MOVIES (THINK YOUTUBE) WITH FLVPlayback
FLVPlayback

LOOPS
What are loops?

CONDITIONALS
Conditionals 1
Conditionals 2

DRAWING SHAPES WITH AS3
shapes

Advanced – LOADING EXTERNAL FILES
External Files

PRELOADER BAR

Preloading in ActionScript 3.0, the Easy Way
Creating a Preloader and Progress Bar

HACKING EXISTING CODE
Drag and drog objects onto another object
Create a magnifying glass