学习flex 4面临命名空间问题
我正在尝试从 adobe 文档中学习 flex4,在使用三个命名空间时我感到非常困惑。我无法跟踪何时使用通常最终在 mx 或 s 中使用 fx 的内容,或者类似地做出一些愚蠢的错误组合{fx,mx,s}。
Adobe 文档很大,我正在寻找一些学习 flex 的良好起点。
I am trying to learn flex4 from adobe document and I am very confused while using three namespaces.. there is no way i can keep track of when to use what often ending up using fx inside mx or s or similarly making some stupid goofed up combinations of {fx,mx,s}.
Adobe document is huge and i am looking for some good starting point for learning flex .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的问题很大;但是,关于您引用的 3 个命名空间的一些基本解释:
在显示列表上声明视觉元素和 UIComponent 时,您通常需要 Spark 架构;因此,您将使用 Spark 命名空间。
MX 架构很重要,但通常被 Spark 弃用。如果某个组件可用作 Spark,则您应该使用该实现。
都是框架的包,和ActionScript中导入包没有什么区别。您的自定义组件将使用它们的包名称作为命名空间,或者您为 Flex MXML 库声明一个命名空间。
如果您使用的是 Flash Builder 之类的 IDE,通常不必担心命名空间。
在 MXML 文件中,输入开始标记(即:<),跳过命名空间并开始键入您要查找的类。在上面的示例中,我点击
如果自动完成选项未出现,请按 [ctrl]+[空格键]。
让 Flash Builder 为您完成名称空间,从而帮助您处理名称空间。
可能对您没有多大帮助,但希望这对您有所帮助。
Your question is quite large; however, some basic explanation about the 3 namespaces you've cited:
<fx> tags are typically programmatic functionality and not visual display objects. You'd use it for declaring a script block in a MXML document or defining variables in a declarative way.
When declaring visual elements and UIComponents on the display list, you'll typically want Spark architecture; therefore, you'd use the Spark namespace.
MX architecture is important, but is generally deprecated by Spark. If a component is available as Spark, you should use that implementation.
All are just packages of the framework, and really no difference than importing packages in ActionScript. Your custom components will use their package name as a namespace, or you declare a namespace for your Flex MXML library.
If you're using an IDE like Flash Builder, you usually don't have to worry about the namespaces.
In an MXML file, enter the start tag (ie: <), skip the namespace and start typing the class you're after. In the above examples, I'd hit <s for "script" and the intellisense will show you completion options that will insert the namespace for you.
If the auto completion options do not appear, hit [ctrl]+[space-bar].
Let Flash Builder help with namespaces by completing them for you.
Probably doesn't go far to helping you out, but hopefully this helps a little.
您是否特别尝试过 http://www.adobe.com/devnet/flex.html入门部分?
Have you tried http://www.adobe.com/devnet/flex.html especially Getting Started part?