0
根據來自Adobe Create and apply view states的此文檔是<s:State/>
的一個狀態對象。 如何在代碼隱藏的ActionScript類中創建視圖狀態?Flex4:如何在類中創建視圖狀態(代碼隱藏)
根據來自Adobe Create and apply view states的此文檔是<s:State/>
的一個狀態對象。 如何在代碼隱藏的ActionScript類中創建視圖狀態?Flex4:如何在類中創建視圖狀態(代碼隱藏)
我找到了一個簡單的解決方案,我不必使用皮膚結構來聲明狀態。我甚至沒有聲明擴展WindowedApplication的ApplicationClass中的狀態。 解決方法是:只聲明Main.MXML中的狀態,並且用正確的名稱空間來聲明所有的狀態,在我的情況下它應該是「custom」。 這裏是Main.MXML:
<?xml version="1.0" encoding="utf-8"?>
<custom:ApplicationClass xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:custom="components.*">
<custom:states>
<s:State name="loginState"/>
<s:State name="infoState"/>
</custom:states>
<s:Panel id="loginPanel" title="Login" includeIn="loginState" />
</custom:ApplicationClass>
我只想不同小組之間變化,所以這種方法很適合我。當然還有其他一些情況,在這些情況下需要在剝皮時聲明這些州。 我已經從此鏈接獲得此解決方案:Error: Could not resolve to a component implementation.
Actionscript沒有代碼隱藏。您的MXML和AS3代碼位於不同的類中。 – Brian
AS類是後面的代碼。 –
這不是代碼背後。這是一個單獨的課程。 – Brian