[Resolvido] Preloader
Fiz uma galeria de imagem e coloquei esta action no frame 1...quando clico no botão a imagem écarregada e aparece a barra de preloader e o texto dinâmico té 100%.
Tudo certo. o Problema é que quando clico para chamar outra imagem a imagem anterior desaparece , mas o texto( 100%) aparece e só depois desaparece e surge a barra novamente.
Quero eleiminar este problema, ou seja, cliquei >barra>porcentagem >imagem....cliquei de novo>barra>porcentagem.....etc.
AS:
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 = 170;
empty._y = 30;
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("imagens/11.jpg", "container");
//buttons
button1.onPress = function() {
my_mc.loadClip("imagens/1.jpg","container");
};
button2.onPress = function() {
my_mc.loadClip("imagens/2.jpg", "container");
};
button3.onPress = function() {
my_mc.loadClip("imagens/3.jpg", "container");
};
button4.onPress = function() {
my_mc.loadClip("imagens/4.jpg", "container");
};
button5.onPress = function() {
my_mc.loadClip("imagens/5.jpg", "container");
};
button6.onPress = function() {
my_mc.loadClip("imagens/6.jpg", "container");
};
button7.onPress = function() {
my_mc.loadClip("imagens/7.jpg", "container");
};
button8.onPress = function() {
my_mc.loadClip("imagens/8.jpg", "container");
};
button9.onPress = function() {
my_mc.loadClip("imagens/9.jpg", "container");
};
button10.onPress = function() {
my_mc.loadClip("imagens/10.jpg", "container");
};
button11.onPress = function() {
my_mc.loadClip("imagens/11.jpg", "container");
};Discussão (1)
Carregando comentários...