//Sin escalar y alineado a la izquierda y arriba
Stage.scaleMode = "noScale";
Stage.align = "TL";
//full screen
function cambiar(){
if(Stage.displayState=="normal"){
Stage.displayState="fullScreen";
_root.boton.gotoAndStop(2);
}else{Stage.displayState="normal";
_root.boton.gotoAndStop(1);}}
//objeto listener para el onResize
var listener:Object = new Object();
//definicion de acciones para el onResize
listener.onResize = function():Void {
resizebackGround();
//aca la gracia de poner afuera la funcion es poder hacer muchas acciones en el evento
};
//funcion de resize
resizebackGround=function():Void{
var imageAspectRatio = bg_mov_mc._width / bg_mov_mc._height;
var stageAspectRatio = Stage.width / Stage.height;
if (stageAspectRatio >= imageAspectRatio) {
bg_mov_mc._width = Stage.width;
bg_mov_mc._height = Stage.width / imageAspectRatio;
} else {
bg_mov_mc._height = Stage.height;
bg_mov_mc._width = Stage.height * imageAspectRatio;
}
}
//Listener de redimensionado de stage
Stage.addListener(listener);
//llamado inicial a la funcion
resizebackGround()
//Esto ubica el menu al pie de la pantalla y el fondo del menu al ancho de la pantalla
mc_bottom._width = Stage.width;
mc_bottom._y = Stage.height - mc_bottom._height;
boton._y = Stage.height - (boton._height+20);
boton._x = Stage.width - (boton._width+20);
sizeListener = new Object();
sizeListener.onResize = function() {
mc_bottom._width = Stage.width;
mc_bottom._y = Stage.height - mc_bottom._height;
boton._y = Stage.height - (boton._height+20);
boton._x = Stage.width - (boton._width+20);
};
Stage.addListener(sizeListener);