//主页面(应用) 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 略
Flex ViewStack页面跳转
最新推荐文章于 2017-06-13 21:36:44 发布