Comunidad de diseño web y desarrollo en internet online

ayudenme por favor, de AS2 a AS3

Citar            
MensajeEscrito el 20 May 2010 07:47 pm
La idea es un fullscreen mas un rescalamiento sin perder las proporciones de la imagen del fondo y que los demas mc no aunmenten de tamano ni cambien su posicion.
solo quiero saber como migar este codigo al AS3 si me podrian escribir el nuevo ya convertido se los agradeceria no se nada de codigo




//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 muuchas 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);

Por alexmatam

2 de clabLevel



 

chrome
Citar            
MensajeEscrito el 20 May 2010 11:35 pm

Por The Fricky!

Presidente

6168 de clabLevel

3 tutoriales
8 articulos

Genero:Masculino   Bastard Operators From Hell Héroes

Piccola Venezia...

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.