更新时间:2023-11-09 13:40:04
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.