Ultrashock Forums > Flash > Flex
Difference between AIR and Flex

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Difference between AIR and Flex
Old 2007-10-04

I was just trying to get a handle on
the new technologies and was wondering if
some one could give me some insight. I have
gathered several statements below but am still
unclear how everything fits together.

Flex Builder is a development environment
for developing RIAs.

Flex is also a development framework where
any editor can be used to develop Flex applications.
Adobe Flex Builder is just Adobe's solution to developing
Flex programs.

Flex Builder can also be used to develop AIR applications.
Flash or HTML/AJAX can also be used to develop AIR applications.

AIR runtime needs to be installed on a machine in order to
run AIR applications. Is this equivalent to Flash Player needs
to be installed on a machine in order to run Flash applications?

So what is the difference between the Flex framework and AIR
framework? I have seen where an AIR extension needs to be
installed for Flex Builder. What is the default that Flex Builder
publishes to, a Flex exe?

Both frameworks seem to be based on AS3. I have read a developer can
use Flash, Flex, HTML, Javascript, Ajax to build AIR files but am still
unsure how Flex and AIR files are different.

Thanks
postbit arrow 16 comments | 4500 views postbit arrow Reply: with Quote   
Registered User
monka is offline
seperator
Posts: 35
2005-03-01
monka lives in United States
seperator

Ultrashock Member Comments:
mindtwitch's Avatar mindtwitch mindtwitch is offline mindtwitch lives in United States 2007-10-05 #2 Old  
See if I can explain this properly.

The "Flex Framework" is a collection of AS3 classes and components used in developing RIAs.

"Flex Builder" is an IDE used to develop "Flex Applications."

Much in the same way HTML is a collection of tags to develop web pages and Dreamweaver is an IDE for developing web pages. However you don't need Dreamweaver, you can use Notepad, BBEdit, etc. as well.

If you use something other than Flex Builder to develop in Flex, you need to download the Flex SDK to compile. The end result of a compiled Flex Application is an SWF file (Same as Flash).

With the compiled SWF file, a user only needs to have Flash Player installed to run the application.

Most Flex apps are developed, deployed to a server and then a web browser is used to serve the application to the user for use.

I haven't used AIR yet so I don't know what the end product of a compliled AIR Application is, but AIR is an alternative delivery system for Flex Applications, replacing the web server and browser so to speak. It's primary purpose is for deploying RIAs to a user's desktop, independant of an internet connection.

AIR, also allows for the use of HTML, AJAX etc. So an AIR Application could be a collection of all these things, compiled together.

To run an AIR Application, you need AIR Runtime installed on your computer.

Hope that made sense. Any other questions, just ask. And welcome to US.
Reply With Quote  
senocular senocular is offline Moderator senocular lives in United States 2007-10-05 #3 Old  
A lot of the basic ideas have been touched upon, and all are pretty right on. Let me see if I can summarize (and some if not most of this will be redundant):

SWF files are played by the Flash player.

The Flash player needs to be installed on a users computer in order to be able to view SWF files (this usually as a Flash plugin/ActiveX control for the browser).

SWF files are created with authoring environments like Flash and Flex

SWF files leverage code defined in the Flash player native code to operate

Both Flash Authoring and Flex Builder have their own components and code bases from which additional functionality is derived; in Flex, this is the mx 'Flex' framework (Flash now uses code in an fl package).

AIR is Adobe's attempt to allow web developers easily create desktop applications using the same technologies used to make web applications (Flash/Flex and HTML/JavaScript).

Like the Flash player, AIR needs to be installed on a user's machine in order for an AIR application to run on it. This installation is for the "AIR Runtime" which provides the OS-specific groundwork to allow any one HTML or SWF-based AIR application work cross-platform without needing to have completely separate executables or [much, if any] OS-specific programming etc.

In addition to the code in the browser version of the Flash player, AIR adds additional native code to its version of the Flash player (and to JavaScript) to perform additional tasks such as file handling, drag and drop, and window manipulation. These new AIR APIs can still be used with the same mx or fl frameworks used by Flex and Flash to create web based applications.


