簡體   English   中英

Flex 3 相當於 '<fx:declarations> '?</fx:declarations>

[英]Flex 3 equivalent of '<fx:Declarations>'?

我正在嘗試將 Flex 4 項目向后遷移到 Flex 3,並且我需要移動 MXML 中<fx:Declarations>塊中映射的內容。 Flex 3 有類似的東西嗎? 自從我完成 Flex 3 以來已經有一段時間了。

Flex 3 中沒有等價物。您可以與其他組件一起聲明事物。 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 和 Flex 4 中的<mx:Script><fx:Script>標記中定義變量和任何其他聲明(可視的或非可視的)。

如果您在其他更改上遇到困難,請搜索有關從 flex 3 遷移到 flex 4的 Adobe 網站,以查看您可能需要進行哪些其他更改。

無需單獨定義,當然不支持

 <fx:Declarations>

 </fx:Declarations>

在 Flex 3 中。

在聲明標簽中,您可以定義非可視標簽,如效果、服務標簽等。但 Flex 3 SDK 中沒有用於非可視標簽的確切標簽。

從根應用程序標簽開始。flex3 中不需要<fx:declaration>只需在根標簽內分配組件

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
    layout="vertical"
    backgroundColor="#000000"
    backgroundGradientAlphas="[0.0,0.0]"
    paddingTop="30"
    applicationComplete="init()"
    preloader="com.nickkuh.preload.Preloader"
    viewSourceURL="srcview/index.html">

    <mx:Script>
        <![CDATA[
            /*script area*/
        ]]>
    </mx:Script>

    <!-- your controls can define here -->

    <mx:Panel id="appPanel" visible="false" width="600" height="500" showEffect="{fadeIn}" />

</mx:Application>

空無一人。 舊版本的框架將假定任何非視覺元素都是“減速”。 添加了 decelerations 標記,以便可以在 spark 皮膚中使用 MXML 定義組件工廠。

編輯

但如果我沒記錯的話,他們確實需要在頂級 MXML 標記中使用 go。 雖然我可能是錯的......

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM