I’m not that much of a newbie to Flash but sometimes I sure feel it.
I have been working with the XML Photo Gallery tutorial here on kirupa.com
I’ve been spinning my wheels figuring out this preloader for days so any help is greatly appreciated! http://www.kirupa.com/forum/images/smilies/classic.gif
The sample gallery online works fine, after following the tutorial my vresion works fine too, except for the preloader!
HERE IS THE PRELOADER CODE FROM THE KIRUPA TUTORIAL:
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
trace(“filesize =” + filesize);
trace(“loaded =” + loaded);
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
I ADDED THE TRACES TO SEE WHAT WAS GOING ON - this is the result:
filesize =4
loaded =4
filesize =4
loaded =4
filesize =4
loaded =4
filesize =-1
loaded =0
filesize =2431002
loaded =2431002
ad infinitum
I used a very large 2.5 meg jpeg to load so that I could see the effect.
Instead I get a white screen, preloader not visible at all, until the file loads and then it fades in.
And yet somehow the “fading in” does not start until it is fully loaded. I would have presumed that the alpha fade would start immediately because both filesize and loaded are equal (4 & 4) from the beginning.
Thanks!