âš ī¸ Warning âš ī¸ Deprecated Code! This video tutorial contains outdated code.
💡 If you wish to update it, any AI assistant will update the code for you in seconds.

Loading Sounds Using the Sound Object or Library Files

Published : November 14, 2014   •   Last Edited : November 24, 2025   •   Author : Adam Khoury
This video demonstrates the two ways in which a Flash programmer can define a sound file through Actionscript 3.0 for full on script control.

// First method of defining a sound file to play
var snd:Sound = new Sound();
var req:URLRequest = new URLRequest("mp3_files/thriller.mp3");
snd.load(req);
snd.play();

// Second method of defining a sound file to play
var snd:myTrack = new myTrack();
snd.play();

// Watch the video to discover the differences in them