Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/12/2008, 13:13
Avatar de MoDoRrO
MoDoRrO
 
Fecha de Ingreso: septiembre-2005
Ubicación: Php+Flash+AS
Mensajes: 1.072
Antigüedad: 18 años, 7 meses
Puntos: 12
Funcion no me escala la ultima imagen cargada

Hola amigos, fijense que tengo un flash
dentro, tengo esta funcion

Código:
function foto(archivo:String, x:Number, y:Number, p:Number) {
	this.createEmptyMovieClip(["profundidad"+p], p);
	this["profundidad"+p].loadMovie(archivo);
	this["profundidad"+p]._x = x;
	this["profundidad"+p]._y = y;
	this.onEnterFrame = function() {
		if (this["profundidad"+p].getBytesLoaded()>7) {
			if (this["profundidad"+p].getBytesLoaded()>=this["profundidad"+p].getBytesTotal()) {
				this["profundidad"+p]._width="207";
				this["profundidad"+p]._height="159";
				trace("Cargado");
				//delete this.onEnterFrame;
			} else {
				var porcent:Number;
				porcent = Math.round((this["profundidad"+p].getBytesLoaded()/this["profundidad"+p].getBytesTotal())*100);
				trace("No Cargao");
			}
		}
	};
}
la llamo asi:
Código:
foto("bebo.jpg", 60, 110, 1);
y funciona, pero
si la llamo por segunda vez

Código:
foto("bebo.jpg", 60, 110, 1);
foto("gorda.jpg", 290, 110, 2);
la primera imagen no me la escala como dice la funcion:
this["profundidad"+p]._width="207";
this["profundidad"+p]._height="159";

pero la segunda si

si llamo la funcion varias veces, las primeras imagenes las deja en tamaño original, y la ultima si tiene efecto


cual es el problema?

se supone que todas las imagenes deben de ajustar a un tamaño


Saludos, Gracias