Modification d'images chargée à la volée
Bonsoir à tous,
Je suis un gros débutant en flash ...
Je crée un Bitmap pour toutes les images chargées à partir d'un tableau de Loader.
Le programme fonctionne bien mais, il me retourne une erreur :
Code:
1 2 3
| Error: Error #2099: L'objet en cours de chargement n'est pas suffisamment chargé pour fournir ces informations.
at flash.display::LoaderInfo/get content()
at MethodInfo-270() |
Code:
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]);
}
}
}
} |
Merci à vous :D