5 Replies Latest reply on Oct 27, 2011 7:33 PM by drkstr_1

    How would I do this (4.5.1)

    Adrien. Level 1

      I am looking to build a feature into a project where the user can open a "scripting window" and use the built in libraries that are in  the project to build scripts that will then be compiled down into actionscript and ran when the usert launches the program. The user can have as many scripts as they wish and each should compile upon run time of the application, alerting the user, through pop ups, of any errors, warnings or issues with their code.



        • 1. Re: How would I do this (4.5.1)
          drkstr_1 Level 4

          Can these scripts be sent to a server for compilation then downloaded via a SWF?

          • 2. Re: How would I do this (4.5.1)
            Adrien. Level 1

            No the idea is essentially I am building a light script editor that you would use to write your scripts and then upon running the application these scripts would compile into actionscript (the language of the script editor would be actionscript). This ide would essentially alert users, upon running the script of any error and or issues with their code.

            • 3. Re: How would I do this (4.5.1)
              UbuntuPenguin Level 4

              This doesn't even have to be done using Flex, you could use any front or backend technology.  The only requirement would be the presence of the MXMLC compiler somewhere on the backend.

              • 4. Re: How would I do this (4.5.1)
                Adrien. Level 1

                Your right it doesnt but tfor this project it does. are their any examples on line (in flex or not) that I could look at?         

                • 5. Re: How would I do this (4.5.1)
                  drkstr_1 Level 4

                  It would work the same as any client-server app. Send the script as text to a service that can save them to a temporary source directory. Then run mxmlc on them and collect the response to send back to the user. If you need to load the compiled class definitions at runtime, then you will need to use some kind of Loader class, or use Module, to load the compiled definitions as a SWF file. This data can also be returned with the response over a data service, then manually injected into a Loader class.


                  * edit *


                  If this is an AIR app, it is also technically possible to bundle the necessary tools and call a native process (IE. mxmlc, or an ant build). This is essentially what Flash Builder is (although not on the AIR framework).