Hello
I’m having an issue trying to automatically create a Sprite border for movieclips generated by an xml file.
Here is my loop function :
function callThumbs():void {
for (var i:Number = 0; i < my_total; i++) {
var thumb_url = my_images*.@THUMB;
var thumb_loader = new Loader();
thumb_loader.load(new URLRequest(thumb_url));
thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbOk);
thumb_loader.name = i;
}
}
And the function called to finish the movieclip look
function thumbLoaded(e:Event):void {
var my_thumb:Loader = Loader(e.target.loader);
var myBorder = new Sprite();
myBorder.graphics.beginFill(0xFF0000); // choosing the colour for the fill, here it is red
myBorder.graphics.drawRect(-3, -3, my_thumb.width+6,my_thumb.height+6); // (x spacing, y spacing, width, height)
myBorder.graphics.endFill();
container_mc.addChild(myBorder);
container_mc.addChild(my_thumb);
myBorder.filters = [new GlowFilter(0x000000, .50, 15, 15, 2, 2, false, false)];
my_thumb.contentLoaderInfo.removeEventListener(Event.COMPLETE, thumbLoaded);
}
All the pictures from the xml file do load, they all have the glowfilter effect but only the first one has border… why ???
Thank you !