Here at SO, I asked what language I should use to create a web app that would capture video from the user webcam and send it to the server when he clicked 'submit' and the answers were mostly Flash.
But searching the web I got confused with this Flash/Flex thing as they say Flash is to make animations and Flex is to really create web apps.
So what should I use? By Flash they meant Flex? Or for a program like that Flash is fine? Should I use Flash Pro. or Flash Builder? Learn ActionScript or XMXL?
It may look there are tons o开发者_C百科f contents about this on the web, but the more I read, more I got confused.
Thanks in advance.
I would suggest writing this application using Flex. Mainly because the Flex toolchain is a lot better than Flash Professional in my opinion. While there's nothing in your question that really seem to require the Flex framework, you would probably benefit from using it. Not only for its superior development environment but also because there's a few things in the Flex framework that just makes working with data a whole lot easier.
Regardless, there seems to be a lot of confusion regarding terminology here, so I'll try to clear a few things up:
DISCLAIMER: This is by no means a comprehensive list of everything flash. While I've tried my best to be factual I quite possibly have left out some important details for the sake of brevity (hey, at least I tried) and in other cases I may simply be wrong. The usual caveats about considering the source apply.
Flash player, provides the ability to render vector and raster graphics as well as run user code in a virtual machine. The player is the core of the flash platform, enabling content to run on multiple platforms (generally without any platform specific modifications.) There are quite a few APIs in the player that are actually native code but can be called from ActionScript.
ActionScript is the high level language of choice for the Flash Platform. There are others, most notably Haxe, but they aren't supported by Adobe's tools. There are three versions of the language: ActionScript 1, 2 and 3. The first two were used prior to Flash 9, which introduced a completely rewritten virtual machine (AVM2) and thus also introduced AS3. The former languages run in an older virtual machine called AVM1. Older content produced for AVM1 can run in newer AVM2 enabled players. They will still run in AVM1 mode however, in order to retain backwards compatibility. Flash actually handles backwards compatibility remarkably well.
Flash Professional, also known as the Flash IDE, is the name of a tool to produce flash content. It started out as a way to just create animations, but as the flash movie format got scripting capabilities, so did the tool. However, the scripting have long been a bastard child of this tool. While the past couple of versions have seen improvements in this area it still pales in comparison with other more developer centric environments. This tool only compiles pure ActionScript projects, is not used to develop Flex applications and is generally considered to be more designer friendly than developer friendly.
Flex is the name of Adobe's enterprise application framework. There are a few key technologies to Flex and it's more than just a core library of functionality. I'll try to concisely explain the key technologies of the framework below. The Flex SDK is actually open source and can be used freely to develop applications. However, while it contains anything needed to build Flex applications, it doesn't actually include an IDE.
MXML is a declarative language. It is generally used to declaratively define views, but can be used for many things. For instance, the swiz framework leverage MXML to declaratively define dependencies using IoC. There's of course a lot more to swiz, but that's beyond the scope of this answer.
MXMLC & COMPC are two compilers used to compile flex projects. The former is used to compile swf applications, the latter is used to compile swc libraries.
The core library among other things includes two standard component sets: MX and Spark; the former often referred to as Halo. MX is an older component set and while still supported, is considered deprecated and will likely be phased out once Spark reaches feature parity with MX. The two component sets are largely compatible with each other however and can co-exist quite well in the same application. Other notable functionality provided is quite comprehensive data access and management functionality, both for text based data such as XML or JSON as well as binary data (AMF.)
The library is commonly referred to as just Flex or the Flex framework.
Flash Builder is Adobe's IDE for the development of Flex applications. While it is certainly possible to use it to develop pure AS3 applications it's most commonly used to develop Flex applications. It's a decent IDE with most of the features available in a modern development environment, but there are popular alternatives such as PowerFlasher's FDT. While the Flex SDK is free and open source, Flash Builder is both proprietary and commercial software.
This is not entirely true. You may use Flash Professional to develop and write code in native Actionscript 3 while also being able to develop at the Designer level creating images/animations and so on.
To answer your question, if you wish to code in MXML, then you need to use Flash Builder. If you want to write in native AS3 you may use either of the two. Both will work, however, from personal experience you have more freedom using native AS3. Also, for the type of application that you wish to make, performance would probably be of great priority, thus having full control using AS3 is recommended.
EDIT: Also, if you are familiar with C++ or Java, or any other object oriented, I believe programming in ActionScript3 will feel very much like home.
IMO that says it all: Flash Professional is for Designers and Flash Builder (Flex) is for programmers.
With Flash Builder you have to learn both, MXML and ActionScript. MXML is for the declarative layout of the GUI and ActionScript is the programming language.
"Flash" is the name of the entire platform (think something like .NET or Java). "Flex" is the name of a framework built on top of Flash. So by using Flex, you're technically using Flash as well.
Your two main options for development are the Flash Professional IDE and Flex (either manually through their compiler or through the Flash Builder IDE). The difference is how you create the user interface: in Flash Professional, you design elements visually, whereas with Flex you code them using MXML (though Flash Builder comes with a more basic visual designer as well). Both tools use ActionScript for application logic, though Flash Professional uses it more as a scripting language than a traditional programming language.
Since you're going to be doing more programming than designing, Flex fits your application more, IMO. To get started, take a look at Learn Flex in a Week.
精彩评论