Hello forum
I ll get right to the point. I have a simple basic preloader that has served me well over the years. A swf loads my main swf.
Code:
import fl.display.SafeLoader
import fl.display.SafeLoaderInfo;
var myMovie:Sprite;
var l:SafeLoader = new SafeLoader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop, false, 0, true);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done, false, 0, false);
l.load(new URLRequest(“app.swf”));
function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;
txt.text = Math.ceil(perc*100).toString() +"%";
}
function done(e:Event):void
{
myMovie = MovieClip(l.content);
addChild(myMovie);
l.contentLoaderInfo.removeEventListener( ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.removeEventListener(Event.COMPLETE, done);
l = null;
}
I works perfectly! My question is…
The first time the user preloads the app.swf (online) everything is fine. The second time because the browser has cashed the main app.swf (I am guessing that is the reason) its really fast (the preloder blinks before the app.swf appears). So I dont know if its possible when the preloading progress is faster (for example) than 4 seconds the preloader fakes a 4 second progress even if the app.swf is allready loaded. I dont know if I am making my self clear because I am not a native speaker, so I am sorry in advance if the things I say makes no sense.
Thank you very much, even a push to the right direction will be highly appreciated
Chris