1 Reply Latest reply on Dec 3, 2010 2:59 PM by GordonSmith

    Embed bitmap images in batch

    pbureau76

      Hi,

       

      Is there a way to embed all the ressource image files from a directory at compile time? Embedding a bitmap looks like:

       

       [Bindable]
      [Embed(source="./v3/R4.png")]
      private var artClassR4:Class;
      public var artR4:BitmapAsset;

       

      But it becomes really painful when you have a lot of files, it there a way to automate the process for a collection of files in a directory?

       

      Best regards,

      Pierre

        • 1. Re: Embed bitmap images in batch
          GordonSmith Level 4

          No, sorry. You need a var for each image. If it's too tedious too maintain by hand, I suppose you could write a Perl script or something that enumerates the directory and creates the ActionScript code. It could go in a separate file that you then include into your AS or MXML file.

           

          Gordon Smith

          Adobe Flex SDK Team