Flex ViewStack页面跳转
发布时间:2020-12-15 04:45:27 所属栏目:百科 来源:网络整理
导读://主页面(应用) Main.mxmlmx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:actionAnalyse="com.cmp.demo.actionAnalyse.*"mx:ViewStack id="pageViewStack" width="100%" height="100%"actionAnalyse:MarketingForecast id="idMarketingF
//主页面(应用) Main.mxml <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:actionAnalyse="com.cmp.demo.actionAnalyse.*"> <mx:ViewStack id="pageViewStack" width="100%" height="100%"> <actionAnalyse:MarketingForecast id="idMarketingForecast"/> <actionAnalyse:ChannelPreferences id="idChannelPreferences"/> <actionAnalyse:CustomerDetails id="idCustomerDetails"/> </mx:ViewStack> //子页面(组件) MarketingForecast.mxml import mx.core.Container; import mx.containers.ViewStack; private var v:ViewStack; //客户明细查看页面 protected function gotoCustomerDetails():void{ v = this.parent as ViewStack;//获取父窗体ViewStack对象 // v.selectedIndex=2;//法一:直接跳转到ViewStack下面的对应第3个组件页面去 v.selectedChild = Container(v.getChildByName("idChannelPreferences"));//法二:通过ViewStack下的组件id查找该组件,然后跳转到该组件页面去 } <mx:Button label="明细查看" width="106" height="24" styleName="myButton" click="gotoCustomerDetails()"/> //子页面(组件) ChannelPreferences.mxml 略 //子页面(组件) CustomerDetails.mxml 略 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |