Sound plays an important role in today’s games and applications. On this tutorial we have a extensive introduction to the Sound class in Actionscript and a easy to understand demonstration on how to use it.
CLICK HERE FOR A COMPLETE CARTOON SMART SOUND AND MUSIC TUTORIAL
HERE IS THE SOURCE CODE
//by Avraham Saltoun
// solutions at say-web dot com
//FREE TO USE, COPY and DISTRIBUTE
// As usual we start with an URL request
var req:URLRequest = new URLRequest (“Whoosh_Space_SE.mp3″);
//but unlike before, now we are using the Sound Class
// The Loader class is good for image files such as JPG, PNG, BMP and even SWF files
var sound:Sound = new Sound();
function soundLoaded(event:Event):void {
//The play method will play the MP3 File in the sound class variable
sound.play();
}
// This tells flash to fire the function only after loading is completed
sound.addEventListener(Event.COMPLETE, soundLoaded);
sound.load(req);
// thanks for watching
// I hope it helps !!!






60 Responses to “ActionScript 3.0 Video Lesson 28: How to Load and Play Sound in Flash using the Sound Class”
Trackbacks/Pingbacks
ab346368@gmail.com…
It’s not exactly normal for me to read this kind of subject matter, but this caught my attention as soon as I read the first sentence. Thank you so much….
ab346368@gmail.com…
Your content is nothing short of brilliant in many ways. I think this is engaging and eye-opening material. Thank you so much for caring about your content and your readers….
ab346368@gmail.com…
I have been searching online for this information and I have only found confusing and poorly written articles until now. This is the best and easiest to understand article on this topic I have found….
ab346368@gmail.com…
After I read this article I was very impressed. I enjoyed every paragraph very much. This is well-planned and written. This is really great work….
ab346368@gmail.com…
I can tell the writer of this article went above and beyond to research this information. I’m very impressed with your views and writing style….
ab346368@gmail.com…
I enjoyed your informative article. You were able to keep my interest through out with your attention-getting content. I really do appreciate your hard work….
Title…
Ugh that was odd. I just wrote an extremely long comment but after I clicked send my comment didn’t show up. Sigh well I’m not writing all that again. Anyways, just wanted to say great blog!…
Title…
Wow, I’m sincerely happy that I clicked on this site, good info here! Better than http://facebook.com!…
Title…
Wow, I’m sincerely happy that I landed on this site, great info here! Better than http://facebook.com!…
Title…
Ugh, I just typed a long comment, but it disappeared when I hit send. Anyway, I’m not going to retype it again, so I just wanted to say cool blog! Better than http://google.com!
…