Hi,
my preloader is working when its first run, but it doesn’t go to the 2nd frame if the page is refreshed. (Its for a swf that has about 9,000 frames but I don’t think thats the issue)
onClipEvent (enterFrame) {
mctotal = _root.getBytesTotal();
mcloaded = _root.getBytesLoaded();
mcpercent = Math.round((mcloaded/mctotal)*100);
kb_load = Math.round(mcloaded/1000);
kb_total = Math.round(mctotal/1000);
loadBar._xscale = mcpercent;
loadKb = kb_load + "kb load /" + kb_total + "kb total";
loadText = mcpercent + "%";
if (mcpercent == 99) {
_root.gotoAndPlay(2);
}
}
Any suggestions would be greatly appreciated
it’s right here -->> [COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR]mcpercent == [COLOR=#000080]99[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000][/COLOR]
[COLOR=#000000]You’re checking if the loaded percent of the SWF is ONLY equal to 99, but if you refresh the page, and the SWF has already been loaded and cache’d then the loaded percent is going to be 100, so whatever actions you have after the if (something) {… won’t work[/COLOR]
[COLOR=#000000][/COLOR]
[COLOR=#000000]Change it to…[/COLOR]
[COLOR=#000000][/COLOR]
[COLOR=#000000][COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR]mcpercent >= [COLOR=#000080]99[/COLOR][COLOR=#000000]) {[/COLOR][/COLOR]
[COLOR=#000000][COLOR=#000000][/COLOR][/COLOR]
[COLOR=#000000][COLOR=#000000]That should do it…[/COLOR][/COLOR]
thanks it worx.
what would I do if it were in a seperate swf loaded into an mcHolder?
If what i was in a seperate SWF? The loader? I’m pretty sure if the loader was in a different clip, you could just use the same code.
it was working just fine but now I have to have it (the swf w/an mc preloader) Load into a main swf’s mc. I don’t know why it wouldn’t work, unless its bcuz the AS is on an mc rather than a frame?