Ok, so I’ve been playin around with loading MP3’s externally … and I finially managed to get a preloader working … however, now at the end of the preload function it doesn’t play the file!?
If the mp3 is in the browser cache … it will play the file!? How weird.
wanna see? The Site
Click the top right button for the player to slide out.
My code:
mySounda = new Sound();
preloadNow = 1;
mySounda.loadSound("Track2.mp3",false);
this.onLoad = function () {
mySoundLoading = 0;
_root.sounds.loadBar._xscale = mySoundLoading;
}
this.onEnterFrame = function () {
mySoundBytesTotal = _root.sounds.mySounda.getBytesTotal();
mySoundBytesLoaded = _root.sounds.mySounda.getBytesLoaded();
if (preloadNow==1 && mySoundBytesLoaded>0) {
mySoundLoading = Math.round((mySoundBytesLoaded/mySoundBytesTotal)*100);
if (mySoundLoading > 99) {
_root.sounds.mySounda.start(0,1)
_root.sounds.textd = _root.sounds.mySounda.id3.TIT2;
_root.sounds.playing = true;
_root.sounds.preloadNow = 0;
} else {
_root.sounds.textd = mySoundLoading + "%";
_root.sounds.loadBar._xscale = mySoundLoading;
}
}
}
I discovered that my preloader wasn’t working before becoz I had two “onEnterFrame” events on the same frame. Obviously a no-no.
Anyway, can anyone help me with this?! Would be MUCH appreciated!!!