如何选择 Flex 应用程序的初始视图?

发布于 2024-11-10 08:59:50 字数 93 浏览 0 评论 0原文

我想加载一个要在我的 Flex 应用程序中显示的初始组件,具体取决于 SharedObject 中的值是否已设置(首次启动)。我该如何做到这一点?

I want to load an initial component to be displayed in my flex app, depending on whether a value in the SharedObject is set (first launch). How do I accomplish that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好多鱼好多余 2024-11-17 08:59:50

很简单:

<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>

Easy enough:

<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>

Or with States:

<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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文