Return to Kroll Design home page

Flash Tutorials (with .FLA files included)

« Return

ActionScript 3

Play sound using external files

This is another example that plays an MP3 file which is not embedded in the Flash file, but which is stored in an external folder on the server. The ActionScript is in an external class file of type .AS.

Download the .FLA file

Download the .AS file

The .FLA file has no code. Its Class in the Properties window for the .FLA specifies the .AS file name of PlayExternalSound. Here's the code in the class file:

package {
import flash.display.Sprite;
public class PlayExternalSound extends Sprite {
	public function PlayExternalSound() {
	var note1:Sound = new Sound();
	var note1_mp3:URLRequest = new URLRequest('movies/sounds/scale/note1.mp3');
	} // end of function PlayExternalSound
} // end of class PlayExternalSound
} // end of package

« Return

©2012 Kroll Design    781.910.3694
Last modified: 12/31/1969 7:00 PM