flex MX Spark

SparkandMXcomponents

Flexdefinestwosetsofcomponents:SparkandMX.TheSparkcomponentsarenewforFlex4andaredefinedinthespark.*packages.TheMXcomponentsshippedinpreviousreleasesofFlexandaredefinedinthemx.*packages.

ThemaindifferencesbetweenSparkandMXcomponentsarehowyouuseCSSstyleswiththecomponentsandhowyouskinthem.Forthecontainercomponents,thereareadditionaldifferencesabouthowthecontainersperformlayout.

SparkandMXdefinesomeofthesamecomponents.Forexample,Sparkdefinesabuttoncontrolinthespark.componentspackage,andMXdefinesabuttoncontrolinthemx.controlspackage.WhenacomponentisavailableinbothSparkandMX,AdoberecommendsthatyouusetheSparkcomponent.

SparkandMXalsodefinecomponentsthatareunique.Forexample,Sparkdefinescomponentstoperformthreedimensionaleffects.MXdefinesdatavisualizationcomponents,suchastheDataGridandAdvancedDataGridcontrols,notincludedinSpark.YourapplicationsoftencontainsamixtureofSparkandMXcomponents.

(Spark和MX组件

Flex定义了两类组件集合:Spark和MX。Spark组件是Flex4特有的,在spark.*包中被定义。MX组件是先前flex发布版本里存在的,被定义在mx.*包中。

Spark和MX主要的区别在于组件如何使用CSS风格和如何给它们设置皮肤。对于容器组件,在容器如何进行布局上还有别的不同之处。

Spark和MX定义了一些相同的组件。例如,Spark定义一个按钮控件在spark.components包中,MX定义了一个按钮控件在mx.controls包中。当一个组件在Spark和MX都可用,Adobe推荐使用Spark组件。

Spark和MX也定义了各自独一无二的组件。例如,Spark定义组件来演示三维效果。MX定义数据可视化组件,例如DataGrid和AdvancedDateGrid控件,不包含在Spark.你的应用程序经常会混合使用Spark和MX组件。)

相关推荐