Im trying to draw a bitmap of an dynamically loaded image via xml, and ofcourse i’d like to apply smoothing to my images, as my page resizes with the browser and creates a mess.
The images are loaded with a timer event, which fires every 200ms, and each time this occurs, I’d like to quickly draw the bitmapdata of the image so i can apply the smoothing.
My problem that im having is that the images aren’t completely loaded when I run the draw method and so im left with a white box instead.
Currently im using:
function itemHandler(event:Event):void
{
loadThumbs(event);
thumbLoader.unload();
thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, drawItem);
}
var bmc:MovieClip = new MovieClip();
function drawItem(evt:Event):void
{
bmc = new MovieClip();
var bmd:BitmapData = new BitmapData(170, 150);
bmd.draw(thumbLoader);
var bmp:Bitmap = new Bitmap(bmd);
bmc.addChild(bmp);
bmp.smoothing = true;
placeHolder.addChild(bmc);
}
Any help/advice would be much appreciated, thanks.