5 Replies Latest reply on Mar 1, 2009 3:37 PM by JeffryHouser

    Flex Pre-compiler instructions

    Alexander Podgorny
      Often time when coding games in flex you are faced with managing multiple graphic resources. You want them to be embedded, and yet.. you don't want to write hundreds of lines of code just to list the contents of your "images" folder.

      It would help to have a pre-compier instruction set that would loop through my "images" folder and generate my ResourceManager class with all the embeds and image slicing, kind of like C++ macros or perhaps some other way of generating code before compilation time.

      Could anyone point me in the right direction?
        • 1. Re: Flex Pre-compiler instructions
          JeffryHouser Level 4

          Sounds like you need a code generation type tool.

          You should be able to write an eclipse plugin to do that, although you'll probably need to know Java to do so.

          Additionally you could write a code generator in any language of your preference (Potentially AIR / AS3) and run it outside of Eclipse.
          • 2. Re: Flex Pre-compiler instructions
            Level 7

            "Alexander Podgorny" <webforumsuser@macromedia.com> wrote in message
            news:goe7tb$aru$1@forums.macromedia.com...
            > Often time when coding games in flex you are faced with managing multiple
            > graphic resources. You want them to be embedded, and yet.. you don't want
            > to
            > write hundreds of lines of code just to list the contents of your "images"
            > folder.
            >
            > It would help to have a pre-compier instruction set that would loop
            > through my
            > "images" folder and generate my ResourceManager class with all the embeds
            > and
            > image slicing, kind of like C++ macros or perhaps some other way of
            > generating
            > code before compilation time. Could anyone point me in the right
            > direction?

            Pretty much any application that can write text files should be able to do
            this.


            • 3. Re: Flex Pre-compiler instructions
              JeffryHouser Level 4
              Amy,

              I think you meant any programming language that can write text files should be able to do this.

              ( Otherwise, how would you do this in Notepad or MS Word? )
              • 4. Re: Flex Pre-compiler instructions
                Level 7

                "JeffHouser" <webforumsuser@macromedia.com> wrote in message
                news:goem91$r4u$1@forums.macromedia.com...
                > Amy,
                >
                > I think you meant any programming language that can write text files
                > should be able to do this.
                >
                > ( Otherwise, how would you do this in Notepad or MS Word? )

                With Word, I'd do it with a Word Form as an Add-On. I don't think Notepad
                has the capability to write text files. Save them, yes. But it doesn't a
                actually programmatically write them.


                • 5. Re: Flex Pre-compiler instructions
                  JeffryHouser Level 4

                  What is the difference between saving a file and writing a file?