# Load soundfile into fla using only AS

**URL:** <https://forum.kirupa.com/t/load-soundfile-into-fla-using-only-as/130089>\
**Category:** Uncategorized\
**Created:** [December 1, 2004, 12:19pm UTC](https://forum.kirupa.com/t/load-soundfile-into-fla-using-only-as/130089 "2004-12-01T12:19:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nettemor](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@nettemor](https://forum.kirupa.com/u/nettemor)\
**Post date:** [December 1, 2004, 12:19pm UTC](https://forum.kirupa.com/t/load-soundfile-into-fla-using-only-as/130089/1 "2004-12-01T12:19:34Z")

</div>

I want to load a soundfile (wav or mp3) into my application. The soundfile are set in the xml file, so what i need is some code to load this and play it.

Here is what i do, which does not work:  
speaker.stop();  
mysound = new Sound();

mysound.onSoundComplete = function() {  
speaker.stop();  
};

mysound.loadSound("/welcome.wav", false);

mysound.onLoad = function() {  
mysound.start();  
speaker.play();  
};

What is wrong here? Any ideas?
