1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| for (i=0; i<=nb_images; i++) {
images[i] = new Loader();
images[i].contentLoaderInfo.addEventListener(Event.COMPLETE,resize_and_reflect);
images[i].load(new URLRequest(url + xml.img.@src[i]));
function resize_and_reflect(ev:Event) {
loaded++;
if (loaded>=nb_images) {
for (i=0; i<=nb_images; i++) {
//ON AJOUTE LE REFLET DE LIMAGE
var bmpData:BitmapData = Bitmap(images[i].contentLoaderInfo.content).bitmapData;
reflet = new Reflect(bmpData);
var bmp:Bitmap = reflet.get_reflect();
bmp.x=Bitmap(images[i].content).x;
bmp.y=Bitmap(images[i].content).y;
images[i]= new Bitmap();
images[i] = bmp;
images[i].x = (stage.stageWidth - images[i].width) / 2;
if (i!=0) { images[i].alpha = 0; }
addChild(images[i]);
}
}
}
} |
Partager