Given: A Flex TileList with the following event:
<mx:nativeDragDrop>
<![CDATA[
if(event.clipboard.hasFormat(ClipboardFormats.FILE_LIST_FORMAT)) {
var files:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
for each(var file:File in files)
{
// file.data is null here!
}
this.listData.refresh();
}
]]>
</mx:nativeDragDrop>
I am trying to create a list of thumbnails from jpegs that I drag into this TileList. Image.source can use the url to show the image, but I need to scale the image down first (hi rez photos) I already have the scaling part done except that I need BitmapData from the file and it has null for file.data.
ALSO, I have tried this:
var x:URLRequest = new URLRequest(value.file.url); // this is a local file (e.g. file:///C:/somefile.jpg)
var b:Bitmap = new Bitmap(x.data as BitmapData);
data is ALSO null! So frustrating. Any help would be appreciated.