2 Replies Latest reply on Jul 28, 2009 12:20 AM by hamochi

    Trying to load byteArray into image

    hamochi

      Hi i have loaded an image with an byteArray from a filereference instance, somthing like:

       

      myImage.source = myFileReference.data;

      this works great, so i know Images.source can be set to a byteArray.

       

      When i'm converting a bitmapdata to bytearray ,and load it into an image i get an error. This is my code:

       

      myImage.source = myBitmap.bitmapData.getPixels(myBitmap.bitmapData.rect);

       

      I get:

      Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.

      Any ideas why this doesn't work?
      thanks.