apache-flex - Flex 3相当于 '<fx:Declarations>'吗?

标签 apache-flex actionscript-3 flex3 flex4

我正在尝试将Flex 4项目向后迁移到Flex 3,并且需要移动映射到MXML中<fx:Declarations>块中的内容。 Flex 3是否有与此类似的东西?自从我完成Flex 3已经有一段时间了。

最佳答案

Flex 3中没有等效项。您可以在其他组件旁边声明事物。 difference in Flex 4使可视项和非可视项(包括效果,验证器,格式化程序,数据声明和RPC类)之间的分隔更加清晰。

例如,在Flex 4中,您可以这样做:

<?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中,您可以这样做:
<?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>

但是,您可以分别在Flex 3和4的<mx:Script><fx:Script>标记中定义变量以及任何其他声明(可见或不可见)。

如果您坚持进行其他更改,请在Adobe网站上搜索migrating from flex 3 to flex 4,以了解您可能还需要进行哪些其他更改。

关于apache-flex - Flex 3相当于 '<fx:Declarations>'吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6132994/

相关文章:

eclipse - 无法加载 JavaHL 库

apache-flex - Flex/AIR,如何将焦点设置在 UI 控件、按钮等上?

actionscript-3 - Flash/Flex Speex 音频解码,播放 speex 文件

java - 快速生成随机列元素的方法

java - 如何在 Flex/BlazeDS 中同时支持 HTTP 和 HTTPS channel ?

apache-flex - Flex Builder 3 或 Flex 4(Flash Builder 4 又名 Gumbo)

apache-flex - 将 Flex 3 迁移到 Flex 4 时出错

flash - 使用 Actionscript 3 连接到数据库

actionscript-3 - as3中的阿拉伯文字

apache-flex - Adobe Flex 应用程序页面文件使用量激增!