5 Replies Latest reply on Oct 4, 2008 8:27 AM by Newsgroup_User

    Embedding Array of Images

    PaulBHartzog
      I have a long list of images I need to embed into Flex and AIR apps, and I was wondering if there is a way to have all of the filenames stored in an array of some kind, and then loop through it to generate all the embedding.

      The only other solution I can think of is to just list them all out in a CSS file or something.

      Suggestions? (Please provide some code since I'm no expert yet :-)

      much thx
        • 1. Re: Embedding Array of Images
          Level 7

          "PaulBHartzog" <webforumsuser@macromedia.com> wrote in message
          news:gc3va3$sba$1@forums.macromedia.com...
          >I have a long list of images I need to embed into Flex and AIR apps, and I
          >was
          > wondering if there is a way to have all of the filenames stored in an
          > array of
          > some kind, and then loop through it to generate all the embedding.

          Write an AIR application to traverse the directory and edit the appropriate
          file.

          HTH;

          Amy


          • 2. Re: Embedding Array of Images
            PaulBHartzog Level 1
            I should've said "at compile-time"

            I don't want tons of embed statements in long files.
            I want an array, that I can loop through to embed things.

            Is that even possible? :-)

            -p
            • 3. Re: Embedding Array of Images
              Level 7

              "PaulBHartzog" <webforumsuser@macromedia.com> wrote in message
              news:gc6p1s$nnf$1@forums.macromedia.com...
              >I should've said "at compile-time"
              >
              > I don't want tons of embed statements in long files.
              > I want an array, that I can loop through to embed things.
              >
              > Is that even possible? :-)

              Create a separate file that you can use in an include statement. That file
              is just text, so you can automate writing that file.

              Or you can create a swc in Flash.

              HTH;

              Amy


              • 4. Re: Embedding Array of Images
                PaulBHartzog Level 1
                So is it the case then that one cannot do something like this pseudocode at compile time?

                for x = 1 to 100 { embed x + ".jpg" }

                -p
                • 5. Re: Embedding Array of Images
                  Level 7

                  "PaulBHartzog" <webforumsuser@macromedia.com> wrote in message
                  news:gc81md$dab$1@forums.macromedia.com...
                  > So is it the case then that one cannot do something like this pseudocode
                  > at compile time?
                  >
                  > for x = 1 to 100 { embed x + ".jpg" }

                  No, but you could run that loop to create an as or MXML file that contains a
                  bunch of embeds.

                  HTH;

                  Amy