1

SharedObjectの値が設定されているかどうか (最初の起動)に応じて、フレックス アプリに表示される初期コンポーネントをロードしたいと考えています。どうすればそれを達成できますか?

4

1 に答える 1

2

簡単です:

<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"
               applicationComplete="onApplicationComplete()">
    <fx:Script>
        <![CDATA[
            private function onApplicationComplete():void
            {
                var so:SharedObject = SharedObject.getLocal('something');
                // add conditionals here
                    addElement(new SomeView());
            }
        ]]>
    </fx:Script>
</s:Application>

または州で:

<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"
               applicationComplete="onApplicationComplete()">
    <fx:Script>
        <![CDATA[
            private function onApplicationComplete():void
            {
                var so:SharedObject = SharedObject.getLocal('something');
                // add conditionals here
                    this.currentState = 'someview2';
            }
        ]]>
    </fx:Script>
    <s:states>
        </s:State name="someview" />
        </s:State name="someview2" />
        </s:State name="someview3" />
    </s:states>

    <local:SomeView includeIn="someview" width="100%" height="100%" />
    <local:SomeView2 includeIn="someview2" width="100%" height="100%" />
    <local:SomeView3 includeIn="someview3" width="100%" height="100%" />
</s:Application>
于 2011-05-26T17:22:10.367 に答える