Flex 3 等效于“<fx:Declarations>"? [英] Flex 3 equivalent of '<fx:Declarations>'?
问题描述
我正在尝试将 Flex 4 项目向后迁移到 Flex 3,并且我需要移动 MXML 中
块中映射的内容.Flex 3 有没有类似的东西?我已经有一段时间没有完成 Flex 3 了.
I'm trying to migrate a Flex 4 project backwards to Flex 3, and I need to move stuff mapped in a <fx:Declarations>
block in MXML. Does Flex 3 have something similar to this? It's been a while since I've done Flex 3.
推荐答案
Flex 3 中没有等效项.您可以在其他组件旁边声明内容.Flex 4 中的差异使得视觉和非视觉项目(包括效果等、验证器、格式化器、数据声明和 RPC 类)更清晰.
There is no equivalent in Flex 3. You can declare things alongside your other components. The difference in Flex 4 makes the separation between visual and non-visual items (including things like effects, validators, formatters, data declarations, and RPC classes) clearer.
例如,在 Flex 4 中,您可以这样做:
For example, in Flex 4 you would do this:
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Declarations>
<fx:String>Hello, world!</fx:String>
</fx:Declarations>
<!-- Component defintions -->
</s:Application>
但在 Flex 3 中,您会这样做:
but in Flex 3, you would do this:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:String>blah</mx:String>
<!-- Component defintions -->
</mx:Application>
但是,您可以在 <mx:Script>
或
You can, however, define your variables and whatever other declarations (visual or not) within the <mx:Script>
or <fx:Script>
tag in Flex 3 and 4 respectively.
如果您遇到其他更改,请搜索 Adobe 网站关于 从 flex 3 迁移到 flex 4 以查看您可能需要进行哪些其他更改.
If you're stuck on other changes, search Adobe's website about migrating from flex 3 to flex 4 to see what other changes you may have to make.
这篇关于Flex 3 等效于“<fx:Declarations>"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!