Hey all,
I'm trying to create a nice little preloader in flash 8. I've done a few tutorials and right now my actionscript is as follows (using 2.0 mind you):
stop();
loadbar._xscale = 1;
var loadingCall:Number = setInterval(preloadSite, 50);
function preloadSite() {
var siteLoaded:Number = _root.getBytesLoaded();
var siteTotal:Number = _root.getBytesTotal();
var percentage:Number = Math.round(siteLoaded/siteTotal*100);
loadbar._xscale = percentage;
percentClip._x = loadbar._x + loadbar._width;
if (siteLoaded >= siteTotal) {
clearInterval(loadingCall);
gotoAndStop(5);
}
}
The loader scales movieclip loadbar (a simple white bar) across the screen in conjunction with the % amount of bytes loaded. All the content I'm using is on frame 5.
So when I test my movie using the simulate download feature of flash, I get white screen for about 90% of the load time, then the loader goes really really fast, then my movie appears.
Anyone know what could be going wrong? My movie uses a lot of graphics from the library, are these somehow loading before the preloader perhaps?
Thanks a bunch.
***EDIT: NM, figured it out, I had the export in first frame box checked in the linkage of my graphics.
My indie mobile gaming studio:
Elder Aeons
Our first game is now available for free on Google Play:
Frontier: Isle of the Seven Gods