Flex TabNavigator页间跳转

protected function gotoCustomerDetails():void{
	//法一:通过循环遍历寻找,然后跳转
	for each (var childTab:VBox in tabNav.getChildren()){   
		if(childTab.label == "页面三"){//只是通过标签名字判断.如果一样就直接打开标签.   
			tabNav.selectedIndex = tabNav.getChildIndex(childTab);
		}   
	} 
	//法二:直接跳转
	tabNav.selectedIndex=2;
	
}
<mx:TabNavigator id="tabNav" styleName="TabNavigator" width="100%" height="100%" change="tabNav_changeHandler(event)">
	
	<!--页面一-->
	<mx:VBox label="页面一" width="100%" height="100%">
		<mx:ApplicationControlBar width="100%" styleName="topBar" height="35" paddingTop="5" paddingBottom="5">
			<mx:HBox cornerRadius="5">
				<mx:Label text="数据周期:" styleName="myLabel" fontSize="12"/>
				<calendar:MonthField id="predictMonth" styleName="myCalender" />
				<mx:Button label="查 询" width="66" height="24" styleName="myButton" click="searchClick()"/>
				<mx:Button label="接触偏好分析" width="106" height="24" styleName="myButton" click="gotoChannelPreferences()"/>
				<mx:Button label="客户明细查看" width="106" height="24" styleName="myButton" click="gotoCustomerDetails()"/>
			</mx:HBox>
		</mx:ApplicationControlBar>
		
	</mx:VBox>
	
	
	<!--页面二-->
	<mx:VBox label="页面二" width="100%" height="100%">
		<mx:ApplicationControlBar width="100%" styleName="topBar" height="35" paddingTop="5" paddingBottom="5">
			<mx:HBox cornerRadius="5">
				<mx:Label text="数据周期:" styleName="myLabel" fontSize="12"/>
				<calendar:MonthField id="actionMonth" styleName="myCalender" />
			</mx:HBox>
		</mx:ApplicationControlBar>
	</mx:VBox>
	
	
	<!--页面三-->
	<mx:VBox label="页面三" width="100%" height="100%">
		<mx:ApplicationControlBar width="100%" styleName="topBar" height="70" paddingTop="5" paddingBottom="5">
		</mx:ApplicationControlBar>
		
		
	</mx:VBox>
</mx:TabNavigator>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值