Posts categorized “Flash”.
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
Flash Examples
I’ve posted examples for the event listeners for mouse input (rotate and scale), drag and movie playback, including frame labels. They are very well commented. If you have any questions, email me!
Flash AS3 resources
Mouse Events Explained from Draw Logic
Event Listeners from Republic of Code
The AS3 Event System - Part 1: The Basics from Community MX
Changing frame rate from Flash Essential
Tutorialsphere (be careful only to look at AS3 examples)
Adobe ActionScript 3 reference: Events
Playing sounds via flash guide
Math in Flash from Flash & Math