Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/07/2012, 14:37
oscarlimon
 
Fecha de Ingreso: julio-2012
Mensajes: 1
Antigüedad: 12 años, 9 meses
Puntos: 0
Exclamación Fondo escalable a tamaño de pantalla sin perder proporción

Hola a todos! Soy nuevo en este foro pero tengo un problema programando una pagina web a pantalla completa en AS3, resulta que necesito hacer el fondo al tamaño de la pantalla sin que pierda proporciones la imagen, el problema es que logré hacer eso con el código nada más que al hacerse grande y hacer la pantalla mas pequeña ya no se reduce el tamaño.
El mc se llama fondoC, les dejo el código que cree y el link donde está la imagen:

www.meusnier.com.mx/new (AL FINAL DE TODA LA ANIMACIÓN SALE EL FONDO)


stage.addEventListener(Event.RESIZE, reajustar3);
stage.dispatchEvent(new Event(Event.RESIZE));

var anchofondo:Number;
var altofondo:Number;


function reajustar3(e:Event):void{
if(fondoC.width<=stage.stageWidth){
anchofondo = (fondoC.height*stage.stageWidth)/fondoC.width;
fondoC.width=stage.stageWidth;
fondoC.height=anchofondo;
}
if(fondoC.height<=stage.stageHeight){
altofondo = (fondoC.width*stage.stageHeight)/fondoC.height;
fondoC.height=stage.stageHeight;
fondoC.width=altofondo;
}
}