[quoted text, click to view] "spreenchy" <webforumsuser@macromedia.com> wrote in message
news:d5bp91$ce1$1@forums.macromedia.com...
> First, thanks so much for replying... I was starting to feel kind of
> lost in
> the wilderness...
>
> Yes I made the mistake of putting the load command before the
> onLoad()
> handler. So, I took your advice and reversed the order of the
> statements, but
I don't find any difference whether the onLoad event hander is defined
before or after the loadSound command. It works either way in IE and
Firefox. It's not going to get fired until much later anyway, after
the sound finishes loading (unless your cache still has the file in
it). (empty your cache every time while testing)
Here is test with onLoad handler code following the loadSound..
http://members.cox.net/4my5cats/loadmp3a.html And here is same code but the onLoad hander code precedes the
loadSound function
http://members.cox.net/4my5cats/loadmp3.html Here is the code I used.. small changes to what you had..
// frame 1 code
mySample = new Sound(this);
mySample.setVolume(75);
mySample.loadSound("sound2.mp3", false);
mySample.onLoad = function ()
{
gotoAndStop("stopped"); // label 'stopped' on frame 20
}
_root.onEnterFrame = function()
{
var gbt = mySample.getBytesTotal();
total.text = gbt;
var gbl = mySample.getBytesLoaded();
loaded.text = gbl;
var percentage = (gbl / gbt) * 100;
caption.text = Math.floor( percentage ) + "% loaded";
if(percentage == 100)
delete this.onEnterFrame;
}
// frame 6 code
gotoAndPlay(2);
HTH
tralfaz