PDA

View Full Version : Stupid loader


ixlepixle
07-12-2004, 10:11 AM
I've made several attempts at making a preloader, and I have yet to succed. The most annoying thing is that it doesn't work when I embed it in a browser/test the movie, but it works if I do a "simulate download". Anyone ever seen anything like this?

Tink
07-12-2004, 10:34 AM
can we see the code you are using

ixlepixle
07-12-2004, 10:49 AM
This is my loader:

// LOADER
onClipEvent(enterFrame){
trace("clipEvent");
bytesTotal = Math.round(_root.getBytesTotal() / 1024);
bytesLoaded = Math.round(_root.getBytesLoaded() / 1024 );
trace(bytesTotal);

tekst = "Loaded = " + bytesLoaded + " Kb" + newline +
"Total = " + bytesTotal + " Kb" + newline;

if (bytesLoaded >= bytesTotal){
_root.gotoAndStop("Web_loader");
delete this.onEnterFrame;
}// else {_root.gotoAndPlay("Gfx_loader");}

}

And when it is done loading, I dynamically place components on the stage with Actionscript. I think perhaps that is the problem. I have ticked off the "Export to first frame" and I have altered the publishing settings to a later frame (where my web_loader is (Connect to a webservice and get info)). I can't for the life of me understand WHY this isn't working, I've tried every tutorial and I'm running out of new ideas for workarounds...

Tink
07-12-2004, 11:00 AM
if (bytesLoaded >= bytesTotal){ could it be that both of these could at the very beginning equal '0' and therefore cancal out the preloader?

tryif (bytesLoaded >= bytesTotal && bytesTotal > 20){

ixlepixle
07-12-2004, 11:04 AM
Hmm, that's a good suggestion but it wasn't that. My scenes loads 'partially', with that I mean that my objects are placed on the stage, but not completetly. For instance, I use a Button-component, and its bounding rectangle appears but nothing else.

ixlepixle
07-12-2004, 11:08 AM
AAaaaah, of COURSE! I put all my library items in an empty frame between my loader and my main-scene. Most of my items are loaded dynamically so that the preloader just skipped them since none of them were placed on the stage explicitly. Thank you anyway for your help Tink :) I really like the actionscript community :)

Tink
07-12-2004, 11:15 AM
glad you found the prob.

this may help in the structuring of your timeline http://www.actionscript.org/forums/showthread.php3?t=49819&highlight=frame