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).