問題描述
“Adobe Flex”和使用 fl.controls 和 fl.events 庫的 AS3 應用程序有什麼區別? (what is the difference between "Adobe Flex" and an AS3 app using fl.controls and fl.events libraries?)
articles like this one seem to say that Flex is a library for making desktop‑like applications that run in Flash Player. But what confuses me is that I have already built AS3 applications that imitate desktop look and feel without any "flex". I use libraries called fl.controls and fl.events, and it worked perfectly fine, with buttons, textboxes, listboxes, combo boxes etc.
Help me get my head around this issue. Is fl.controls and fl.events actually a part of flex, but I never realized this? Or are they a competing widget library/framework, but one that for marketing reasons Adobe did not bother assigning a sexy name like "flex"?
If flex is distinct from fl.controls and fl.events, can you use these libraries in a flex / AIR app? (I don't care about the "flex" aspect, just want to make AIR apps) Or is it a matter of either‑or, either the fl.* or the flex libraries in a single project?
Also, for clarity, I am now working in FlashDevelop and not in any of Adobe's proprietary IDE's. So I guess the difference between packages based on "which version of IDE got shipped with the particular library" is sort of lost on me.
‑‑‑‑‑
參考解法
方法 1:
The fl.controls
library, from what I can tell, is really just a bunch of widgets you can use in Flash. Flex, on the other hand, is an application development framework with a set rich development capabilities you can't get using AS3 and fl.controls
alone.
Some of the things that Flex get you:
- Declarative markup in the form of MXML
- Data binding
- State management
- Skinning
- A component model for creating your own composite components
By default, these controls are not imported when you create a new Flex project in Flash Builder. It appears, however, that it is possible.
From what I can tell, there aren't many use cases for doing this (other than integrating legacy code) since Flex provides everything and more compared to the fl.controls
.
方法 2:
fl.controls.*
are components used in Flash Professional. they are akin to mx
or spark
components in the Flex framework. however, the Flex spark
components are much more advanced than the Flash Professional components, but i believe you'll have to use MXML code with AS3 (instead of just AS3) when you use Flex components.
方法 3:
The above answers are reasonable when using Flex for desktop computers, but for mobile devices the question is more complex. The ease of development advantages of Flex come with a performance penalty that is a great problem for mobile development. One can achieve needed performance gains by eliminating states and data binding. There are a number Adobe documents recommending not using them. And in order to eliminate these easily, I have found it easiest to also not use mxml. Because, it is easiest to get along without states when graphical components are instantiated programmatically.
Both spark.components and fl.controls can be skinned. The difference is that spark.components have a skinnable interface that allows one to skin the same components with many different skins. For me, this is an elegant feature for which I have not yet seen a requirement. Although, I can imagine firms that develop the same components for multiple customers find this very useful.
I wish that I could report here on the relative performance of fl.controls vs spark.components. If anyone has such data, please post it. By viewing the class hierarchy it is clear that fl.controls are lighter weight, but it would be nice to be able to measure that advantage.
(by EndangeringSpecies、Brian Genisio、Chunky Chunk、user1157092)