
19/02/2008, 06:20
|
 | | | Fecha de Ingreso: octubre-2007
Mensajes: 96
Antigüedad: 17 años, 4 meses Puntos: 0 | |
Re: ¿como se adapta imagen de fondo a la resolucion de la pantalla? Gracias a todos.
He consueguido el codigo por otro lado os lo paso por si os interesa:
La historia es que la imagen de fondo sea un mc. fondo es el nombre de instancia
Stage.scaleMode = "noscale";
//-----------------------
var StageWidth:Number = 550;
var StageHeight:Number = 400;
function escalaFondo()
{
if (Stage.width > Stage.height) {
fondo._width = Stage.width;
fondo._yscale = fondo._xscale;
} else {
fondo._height = Stage.height;
fondo._xscale = fondo._yscale;
}
fondo._x = (StageWidth - fondo._width) / 2;
fondo._y = (StageHeight - fondo._height) / 2;
}
//-----------------------
Stage.addListener(this);
this.onResize = escalaFondo;
escalaFondo();
//-----------------------
stop(); |