I am not sure because I am not familiar with AIR and files, but to get BitmapData you usually need a source, I don't think AIR will be able to join up the source with a reference to a file without you actually opening up the file somehow.

For Flash / Flex, you have to load it with Image / Loader from either an absolute path or a relative one. I guess similar rules apply to AIR, you just get access to the file system here...

Sorry I can't be of more help.

Glen

Omar Fouad wrote:
You mean Loading it using the path from resolvePath()?

On Thu, May 1, 2008 at 6:20 PM, Glen Pike <[EMAIL PROTECTED]> wrote:

You will probably need to load your file as an image/MC/similar first,
then draw that into your bitmap.

Omar Fouad wrote:

Hi list,
In an Air - Flash CS3 application I am trying to Import an image with
browseForOpen() and getting the event.currentTarget of the File Object
and
converting it to a BitmapData like this:

private function OnFileSelect(e:Event):void {
  var BD:BitmapData = new BitmapData(300, 400, false);
  var B:Bitmap = new Bitmap();
  BD.draw(B);
  addChild(B);// just in case

 }
It is not working... Have I missed something?

Thanks



--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to