Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/10/2012, 10:43
Avatar de efragil
efragil
 
Fecha de Ingreso: julio-2012
Ubicación: España
Mensajes: 7
Antigüedad: 11 años, 9 meses
Puntos: 0
Respuesta: Cargar imagen externa load movie al centro de la pantalla

Hola, yo coloco este código en as2 en el primer frame de la película raíz:
Stage.scaleMode = "noScale";
Stage.align = "TL";
myListener = new Object();
// asociamos el objeto al stage para detectar los cambios
// de tamaño del stage
Stage.addListener(myListener);
// ejecuto la función rec al cambiar el tamaño
myListener.onResize = rec;
function rec():Void {
//---Tamaño del fondo
var maxWidth:Number = Stage.width;
var maxHeight:Number = Stage.height;
fondo._width = maxWidth;
fondo._height = maxHeight;
fondo._yscale = fondo._xscale;
if (fondo._height<maxHeight) {
fondo._height = maxHeight;
fondo._xscale = fondo._yscale;
}
//---Posición del fondo
fondo._x = (Stage.width-fondo._width)/2;
fondo._y = (Stage.height-fondo._height)/2;
mc_menu._x = (Stage.width-mc_menu._width)/2;
mc_menu1._x = (Stage.width-857)/2;
}
rec();
stop();

Te explico un poco:
La imagen que cargaste tienes que convertirla en clip de película y acuérdate de darle un nombre de instancia (por ejemplo:nueva_mc).
Pues si te fijas en el código, si quieres centrarla en cualquier resolución, harías:

nueva_mc._x = (Stage.width-fondo._width)/2;
nueva_mc._y = (Stage.height-fondo._height)/2;

Espero haberte ayudado. Un saludo.