Flex Mobile调用函数在另一个视图Navigator中?

时间:2013-06-29 13:12:48

标签: flex view flex-mobile

我正在尝试从另一个viewNavigator中存在的一个viewNavigator调用一个函数。我试过的代码如下,视图如下:

Main.mxml

<s:SplitViewNavigator id="svn" width="100%" height="100%" autoHideFirstViewNavigator="true">
        <s:ViewNavigator id="leftNav" width="310" height="100%" firstView="general_views.NewListView"/>
        <s:ViewNavigator id="rightNav" width="100%" height="100%" firstView="views.Login">
            <s:actionContent.portrait>
            <s:Button id="listButton" label="Menu" fontSize="15" click="svn.showFirstViewNavigatorInPopUp(listButton)"/>
            </s:actionContent.portrait>         
        </s:ViewNavigator>
    </s:SplitViewNavigator>

First View的功能:

public function stopTimer():void {

                if(myTimer != null)
                {
                    myTimer.stop();
                    secList.selectedIndex = 240;
                }           
            }

第二个视图的功能:

protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
            {

                FlexGlobals.topLevelApplication.leftNav.stopTimer();

            }

你能不能告诉我我做错了什么,因为我只想在一个左侧viewNavigator中停止一个定时器,当一个视图加载到右侧viewNavigator中时

提前致谢

0 个答案:

没有答案