Flex 4 中的 mx/fx/s 对象类型有什么区别? [英] What's the difference between the mx/fx/s object types in Flex 4?

查看:20
本文介绍了Flex 4 中的 mx/fx/s 对象类型有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Flex4 提供以下命名空间:

Flex4 provides the following namespaces:

xmlns:fx="http://ns.adobe.com/mxml/2009" 
xmlns:s="library://ns.adobe.com/flex/spark" 
xmlns:mx="library://ns.adobe.com/flex/halo"

有什么区别?哪个命名空间提供哪个功能?我在哪里可以找到相关信息?

What's the difference? Which namespace provide which function? Where can I find info about that?

推荐答案

命名空间允许您向编译器指定在哪里查找您在 mxml 中引用的文件/类.

Namespaces allow you to specify to the compiler where to look for the files/classes that you reference in your mxml.

Flex 4 中使用了两种不同类型的命名空间.语言命名空间和组件命名空间.http://ns.adobe.com/mxml/2009 命名空间指定使用的 mxml 语言版本.这包括脚本标签和绑定标签以及声明和私有等新标签.

There are two different types of namespaces that get used in Flex 4. A language namespace and a component namespace. the http: //ns.adobe.com/mxml/2009 namespace specifies what version of the mxml language gets used. This includes things like the script tag and binding tag as well as new tags like declarations and private.

您在上面引用的其他 2 个命名空间是组件命名空间.这些是对构成您将在应用程序中使用的 UI 组件的特定 ActionScript 类的引用./flex/spark 组件集是新的 flex 4 组件,它具有单独的外观和组件实现./flex/halo 集合是存在于 flex 3 集合中的组件.尽管/flex/halo 在新的每晚构建中已重命名为/flex/mx,但请小心.

The other 2 namespaces you reference above are component namespaces. These are references to the specific ActionScript classes that make up the UI components you will use in your application. The /flex/spark component set is the new flex 4 components which have skins and component implementation seperate. The /flex/halo set are the components that exist in the flex 3 set. Be careful though the /flex/halo has been renamed /flex/mx in new nightly builds.

在 Flex 3 中,只有一种语言可用,并且只有一种组件集,因此他们将这些定义集中在一个文件中.因此,虽然引擎盖下的技术位没有改变,但 adobe 公开它们的方式(通过多个命名空间)已经发生了变化.乍一看这似乎更复杂,但请记住,在进行 flex 工作时,您总是为 mxml 中的所有视图组件创建 xml 命名空间.所以现在你和核心框架处于同一水平,这很棒.此外,在 Flex 4 中可以使用多种语言和组件集,因此不可能创建 Flex 3 中存在的一对一映射.

In Flex 3 there was only one language available and only one component set so they jammed the definitions for those together in one file. So while the technical bits under the hood have not changed, the way adobe exposes them (through multiple namespaces) has. This may seem more complicated at first, but keep in mind that in doing flex work you have always created xml namespaces for all your view components in mxml. So now you play on the same level as the core framework, which is great. Also in Flex 4 there are several languages and component sets that can be used, so it would be impossible to create that one-to-one mapping that existed in Flex 3.

有关此主题的更多信息,请参阅有关该主题的 Adob​​e 文档:http://opensource.adobe.com/wiki/display/flexsdk/MXML+2009

For more information on this topic please refer to the Adobe docs on the subject: http://opensource.adobe.com/wiki/display/flexsdk/MXML+2009

HTH,

模拟

这篇关于Flex 4 中的 mx/fx/s 对象类型有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