I have the following code in the first frame of my movie:
this._lockroot = true;
import mx.transitions.Tween;
import mx.transitions.easing.*;
import flash.display.BitmapData;
#include "as/vars.as"
#include "as/misc.as"
#include "as/stageResize.as"
#include "as/intro.as"
#include "as/phase1.as"
#include "as/phase2.as"
#include "as/serverCommunication.as"
resizeAdjustments();
function preloaderProgress():Void{
trace("here");
var bytes:Number = _root.getBytesTotal();
var bytes_loaded:Number = _root.getBytesLoaded();
//code to update preloader %
if (bytes_loaded == bytes and bytes > 0){
clearInterval(intervalId);
gotoAndStop("fra_intro");
}
}
var intervalId:Number;
intervalId = setInterval(this, "preloaderProgress", 1);
The resizeAdjustments() function just resizes the stage and a few movie clips (very light work), and the .as files that are included are just variables and functions, nothing’s actually happening in them.
When I simulate download at 56 kb/s or so, it takes a few seconds for “fra_main” (the beginning frame after the preloader) to load, but the preloader doesn’t show up until it’s 100% at the very end. I put in a trace at the top of preloaderProgress() but it only outputs one time and that is when fra_main is loaded and all the preloading is over.
Is this problem because of how I’m importing classes? Or maybe because I’m using a font symbol? Frame 2 of the movie is a “preloader junk” frame where I throw in every movieclip that’s linked via actionscript but never actually put on the stage, and I also put textboxes that have all the main characters of the font symbol embedded. Even if it was an issue with something like classes or font symbols, I would think at 14.4 kb/s I would at least see some loading progress for the rest of the stuff in the movie.