views:

280

answers:

1

So I am trying to create an image gallery. My AIR application accepts files that are dragged and dropped onto a TileList component. I am using the images as icons but the problem is that they take a long time to load so i want to compress the file data first (I have that part done) The problem is that I can't figure out how to open the file and put the data into a BitmapData object.

Any ideas?

+2  A: 
var req:URLRequest = new URLRequest(value.file.url);
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
ldr.load(req);
.
.
.
private function completeHandler(event:Event):void {
  var ldr:Loader = Loader(event.target.loader);
  var b:Bitmap = Bitmap(ldr.content);
}
DJTripleThreat