# Sound object & loadSound();

**URL:** https://forum.kirupa.com/t/sound-object-loadsound/42349
**Category:** Uncategorized
**Created:** [February 8, 2004, 6:24am UTC](https://forum.kirupa.com/t/sound-object-loadsound/42349 "2004-02-08T06:24:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sigfa](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Sigfa](https://forum.kirupa.com/u/Sigfa)
#### Post date: [February 8, 2004, 6:24am UTC](https://forum.kirupa.com/t/sound-object-loadsound/42349/1 "2004-02-08T06:24:46Z")

</div>

Ok, so I have this problem: I have a music wav file on the net, lets say, myMusicURL. I have a one framed movie website and the code on its frame is this: [AS]music1 = new Sound();  
music1.loadSound(“myMusicURL”, false);  
optionstxt = “Downloading Music…”  
[/AS]

optionstxt is a variable that a dynamic textbox on the scene uses. Then I have a mc w/ two keyframes and on its first frame I have: [AS]music2 = \_root.music1;  
if(music2.getBytesLoaded() == music2.getBytesTotal()){  
\_root.optionstxt = “Playing…”  
music2.start();  
music2.setVolume(100);  
}  
[/AS]

but, when test the movie, the textbox shows playing, because it thinks that the music object has loaded. well, it ain’t 🙂

Help, anyone?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 8, 2004, 10:30am UTC](https://forum.kirupa.com/t/sound-object-loadsound/42349/2 "2004-02-08T10:30:23Z")

</div>

…I believe you can only load MP3s dynamically. :-/

Also, you could simply use the [font=courier new]Sound.onLoad[/font] event handler.

```auto
var music1 = new Sound();
music1.onLoad = function() {
	this.start();
	optionstxt = "Playing...";
};
optionstxt = "Loading...";
music1.loadSound("myMusicURL", false);

```
