Tengo un problema:
Cargo unas imágenes en un mc vacío photo.
Cada imagen tiene encima unos textos estáticos que están en otro mc texto, de manera que el texto de la imagen 1 está en el frame 1 y así sucesivamente.
Al apretar el botón siguiente se carga la siguiente imagen en foto y paso al siguiente frame en texto.
El problema es que se me cargan antes los textos que la imagen, dando un mal efecto.
Quisiera conseguir que los textos se cargasen después.
Había pensado cambiar el _alpha del texto cuando se haya cargado la imagen, pero no lo consigo. Os pongo el código que estoy utilizando para cargar las imágenes (lo encontré en un tuto):
this.pathToPics="ruta/";
this.pArray=["img01.jpg", "img02.jpg", "img03.jpg", "img04.jpg"];
this.fadeSpeed = 50;
this.pIndex = 0;
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
muestra = "Foto Nº"+(this.pIndex+1 )+" "+this.pArray[0];
MovieClip.prototype.changePhoto = function(d) {
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame =fadeOut;
};
MovieClip.prototype.fadeOut = function(){
if (this.photo._alpha>this.fadeSpeed){
this.photo._alpha-= this.fadeSpeed;
}else{
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function(){
var p =_root.photo;
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
muestra = "Foto Nº"+(this.pIndex+1 )+" "+this.pArray[this.pIndex];
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function(){
var i, I, t;
I= this.photo.getBytesLoaded();
t= this.photo.getBytesTotal();
if (t>0 && t == I) {
this.onEnterFrame = fadeIn;
}else{
trace(I/t);
}
};
MovieClip.prototype.fadeIn = function(){
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha+= this.fadeSpeed;
}else{
this.photo._alpha=100;
//línea que añado, pero no funciona, también he probado con _root
this.texto._alpha=100;
this.onEnterFrame= null;
}
};
¿Alguien sabe qué está mal?
Muchas gracias.