So basically you just have two players now, one for the browser and one for the deskop. Each are cross-platform and provide similar functionality with the desktop version allowing for more. The same tools used to create web-based SWFs can now (using updates or upcoming releases) be used to also target the desktop version of the player (AIR) with its support of new native features.
Reply With Quote  
monka monka is offline monka lives in United States 2007-10-05 #4 Old  
Thank you very much for both of your detailed replies. I now have a much better idea of what is going on with these technologies.
Reply With Quote  
Artofacks1 Artofacks1 is offline Artofacks1 lives in United States 2007-12-12 #5 Old  
Does flex tool have an animation time line like flash? Just wondering havent used fles yet but seems very powerful and since I use DW for my html needs and moved away from using hand code for some stuff the DWs interface helps with I was wondering how Flex can help streamline the flash site process.
Reply With Quote  
tcoulson tcoulson is offline 2008-01-11 #6 Old  
Flex does not have a timeline at all. Flex uses mxml markup - similar to xml - to create parts, views, and widgets inside your project. It also uses ActionScript as its scripting language. So your mxml files usually consist of components that reference other ActionScript files. This may confuse you further, but it is a key thing to realize - all mxml markup when compiled is ActionScript. MXML is just a shorter way of writing those blocks of ActionScript code. So when compiled, all Flex does is make a swf file that is comprised of ActionScript files all working in concert with one another. Why is this important? Because Flex has a lot more components than it's Flash counterpart. In addition you are only dealing with code - so it makes it a bit easier to rapidly build applications. Where Flash's timeline can sometimes muddy the waters when trying to build rich internet applications.

I was wondering how Flex can help streamline the flash site process
Flex basically steamlines application development. It is similar to FlexBuilder is similar to Dreamweaver in that it lends a visual interface to building mxml files and allows you to edit ActionScript files with tons of code hints and code completion - some of which is not found in Flash. But Flex is not the same thing as FlexBuilder. FlexBuilder is analogous to Dreamweaver, where Flex is analogous to HTML. Or better yet, where ActionScript is analogous to HTML. Flex can be downloaded as an sdk and compiled through the command line - so you never have to open FlexBuilder in order to build a Flex project. However, to newbie's this would be a daunting task without any code completion or helper tools. Just like hand coding HTML is harder in some cases than using Dreamweaver. But coder beware - when you rely on wysiwyg programs to build all your projects - extra code can muddy the waters of your projects and make them more difficult to understand.

Hope that helps.
Reply With Quote  
Nutrox's Avatar Nutrox Nutrox is offline Nutrox lives in United Kingdom 13 Creative Assets 2008-01-11 #7 Old  
You don't actually need to use MXML with Flex. I don't like MXML and never use it, I just stick with ActionScript.

