Music Load Question

Ok I have a sound Object on the _root timeline that plays when the page loads, that works great.

I want to preload it so that the user can see the % of it loaded. Here is my code:

[AS]_root.backgroundMusic.bytes_loaded = Math.round(_root.getBytesLoaded());
_root.backgroundMusic.bytes_total = Math.round(_root.backgroundMusic.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
loadedBox = Math.round(getPercent*100)+"%";[/AS]

The Object is names backgroundMusic it is a sound Object (duh).

When I enter that code I get a “NaN%” in the dynamic text box named loadedBox

Thanks.:cap:

as was not ment for julian get over it lol

really i have no idea how to do that

Ok I updated the code to the following:

[AS]_root.backgroundMusic.bytes_loaded = Math.round(_root.backgroundMusic.getBytesLoaded());
_root.backgroundMusic.bytes_total = Math.round(_root.backgroundMusic.getBytesTotal());
_root.backgroundMusic.getPercent = _root.backgroundMusic.bytes_loaded/_root.backgroundMusic.bytes_total;
loadedBox = Math.round(_root.backgroundMusic.getPercent*100)+"%";[/AS]

It works in my computer but when I upload it is doesn’t work. :frowning:

ij try uploading to my coldfusion server and maybe it can work?

Here is my code, I try it in my machine and it works but not online…hmm. I asked every Flash forum I know of and they wont reply.

//Loads Background Music
backgroundMusic = new Sound();
backgroundMusic.loadSound(“bg_music.mp3”, false);
backgroundMusic.start(0, 9999);
//Preloads The Background Music
backgroundMusic.bytes_loaded = Math.round(backgroundMusic.getBytesLoaded());
backgroundMusic.bytes_total = Math.round(backgroundMusic.getBytesTotal());
backgroundMusic.getPercent = backgroundMusic.bytes_loaded/backgroundMusic.bytes_total;
loadedBox = Math.round(backgroundMusic.getPercent*100)+"%";