Ver Mensaje Individual
  #8 (permalink)  
Antiguo 08/04/2008, 18:39
Avatar de kesioo
kesioo
 
Fecha de Ingreso: enero-2007
Ubicación: Capital Federal, Argentina
Mensajes: 137
Antigüedad: 17 años, 3 meses
Puntos: 2
Re: Ordenes de swf hijo a swf padre?

Hola de nuevo!

bueno en vistas de que no pude hacer lo que queria, decidi meter las fotos directamente en un mc vacio en el swf hijo.

Pero ahora me surge un nuevo problemin, el de la alineacion de la imagen.

Hasta ahora tengo un mc "Fotografia" en root (swf hijo), y dentro de el "Holder_mc".
El tema es que me centra la imagen en base al tamaño del swf padre.
Fotografia_mc esta centrado en no dinamicamente. Y lo que hago es que la foto que se cargue en Holder_mc, se posicione en -(Holder_mc._width/2) y -(Holder_mc._height/2)

Aca esta mi codigo:

function centrarFoto(target_mc:MovieClip, parent_width:Number, parent_height:Number) {
target_mc.createEmptyMovieClip("oe_mc", target_mc.getNextHighestDepth());
target_mc.oe_mc.onEnterFrame = function() {
if (parent_width == undefined || parent_height == undefined) {
if (target_mc._width>0) {
target_mc.removeMovieClip(oe_mc);
target_mc._x = -target_mc._width/2;
target_mc._y = -target_mc._height/2;
trace("Y: "+target_mc._y);
trace("Altura "+target_mc._height);
}
} else {
if (target_mc._width>0) {
target_mc.removeMovieClip(oe_mc);
target_mc._x = -target_mc._width/2;
target_mc._y = -target_mc._height/2;
}
}
};
}
function mostrarFoto(target_mc:MovieClip, parent_width:Number, parent_height:Number) {
centrarFoto(_root.Fotografia_mc.Holder_mc);
show_Hide(_root.Seccion_mc, 0);
show_Hide(_root.Contenido_mc, 0);
show_Hide(_root.scroll_mc, 0);
show_Hide(_root.scrollBar_mc, 0);
isImageOpen = true;
_root.Fotografia_mc._visible = true;
var showImg:Tween = new Tween(_root.Fotografia_mc.Holder_mc, "_alpha", Strong.easeOut, 0, 100, 10, false);
_root.Fotografia_mc.onPress = function() {
var hideImg:Tween = new Tween(_root.Fotografia_mc.Holder_mc, "_alpha", Strong.easeOut, 100, 0, 10, false);
hideImg.onMotionFinished = function() {
_root.Fotografia_mc._visible = false;
isImageOpen = false;
show_Hide(_root.Seccion_mc, 1);
show_Hide(_root.Contenido_mc, 1);
show_Hide(_root.scroll_mc, 1);
show_Hide(_root.scrollBar_mc, 1);
};
};
};