3 Replies Latest reply on Aug 28, 2008 1:32 PM by Newsgroup_User

    How to use the BitmapData of an Embeded Asset

    Alexis_Ninem
      At the top of my class I embed this

      [Embed(source='icons/16.png')]
      private var icon16:Class;

      I could make this class the source of a dummy image

      var dummyImage:Image = new Image();
      dummyImage.source = icon16;

      then wait until the asset is loaded into the image and go

      var myBitmapData:BitmapData = BitmapData(dummyImage.content);

      then I could add it to my NativeApplication's icon's bitmaps array

      but that seems improper as I would have to create a useless image and listen to some event on it.

      Is there a more direct way to extract the BitmapData of an embeded image?