|
-
Site loads while preloader is still running
I am having a tough time with my preloader. It loads fine but then 1/4 way through the loading process the site begins to animate underneath it. I think the problem is in my code in my master file. How do I tell my site to wait until the preloader is done to start the main site animation? Here is the code for my master.fla file:
stop();
//---------------<MCL>-----------------\\
//create the new MCL and Listener objects
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
// attach the Listener, myListener, to the MCL
myMCL.addListener(myListener);
myListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);
_level50.preloadInfo1.text = preloadPercent + " % loaded";
_level50.preloadInfo2.text = Math.round(loadedBytes/1000) + " k loaded / " + Math.round(totalBytes/1000) + " k total";
}
myListener.onLoadComplete = function (target_mc) {
_level50._visible = false;
}
//-------------</MCL>--------------------\\
// trigger the MCL to load these assets
myMCL.loadClip("trigger.swf", 5);
myMCL.loadClip("preloader.swf", 50);
//---------------<LoadVars>----------------\\
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been a error loading the requested information. Please contact the Webmaster [email protected] and report your error.";
}
}
//---------------</LoadVars>----------------\\
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|