在ActionScript和MXML< MX:> VS&所述氏:GT;所述、LT、MXML、ActionScript

2023-09-08 12:51:45 作者:你是我最致命dē诱惑

看起来我可以使用的组件为< MX:> < S:>

Looks like I can use components for both <mx:> or <s:>.

所以,它具有更多的优势?

So, which has more advantages?

推荐答案

由于其他海报也提到,火花(S :)命名空间是指使用Flex 4引入了新的组件,而晕/ MX(MX :)命名空间指的是旧的组件。

As other posters have mentioned, the spark (s:) namespace refers to the new components introduced with Flex 4, while the halo/mx (mx:) namespace refers to the older components.

它们可以一起使用,这是必要的,因为那里没有火花当量为所有的mx组分(值得注意的遗漏数据网格树DividedBox将,等等。)的某些动机为新的火花组件包括:分离从功能,这意味着形式的Spark组件都非常的皮肤驱动。为提高性能重量轻(可以使用S:集团铺设了您的组件,而不是MX:帆布,这是以来党更加高效:集团没有像填充或边界的任何视觉特性)

They can be used together, which is necessary since there are not spark equivalents for all of the mx components (notable omissions are DataGrid, Tree, DividedBox, among others.) Some of the motivations for the new spark components include: Separation of form from function, which means the spark components are very much skin driven. Lighter weight for performance gains (You can use s:Group for laying out your components rather than mx:Canvas, which is much more efficient since s:Group doesn't have any visual characteristics like fill or border.)

底线:我发现Spark组件是非常高效的性能,明智的,但有点挑剔改变外观/行为,因为你需要为他们创建自定义外观。此外,他们有一些怪癖仍需要理顺(为什么不DropDownLists自动判断的基础上,如MX版本那样?内容的宽度)由于光环/ MX组件的道路上脱precation,它的使用Spark组件总体上是好的做法时,你可以。

Bottom line: I find the spark components to be very efficient performance-wise but a little fussy for changing appearance/behavior since you need to create custom skins for them. Also, they have a few quirks that still need to be ironed out (why don't DropDownLists automatically determine their width based on content like the mx versions did?!) Since the halo/mx components are on the path to deprecation, it's generally good practice to use the spark components whenever you can.