5 Replies Latest reply on Mar 29, 2008 9:34 PM by OakSageLew

    How To Programmatically create SWF File in Flex

    OakSageLew
      Hello,

      I see sites such as SlideRocket, Empressr, Toufee, and SproutBuilder all generating an SWF file as their output. These sites are built in Flex, so I was wondering how they create their SWFs. Is there any kind of an AS class library available for this? Other third-party components? I'd like to build a specialized widget-maker in Flex, to output a SWF file, but at the moment am not quite sure how to do that.

      Thanks for your help!
        • 1. Re: How To Programmatically create SWF File in Flex
          cxf02 Level 1
          You could use Adobe LiveCycle which can create SWF's from java, ActionScript and is really powerful, plus costs big $. Or build a service on the server that accepted the parameters and other artifacts, creates a compilable MXML file from the data, then compiles an swf with all the content either referenced or embedded. You might consider building an AIR application that runs on the users machine and allows them to compile locally as well, but in both cases you will need to invoke the compiler as an external process, build your swf and create an html wrapper for the player. It's not trivial and you will basically be using the application to allow others without programming skills to build FLEX programs without knowing how to code.

          There are some who would like to see the FLEX PLAYER become its own compile time environment along with the runtime so that you could produce MXML within the player or load it from an external source, compile it, and then play or output an swf file. I'm not in favor of this as there are too many issues with memory and environment. Keep the PLAYER separate from the compiler and things will be simpler.

          This would be a cool app, and obviously there are companies doing this, but your business model should dictate what direction you decide to take, not the technology.
          • 2. Re: How To Programmatically create SWF File in Flex
            riesvantwisk
            There lis libming ( http://www.libming.org/) that can do such a thing. However I would guess that the mentioned websites will not really generate a swf (from start to finish, depending what is needed), but rather 'package' a configuration along with a XML that describe the function, eg what the flash needs to do. I didn't take a close look at these sites though...

            Ries
            • 3. Re: How To Programmatically create SWF File in Flex
              DoonRothmani
              i have usually found that when wanting to do such a thing as you describe, that what i really want is a data driven application. when you think about it, you can create what are essentially completely different swf modules if these modules are sufficiently changed by the data that configures them.
              • 4. Re: How To Programmatically create SWF File in Flex
                riesvantwisk Level 1
                I agree with DoonRothmani, which is basically what I also ment with 'package', I wasn't clear I think..

                I just now remember that there is a project that can compile mxml files at least on apache, I didn't check any java applications servers.... The project can be found here http://labs.adobe.com/wiki/index.php/Flex_Module_for_Apache_and_IIS

                Ries
                • 5. Re: How To Programmatically create SWF File in Flex
                  OakSageLew Level 1
                  Thank you! Very helpful.