From my point of view, Flex is simply a compiler capable of compiling MXML as well as ActionScript, it has reference to the Flex Framework by default, and it also understands metadata tags within ActionScript etc. The Flex Framework is just the mx.* class package which contains all of the classes used by the components (which again I don't use). Flex Builder is basically a very cool code editor, but it also has the ability to display and modify the Flex Framework components in realtime.

At the end of the day though, everything is compiled to AS3 bytecode and run via the Flash Player. Just because someone creates a site using Flex Builder or the Flex SDK doesn't mean it is a "Flex" site, the only sites that are "Flex" sites are the ones that actually use the components from the Flex Framework.

IMO, you either create a "Flash" site or you don't. You either use the Flash Player or you don't. I think too many people are using the word Flex as some kind of buzzword or promotional tool to hype up their sites. What is the difference between a Flex site and a Flash site?... there is no difference.

Reply With Quote  
sims11tz's Avatar sims11tz sims11tz is offline sims11tz lives in United States 2008-01-11 #8 Old  
Very well put Nutrox!! So when you say you never use MXML, are you able to actually use the flex components? Without using MXML are you limited at all, or is it really the same as using AS. I know it all ends up the same type of data in the end and MXML is really short hand AS3 in a sense.... but are you able to accomplish the exact same results using AS3 or MXML? What about AIR development, will this be the same case... ?? I think I'm starting to get a handle on this new stuff, I think the biggest breakthrough I have had is realizing MXML is like short hand AS3. Anyways thanks for all the thoughts everyone!
Reply With Quote  
Nutrox's Avatar Nutrox Nutrox is offline Nutrox lives in United Kingdom 13 Creative Assets 2008-01-11 #9 Old  
Last edited by Nutrox : 2008-01-11 at 08:53.
MXML is "ActionScript for dummies", it is XML based markup that people can use instead of (or with) ActionScript to add Flex components to the display list and set component properties etc. You can think of it as HTML which uses Flex components instead of <divs> <tables> etc. You don't need to use MXML to use Flex or Flex Builder, you can do everything with ActionScript.

You create AIR apps in the same way you would create a Flash or HTML site. The only difference is that running your app through AIR allows you to do some additional things such accessing the local file system, creating OS windows, and so on. AIR is a "wrapper" for Flash or HTML sites, you can think of it as a very cool version of the Flash Player.

Reply With Quote  
tcoulson tcoulson is offline 2008-01-11 #10 Old  
Quote: Originally Posted by Nutrox View Post
MXML is "ActionScript for dummies"
This is the only part of the statement that hit a cord with me. Obviously you dislike using MXML for your projects, but I would say for the benefit of the other listeners in our audience that MXML is a quicker markup than writing ActionScript. So if you simply need a quick form, or you want to mock up the skeleton of your application to get you started - use MXML. That being said, ActionScript still packs the punch for Flex projects and if you are creating anything of substance, you will have to write multiple AS files to build out the guts of your project, with a bit of MXML to help get you started and assist with bindings to data.

but are you able to accomplish the exact same results using AS3 or MXML?
This is the part where I totally agree with nutrox. There is the old quote that goes "Anything you can do I can do better". Well that is what ActionScript says to MXML and the Flex Framework. Mostly because it is build on and compiled to ActionScript and the swf format.
Reply With Quote  
Nutrox's Avatar Nutrox Nutrox is offline Nutrox lives in United Kingdom 13 Creative Assets 2008-01-12 #11 Old  
Yar, I agree that MXML can be useful to some people, I guess it just depends on how you prefer to work really. I'm very hands-on when it comes to ActionScript and other languages such as PHP JS and HTML etc, so MXML just seems like an unnecessary layer of cake to me... if that makes sense. Maybe I should have said that I don't like working with MXML instead of saying I don't like it, but I do think it dumbs-down application development as well as locking you into the Flex Framework which may or may not be a good thing depending on your ActionScript experience and/or preferred working methods.

Reply With Quote  
worthyashes worthyashes is offline worthyashes lives in United Kingdom 2009-01-30 #12 Old  
OK - well I have to disagree with Nutrox completely. Nutrox is telling you that basically MXML is unnecessary and a waste of time - if only you'd taken the time to learn how to do Actionscript properly you'd never have to rely on someone else to do the work. In fact, all MXML and Flex enables you to do is to skin components easily.

Balls.

You are completely missing the whole 'king point of Flex. And also the whole point of application development. You use the best tool for the job. If you are writting a game, then opening up flex builder and selecting 'New Flex Project' is an error, because Flex wasn't created do that. Flex has been created for data driven applications where the most important thing has been 'How are we going to display this data.' In this case it is fantastic that I can quickly put together a complex data display using charts, data grids and text areas safe in the knowledge that further down the line I can style them - but most importantly that I don't have to build them from scratch. And even better in MXML I can very very quickly lay them out safe in the knowledge that all the bits are going to be where I expect them to be. Yes - I could just have a main AS class and do lots of 'new VBox(), x = , y= , addChild' or I could just write the tags and there they are.

But even more than that - if I decide to not be an AS purist I can use a combination of MXML and AS to bind the components to the data without having to write loads of AS. Then when the variable changes the display changes. I've got MVC without having to **** about writing loads of code. Also I've the advantage of quickly and easily using states, transitions and effects all merely through tags. A great example is that if you change state and remove a child element the flex framework deals with it's complete removal. I don't need to clear listeners or loitering objects - they are sorted.

I've also got a completely skinnable set of components that I can also extend - using MXML or AS - to do whatever I want.

I'm no Flex evangelist or a particular lover of Flash. I believe in the right tool for the right place and the argument Nutrox is putting up if small minded to say the least. If you go down that line then why not put down Flash right now, go learn AJAX and JQuery and do everything that way? It's all possible if you put the work in.

Why not think about what you need to do and then select the correct tool to do it. If I wanted to build a house I'd probably use bricks, mortar,cement, bathroom tiles, etc - Flex gives me this foundation. I can pick the styles, colours and locations.

If I wanted to paint a work of art I'd start with a blank canvas and then get started - that's the joy of working with pure ActionScript.
Reply With Quote  
Artofacks1 Artofacks1 is offline Artofacks1 lives in United States 2009-01-30 #13 Old  
Very spirited post worthyashes and I agree with you completely. Nice to see that there are users at US taht still have a mind of their own. That's been missing around here for a while now.
Reply With Quote  
Nutrox's Avatar Nutrox Nutrox is offline Nutrox lives in United Kingdom 13 Creative Assets 2009-01-30 #14 Old  
Last edited by Nutrox : 2009-01-30 at 18:22.
worthyashes, I'm not sure what sparked your (one year late) response at this time but if you had read my replies properly you would have noticed that I basically said the choice to use mxml boils down to personal preference.

Yar, I agree that MXML can be useful to some people, I guess it just depends on how you prefer to work really. I'm very hands-on when it comes to ActionScript and other languages such as PHP JS and HTML etc, so MXML just seems like an unnecessary layer of cake to me.

You like working with mxml, I personally don't need to use it, there is nothing wrong with either of those.

Go get some sleep.
Reply With Quote  
Isocase Isocase is offline Isocase lives in United States 2009-01-30 #15 Old  
I want to post to a year old thread too
Reply With Quote  
worthyashes worthyashes is offline worthyashes lives in United Kingdom 2009-01-31 #16 Old  
Oops

*note to self don't post late at night and when the red fog of rage takes hold check the date*

Reply With Quote  
Nutrox's Avatar Nutrox Nutrox is offline Nutrox lives in United Kingdom 13 Creative Assets 2009-01-31 #17 Old  

No problem, mate. I've been there and done that myself on many occasions.
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: