Hi!
I think the tutorial [SIZE=2][COLOR=Black][FONT=Verdana]"[/FONT][/COLOR][/SIZE][SIZE=2][COLOR=Black][FONT=Verdana]Reusable[/FONT][/COLOR][/SIZE][FONT=Verdana][SIZE=2][COLOR=Black] Preloader Using MovieClipLoader[/COLOR][/SIZE][/FONT][FONT=Verdana][SIZE=2][COLOR=Black]" it’s great!
I just have one simple problem that I belive is quite easy to solve. If I use this preloader code in my main movie and have other objects that I want to appear over the “container” mc, how do I change the code? I can see that in the output that the container loads the external files in [COLOR=Blue]_level10[/COLOR] but I don’t know how to change that…
Here is the code that you all know:
[/COLOR][/SIZE][/FONT]
MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
bar._visible = false;
border._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 0;
empty._y = 0;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
bar._visible = true;
border._visible = true;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
border._visible = false;
bar._visible = false;
dText._visible = false;
trace(targetMC+" finished");
};
//default image
my_mc.loadClip("movieClipLoader/picture1.jpg", "container");
//buttons
button1.onPress = function() {
my_mc.loadClip("http://www.kirupa.com/developer/actionscript/animation/picture1.jpg", "container");
};
button2.onPress = function() {
my_mc.loadClip("http://www.kirupa.com/developer/actionscript/animation/picture2.jpg", "container");
};
button3.onPress = function() {
my_mc.loadClip("http://www.kirupa.com/developer/actionscript/animation/picture3.jpg", "container");
};
[FONT=Verdana][SIZE=2][COLOR=Black]
[/COLOR][/SIZE][/FONT]