3 Replies Latest reply on Aug 20, 2008 10:06 AM by Gregory Lafrance

    flex purpose

    phil1943 Level 1
      Hello, I have been programming Actionscript for the last year, and have now started learning Flex.
      Can someone please summarize exactly what type of programming you would use Flex for, rather than using pure Actionscript ?

      I just want to get a grasp on which of my projects would be more suited to MXML as compared to a pure AS3 environment.

      Thanks kindly for any comments.
        • 1. Re: flex purpose
          Dr. Fred Mbogo Level 1
          I doubt it's possible to write a useful Flex app with no ActionScript code whatsoever in it. So, you always use the two together.

          It's possible to write a Flex app without the MXML stuff, creating everything in ActionScript, but I wouldn't. The MXML stuff makes most things easier.

          I would only create a pure ActionScript program if I needed to make something that didn't use Flex, and perhaps needed to work as a SWC for use in a larger Flash project. For instance, maybe I wanted to make some kind of widget for the Flash project that I knew was going to be code-heavy, so doing it in the Flash authoring environment would be a pain. I might pop in to Flex Builder, create the widget, build it as a SWC, then drop it into Flash and continue doing the graphics-heavy stuff that the authoring environment does so much better than Flex Builder.

          Flex the API is best used for traditional-style applications. Forms, buttons, menus, databases. You know, applications.
          • 2. flex purpose
            justria Level 1
            MXML in general is a good choice if you can specific structures using declarative code. As soon, as things get procedural, AS3 is the way to go.

            At the other side, if you feel more comfortable with AS3, it's OK to use all over procedural code. The downside: The procedural code tends to be more complex and less readable as pure declarative code.

            But, to be honest, all tends to be a matter of personal taste and background.
            • 3. Re: flex purpose
              Gregory Lafrance Level 6
              Create most of your UI in MXML and also most of your components if they are fairly simple. This will save you much time.

              Use AS for the functionality of the app, for more complex components, and for components that do not require a UI.