lunes, 10 de septiembre de 2007

Generar fondo multiplicando o Background repeat

Primero en la ventana de librería vamos a importar una imagen, en Linkage de la imagen ponemos el nombre imagen y en el primer fotograma agregamos el siguiente código:





import flash.display.*;
import flash.geom.*;

Stage.scaleMode = "noScale";
Stage.align = "TL";
onResize = function () {
// Generamos el bitmapdata y pegamos la imagen de la librería
var myBitmapData:BitmapData = BitmapData.loadBitmap("imagen");
// Generamos una pelicula para el fodo
this.createEmptyMovieClip("bmp_fill_mc", 1);
// Creamos un rectángulo
with (bmp_fill_mc) {
matrix = new Matrix();
repeat = true;
smoothing = false;
beginBitmapFill(myBitmapData, matrix, repeat, smoothing);
moveTo(0, 0);
lineTo(0, Stage.height);
lineTo(Stage.width, Stage.height);
lineTo(Stage.width, 0);
lineTo(0, 0);
endFill();
}
};
Stage.addListener(this);
onResize();

descarga archivo

No hay comentarios: