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