i’m building a flash site with a ‘master’ swf on _level0 containing the script for my MovieClipLoader and a preloader that appears on _level50. all of the content .swf’s load on _level5. the problem i’m having is that the swf’s are starting up before they are completely loaded, when the preloader disappears. i want the swf’s to completely load before they start playing.
so far i’ve tried putting variations of the following script on frame a1 of the swf that is loading:
if (_framesloaded >= _totalframes) {
gotoAndPlay(2);
}else{
gotoAndStop(1);
}
and none of what i tried worked. so i then tried putting variations of the following script in the same place:
stop();
_level0.myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes) {
if (loadedBytes >= totalBytes) {
gotoAndPlay(1);
}else{
gotoAndStop(1);
}
}
this too did not work.
can someone help me straighten out my programming? is there something i can script on _level0 and somehow tie it in directly with my preloader script:
//--------------------------------------------------movieClipLoader (MCL) begin
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
//----------------------------------------------------movieClipLoader (MCL) end
//----------------------------------------------------------------preloader begin
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
_level50.preloadInfo1.text = preloadPercent + "%";
_level50.preloadInfo2.text = Math.round(loadedBytes/1000) + "k";
}
myListener.onLoadComplete = function (target_mc) {
_level50._visible = false;
}
//----------------------------------------------------------------preloader end
*the rest of the preloader script is on the preloader.swf, but this is the meat of it.
this seems to me to be an easy fix, but it’s been thwarting me for a week now! HELP!
wes