Click to See Complete Forum and Search --> : Loading movies Probrem.....Please Help (Flash MX 2004)


spyros
08-21-2005, 07:46 AM
Hello
I am desperate I don’t know what I am doing wrong

I load some movies in the main flash movie.
The loading starts with an action in a button. I have tree button for the tree movies. The buttons have an unload code line for the other movies.
So my problem is:
If I click one of the other movies the movie that was loading will stop and will start loading the new movie.
If I go back to the movie that I stop the loading procedure and click to start to load again the movie will not do anything.
If I don’t break the loading and I wait to load the movie the movie is playing.

Please Help me !!!

This is the preloader of the movies


function checkLoad(mcTarget:MovieClip):Void{



var nLBytes:Number = mcTarget.getBytesLoaded();


var nTBytes:Number = mcTarget.getBytesTotal();



var nPercent:Number = (nLBytes/nTBytes)*100;



mcLoader.mcBar._xscale = nPercent;



var sPercent:String = Math.floor(nPercent).toString();
var sKBytes:String = Math.floor(nTBytes/1024).toString();
var sMessage:String = sPercent;
mcLoader.tPercent.text = sMessage + "%";



if (nLBytes >= nTBytes && nTBytes > 0) {



if (nCount >= 12) {



clearInterval(nProgress);




mcTarget.gotoAndPlay("main");



} else {


nCount++;


}
}



updateAfterEvent();
}



var nCount:Number = 0;



var nProgress:Number = setInterval(checkLoad, 100, this);



stop();

LJK
08-21-2005, 10:45 AM
Hi -
Where have you placed this preloader code?
I'd suggest putting it in the first frame of the *loaded* clip - w/ the stop(); action first - may need to put another stop on the 2nd frame where the content begins.

[I'm a newb., so not sure but I think the setInterval / function needs to be in an onEnterFrame event, also.]

Good luck,
El

spyros
08-21-2005, 12:33 PM
In the first frame.