7 Replies Latest reply on Oct 27, 2008 10:48 AM by Gregory Lafrance

    Flex vs Flash

    spitbag
      Hi,

      I'm currently researching Flex as part of a presentation and have read a lot of background information on Flex. However, I'm still confused as to what exactly Flex offers that Flash doesn't. I've read that Flex MXML is converted to ActionScript on compilation. To my understanding ActionScript is the development language for Flash. Is Flex then a new set of classes that simplifies the development of Flash?
      What does Flex include in ActionScript that didn't exist pre-Flex?

      Thanks.
        • 1. Re: Flex vs Flash
          Dr. Fred Mbogo Level 1
          There's nothing you can do with one tool that you can't do with the other.

          But, this is like saying that there's nowhere you can go with a Jeep that you can't go with a mountain bike. They're different tools, suited to different purposes.

          The Flash environment is better for graphically-heavy applications. Simple games without a lot of internal logic, animations, displays...whizzy things.

          The Flex tools are better suited to code-heavy applications. Traditional applications with user input forms, lots of low-level disk or network I/O and calculations...serious things.

          There are of course applications that fall into the gray area between. A desk calculator applet, for example: not much code, but not very complicated graphics, either. You could build it in either tool with about the same amount of difficulty.

          Flex was created because programmers made it very clear to Adobe that Flash makes a poor programming environment. That's really what it comes down to: if a program requires the skills of a real programmer to build -- as opposed to the limited scripting skills of the more technical sort of graphic artist -- you should probably build it in Flex.
          • 2. Re: Flex vs Flash
            spitbag Level 1
            Thanks for the reply, that makes more sense.

            Am I right in saying though that ActionScript, an OO language, is what Flash is developed in. What does Flex bring exactly then to ActionScript?

            • 3. Re: Flex vs Flash
              Level 7

              "spitbag" <webforumsuser@macromedia.com> wrote in message
              news:gdvtnu$6e5$1@forums.macromedia.com...
              > Thanks for the reply, that makes more sense.
              >
              > Am I right in saying though that ActionScript, an OO language, is what
              > Flash is developed in. What does Flex bring exactly then to ActionScript?
              >

              The best way for you to figure it out is to produce one of the "Getting
              Started" projects in each. The first thing you'll notice is that the nature
              of the Flash Getting Started projects is _completely_ different than the
              Flex ones. Then you'll notice that the methodology you'll use is completely
              different.

              For me, Flex offers a lot of support for dealing with data. For one thing,
              it has a whole separate data type built just for handling data--the
              ListCollectionView. What the ListCollectionView does is provide
              notifications every time a collection of data is modified in any way. It
              also provides built-in methods for sorting and filtering the information in
              that collection. The _vast_ majority of Flex components are built to accept
              a collection of data and display that data in a way that is more meaningful
              for the user, then allow the user to modify and interact with the data.
              And, though Flex has a ton of additional capabilities, I think the heart of
              Flex is manipulating and displaying data.

              Flash, on the other hand, does a completely crap job of dealing with
              data--it simply doesn't have the built-in support for looking at data over
              time, sorting it, or filtering it. I recently wrapped a third-party Flash
              control in a Flex component, and it was much harder than it should have been
              because the Flash world is completely bankrupt of any ideas about how to
              handle data. Their primary use case was that you point it to an external
              XML file and that's the extent of what "data driven" means in their world.
              Using the words "strongly typed objects" on their forums resulted in virtual
              blank stares.

              Flash also doesn't have built-in support for remote objects, either. In
              Flex, you can have a "live" connection to a data object that lives on the
              server. If that object changes, the data in any Flex program that's
              connected to it will change as well.

              And, let's face it, the Flash IDE is pretty much set up to discourage you
              from writing AS at all. You'll do 4-5 times more typing and looking things
              up in Flash than you will in Flex Builder, and that's probably an
              underestimate.

              -Amy


              • 4. Re: Flex vs Flash
                Dr. Fred Mbogo Level 1
                quote:

                Originally posted by: spitbagAm I right in saying though that ActionScript, an OO language, is what Flash is developed in.
                No, not really.

                When you work in Flash, you aren't necessarily creating ActionScript code under the hood. Some of the things you do in Flash -- setting up an animation path, for example -- have no exact equivalent in the ActionScript world. ActionScript in Flash is a way to script graphical objects you create in the Flash GUI more than anything.

                When I said above that you can do anything in Flex that you can do in Flash, I didn't mean that you always used the same mechanisms. For that animation path example, in pure ActionScript you'd either build the motion procedurally, or with some kind of motion capture system. Either way, it's a lot of code to mimic what you can easily do in the Flash environment with a few simple mouse movements and clicks.

                The converse is also true: the Flash environment doesn't have any exact equivalent to MXML or to Flex Builder's GUI designer, debugger, and profiler. Its text editor is also a joke compared to Eclipse, which Flex Builder is built upon. Again, none of these facts prevents you from doing something in Flash that you could do in Flex. It's just a question of which tool makes it easier.

                quote:

                What does Flex bring exactly then to ActionScript?
                Flex is a library of ActionScript components, the MXML language for building ActionScript declaratively, and a set of tools -- the command line stuff, Flex Builder, etc -- to let you work with the Flex libraries and MXML.
                • 5. Re: Flex vs Flash
                  Peter Lorent Level 2
                  >>Flash, on the other hand, does a completely crap job of dealing with data
                  Flex, on the other hand does a completely crap job of dealing with animation. And a completely crap job of dealing with assets and building a gui with nested movieclips containing animation(s).

                  >>Their primary use case was that you point it to an external XML file and that's the extent of what "data driven" means in their world. Using the words "strongly typed objects" on their forums resulted in virtual blank stares.
                  Just like in the Flex 'realm' developers have written all kinds of libraries to provide additional 'features'. Someone came up with Degrafa for Flex and another one wrote a wrapper for remoting in Flash. I don't know about you, but I highly respect guys like Grant Skinner and Colin Moock who both primarily code for Flash. In the end, the result matters, not if you know what a strongly typed object is. I've seen amazing projects that were done with code on the timeline and I've seen projects that were done the 'programmer way' and made me feel sad... Equally I've seen designers write code a programmer could only wish he or she wrote.

                  >>The Flash environment is better for graphically-heavy applications. Simple games without a lot of internal logic, animations, displays...whizzy things.
                  >>The Flex tools are better suited to code-heavy applications. Traditional applications with user input forms, lots of low-level disk or network I/O and calculations...serious things.

                  That probably doesn't even scratch the surface of when and how to use the Flash and Flex tools. In fact, this is in my opinion complete nonsense.

                  In the end the OP probably answered its own question best: Is Flex then a new set of classes that simplifies the development of Flash?
                  Well, almost. The Flex framework is an extra set of classes on top of the existing Flash framework of classes. Both are organised in what is called 'packages'. The Flash framework consists of the flash. and fl. packages, see http://help.adobe.com/en_US/AS3LCR/Flash_10.0/index.html
                  The Flex framework consists of the flash. and mx. packages, see http://livedocs.adobe.com/flex/3/langref/
                  And you do not develop 'Flash', you develop swf content that can be interpreted by the Flash Player plugin.

                  Ultimately ActionScript is what drives it all and you will learn how to use the different tools along the way. There is no ready made answer when to use Flash or Flex. Some things can be done better in Flex, other things are more efficiently done in the Flash IDE. Using them together is also a nice solution...
                  • 6. Flex vs Flash
                    Karl_Sigiscar_1971 Level 3
                    I'd like to add that you can get the best of both worlds by using the Flex component kit for Flash CS3 that turns a movieclip into a Flex component.

                    You can also use the Papervision 3D or Away 3D APIs in Flex in order to create more graphically rich applications with complex animations.
                    • 7. Re: Flex vs Flash
                      Gregory Lafrance Level 6
                      In general, Flex came into existance because creating "applications" in Flash was a nightmare.

                      Flash is great for creating animations, but for event based applications that step away from the timeline Flex is the way to go.

                      There are APIs that blur the line and allow you to still work in Flash and create Flex custom components, but the fact remains, Flash and Flex at their root have a very different optimal target goal in mind. That's why Flex was conceived.