Foros del Web » Creando para Internet » Flash y Actionscript »

Cargar imagen con alpha

Estas en el tema de Cargar imagen con alpha en el foro de Flash y Actionscript en Foros del Web. Hola a todos Tengo el siguiente código para cargar una imagen desde alpha=0 hasta alpha=100 Código: this.createEmptyMovieClip("img_mc", ++nivel); img_mc._x = 0; img_mc._y = 0; img_mc._alpha=0; ...
  #1 (permalink)  
Antiguo 24/07/2006, 05:01
 
Fecha de Ingreso: junio-2003
Mensajes: 778
Antigüedad: 20 años, 10 meses
Puntos: 1
Cargar imagen con alpha

Hola a todos

Tengo el siguiente código para cargar una imagen desde alpha=0 hasta alpha=100

Código:
this.createEmptyMovieClip("img_mc", ++nivel);
img_mc._x = 0;
img_mc._y = 0;
img_mc._alpha=0;
img_mc.loadMovie("fauna.jpg");
this.createEmptyMovieClip("bucle_mc", ++nivel);
bucle_mc.onEnterFrame = function() {
	if (por != 100) {
		por = Math.round((img_mc.getBytesLoaded()/img_mc.getBytesTotal())*100);
		por_txt.text = "Cargandos :"+(Math.round(img_mc.getBytesLoaded()/1024))+" Kb de "+(Math.round(img_mc.getBytesTotal()/1024))+" Kb "+por+" % terminado";
	} else {
		if (img_mc._alpha<100) {
		img_mc._alpha +=3;
		}
	}
};
Pero no me funciona... alguna sugerencia???
  #2 (permalink)  
Antiguo 24/07/2006, 12:14
Avatar de Bandit
Moderador
 
Fecha de Ingreso: julio-2003
Ubicación: Lima - Perú
Mensajes: 16.726
Antigüedad: 20 años, 9 meses
Puntos: 406
Hola Operadormail:
Aquí un ejemplo que hice hace tiempo:
En la capa 1 frame coloca un MC_vacío con nombre de contenedor, selecciona el MC y coloca éste código:
onClipEvent (load) {
this._alpha = 0;
end_alpha = 100;
}
onClipEvent (enterFrame) {
current_alpha = this._alpha;
diff__alpha = end_alpha-current_alpha;
movex = diff__alpha/10;
this._alpha = this._alpha+movex;
}
En la capa 2 frame 1 el siguiente código:
mc.onEnterframe = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
this.onEnterFrame = null;
}
};
mc.onEnterFrame = function() {
if (this._alpha>0) {
this._alpha -= 10;
} else {
this.onEnterFrame = null;
}
};
contenedor.loadMovie("img2.jpg");

Espero haberte sido de ayuda.
__________________
Bandit.
Si no sabes estudia y si sabes enseña.
http://www.banditwebdesign.com/
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:25.