ActionScript 3.0 Video Lesson 28: How to Load and Play Sound in Flash using the Sound Class

Mon, Sep 7, 2009

ActionScript


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.

DOWNLOAD THE SOURCE FLA FILE

CLICK HERE FOR A COMPLETE CARTOON SMART SOUND AND MUSIC TUTORIAL

HERE IS THE SOURCE CODE

// Loading Sound in ActionScript 3.0
//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 !!!

Related Articles:

, , , , , , , , , , , , , , , , , ,

60 Responses to “ActionScript 3.0 Video Lesson 28: How to Load and Play Sound in Flash using the Sound Class”


Trackbacks/Pingbacks

  1. 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….

  2. 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….

  3. 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….

  4. 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….

  5. 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….

  6. orbitz says:

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

  7. tatuaggi says:

    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!…

  8. SEO Company says:

    Title…

    Wow, I’m sincerely happy that I clicked on this site, good info here! Better than http://facebook.com!…

  9. SEO Company says:

    Title…

    Wow, I’m sincerely happy that I landed on this site, great info here! Better than http://facebook.com!…

  10. SEO Company says:

    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! :-)

Leave a Reply

You must be logged in to post a comment.

My name is Avraham Saltoun, and I live in Jerusalem, Middle East. I am currently on my mid  40's and I am a computer programming technician. Here you will find over one hundred quality video tutorials on Actionscript, and yes, I give online support for aspiring programmers, and pros as well, sharing screen on skype and delivering source code by email, click the button for live flash actionscript support now!

 
oDesk Certified Action Script Programmer
oDesk Certified Adobe Flash CS3 Designer
oDesk Certified Adobe Photoshop 6.0 Designer
Skype Me™!

$7.49 .Com! Score Savings Cartoon Smart Tutorials


839
Unique Visitors
Previous 30 Days
Powered By Google Analytics