all groups > flash actionscript > march 2007 >
You're in the

flash actionscript

group:

Newbie / preloader-progress bar help



Newbie / preloader-progress bar help yesdream
3/28/2007 7:28:59 PM
flash actionscript: Hello - building my first site. created a preloader.fla and also a master.fla
that i want the preloader to load into.

1. when i preview just the preloader file, it starts displaying my flash page
before the progress bar is complete.
2. when i preview my master file, the preloader does not work, but 2 splash
pages load on top of each other.

--------------------
my actionscript for my preloader is:

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myMCL.addListener(myListener);

myListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number,
bytesTotal:Number) {
var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
progressBar.gotoAndStop(loaded);
}

myListener.onLoadInit = function (target_mc:MovieClip) {
progressBar._visible = false;
}

myListener.onLoadStart = function (target_mc:MovieClip) {
progressBar._visible = true;
}

myMCL.loadClip("splash.swf", "container");

--------------------

my actionscript for my master file is:
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myMCL.addListener(myListener);

myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number,
totalBytes:Number) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes/totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);
}

myListener.onLoadComplete = function(target_mc:MovieClip) {
_level50._visible = false;
}
myMCL.loadClip("splash.swf", 5);
myMCL.loadClip("preloader.swf", 50);

-----------------------------------------

can anyone see right off hand what my problem(s) are? also, i've gotten to
this point with online tutorials and books and it would be most appreciative if
you could reply in as simple as possible newbie terms - thx developers!

Re: Newbie / preloader-progress bar help MotionMaker
3/29/2007 12:00:00 AM
Do you know what is necessary to make your Movie require a preloader?

Are you trying this with a simulation of streaming in the Test Movie mode?

Did you set the streaming to a very low bps if you have no content in the
movie to warrant streaming or did you place large amounts of content to force a
slower load while simulating.

Are you simulating live and your movie is cached or is the bandwidth you have
very high speed?

Are you placing trace statements in each of the event handlers for
MovieClipLoader to be sure you see them fire and when? They may not fire in the
expected order depending on how the movie is played (in IDE w or w/o streaming
simulated, from HD, over Http,).
AddThis Social Bookmark Button