# loadSound starts fine, then a second starts replaying again

**URL:** https://forum.kirupa.com/t/loadsound-starts-fine-then-a-second-starts-replaying-again/184880
**Category:** flash
**Created:** [April 8, 2006, 7:42pm UTC](https://forum.kirupa.com/t/loadsound-starts-fine-then-a-second-starts-replaying-again/184880 "2006-04-08T19:42:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mprzybylski](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mprzybylski/32/613_2.png) [@mprzybylski](https://forum.kirupa.com/u/mprzybylski)
#### Post date: [April 8, 2006, 7:42pm UTC](https://forum.kirupa.com/t/loadsound-starts-fine-then-a-second-starts-replaying-again/184880/1 "2006-04-08T19:42:47Z")

</div>

I’ve got a site that is using loadSound to play some mp3s and it works fine. however, the sound starts to stream, and then replays itself like a second later. my guess is that its playing faster than the load is going and when it gets to the point where it hasn’t loaded enough, it starts to replay it, but i’m not sure that that is the exact problem. my code:

```auto
var track:Sound = new Sound();
track.onLoad = function(success:Boolean):Void {
    if (success) {
        track.start();
    }
};

function setTracks():Void {
    for (var i:Number = 0; i < 4; i++) {
        var ob:Object = new Object({id: i});
        ob.mc = this["track" + i + "_btn"];
        ob.mc.id = ob.id;
        
        ob.mc.onRelease = function():Void {
            track.loadSound("music/track" + this.id + ".mp3", true);
        };
    }
}

setTracks();

```

now, i tried making a playTrack function that i can call with setTimeout and i put that in the onLoad in place of track.start(), but that didn’t work either (i was hoping to not start playing the track for 3 seconds to give it some time to buffer). any ideas? thanks in advance.

---

<div class="post-metadata">

### Author: ![mprzybylski](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mprzybylski/32/613_2.png) [@mprzybylski](https://forum.kirupa.com/u/mprzybylski)
#### Post date: [April 8, 2006, 11:20pm UTC](https://forum.kirupa.com/t/loadsound-starts-fine-then-a-second-starts-replaying-again/184880/2 "2006-04-08T23:20:04Z")

</div>

wow i’m dumb, i just took out the onLoad function and it works fine. I didn’t know that the loadSound method will automatically play the sound when its ready after being streamed. learn something new every day i guess.
