I know there is already a wealth of info on this topic, but I can’t find anything to help me out with the code I’m using.
I want to have one preloader work for all of my external content.
Basicaly I’m trying to reuse the same preloader objects with these two sets of code. The red is for loading external movie clips that I have setup to transition in and out while the blue is setup to just load external movie clips with no transitions into a different location. The blue works fine, but the red does not.
First frame of main timeline:
Currently when I have mainLoader here it will not work. If I take mainLoader out the movie will load but it will not preload.
_root.currMovie = “section1”;
[color=Red] mainloader[/color].loadMovie(_root.currMovie+“.swf”, container);
//main preloader//
[color=Red] mainLoader[/color] = new MovieClipLoader();
mainListener = new Object();
mainLoader.addListener(loadListener);
mainListener.onLoadStart = function() {
[color=Lime] container.stop();[/color]
};
[color=Red] mainListener[/color].onLoadProgress = function(loadTarget, loadedBytes, totalBytes) {
preloaded = Math.floor(loadedBytes/totalBytes100);
load_txt._visible = true;
load_txt.gotoAndPlay(1)
loaderText_txt.text = preloaded+" ";
bar_mc._width = Math.round(loadedBytes/totalyBytes100);
};
[color=Red] mainListene[/color]r.onLoadComplete = function() {
loaderText_txt.text = " ";
load_txt._visible = false;
load_txt.gotoAndStop(1)
[color=Lime] container.play();[/color]
};
//main preloader end//
//image preloader//
[color=Blue] mcLoader[/color] = new MovieClipLoader();
loadListener = new Object();
mcLoader.addListener(loadListener);
loadListener.onLoadStart = function() {
[color=Lime] container.container_2.stop()[/color];
};
[color=Blue] loadListener[/color].onLoadProgress = function(loadTarget, loadedBytes, totalBytes) {
preloaded = Math.floor(loadedBytes/totalBytes100);
load_txt._visible = true;
load_txt.gotoAndPlay(1)
loaderText_txt.text = preloaded+" ";
bar_mc._width = Math.round(loadedBytes/totalyBytes100);
};
[color=Blue] loadListener[/color].onLoadComplete = function() {
loaderText_txt.text = " ";
load_txt._visible = false;
load_txt.gotoAndStop(1)
[color=Lime] container.container_2.play();[/color]
};
//image preloader end//
What script would I add to this button to make section 1 use my preloader on the main timeine?:
btn_mc1.btn.onRelease = function() {
btn_mc1.btn.enabled = false;
btn_mc6.checkMe();
btn_mc5.checkMe();
btn_mc4.checkMe();
btn_mc3.checkMe();
btn_mc2.checkMe();
clearAllContent();
clickSound.start(0,1);
if (_root.currMovie == undefined) {
_root.currMovie = “section1”;
container.loadMovie(“section1.swf”);
} else if (_root.currMovie != “section1”) {
if (container._currentframe >= container.midframe) {
_root.currMovie = “section1”;
container.play();
}
}
};
I need some serious help!
thanks