anca.andreica
06-11-2004, 07:47 PM
I have this problem with the sound that doesn't start. I load it (I'm using a preloader for it) after it is loaded, it doesn't always start. Sometimes it does, sometimes it doesn't. Can you please give me a hint?
song1.loadSound(song1.mp3");
preloadNow=1;
mySoundLoading=0;
_root.loadbar._visible=true;
this.onEnterFrame = function ()
{ mySoundBytesTotal =_root.song1.getBytesTotal();
mySoundBytesLoaded=_root.song1.getBytesLoaded();
if (preloadNow==1 && mySoundBytesLoaded>0) {
mySoundLoading=Math.round((mySoundBytesLoaded/mySoundBytesTotal)*100);
_root.percentLoadedText="Loading..."+mySoundLoading+"%";
if (mySoundLoading==100) {
preloadNow=0;
_root.loadbar._visible=false;
_root.song3.stop();
_root.song2.stop();
_root.song1.start();
}
}
}
well, the loadbar is no longer visible, so this means that mySondLoading reach 100, but the song doesn't always start. the second time when i push the button to play the song, it starts instantly, because it is already on the computer.
thanx for your help,
anca
song1.loadSound(song1.mp3");
preloadNow=1;
mySoundLoading=0;
_root.loadbar._visible=true;
this.onEnterFrame = function ()
{ mySoundBytesTotal =_root.song1.getBytesTotal();
mySoundBytesLoaded=_root.song1.getBytesLoaded();
if (preloadNow==1 && mySoundBytesLoaded>0) {
mySoundLoading=Math.round((mySoundBytesLoaded/mySoundBytesTotal)*100);
_root.percentLoadedText="Loading..."+mySoundLoading+"%";
if (mySoundLoading==100) {
preloadNow=0;
_root.loadbar._visible=false;
_root.song3.stop();
_root.song2.stop();
_root.song1.start();
}
}
}
well, the loadbar is no longer visible, so this means that mySondLoading reach 100, but the song doesn't always start. the second time when i push the button to play the song, it starts instantly, because it is already on the computer.
thanx for your help,
anca