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();
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();