Fondo a ventana completa en Flash
2 seguidores
Seguro que hay 20,000 formas de hacerlo... Alguien me dice de que forma hago que una peli externa que se me carga como fondo en mi peli principal se adapte al tamaño de la ventana del navegador pero manteniendo las proporciones? O me dirige hacia un tutorial sobre ello?
Grazie
theCoder
<code>
function ajustarFondo() {
var imageAspectRatio = bg._width / bg._height;
var stageAspectRatio = Stage.width / Stage.height;
if (stageAspectRatio >= imageAspectRatio) {
bg._width = Stage.width;
bg._height = Stage.width / imageAspectRatio;
} else {
bg._height = Stage.height;
bg._width = Stage.height * imageAspectRatio;
}
}
</code>
Siendo tu pelicula bg
Si quieres que cuando se reescale la ventana el fondo se reescale deberas llamar a la funcion en el evento correspondiente
Saludos