<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="removeChild(can2);removeChild(can3);">
	<mx:Script>
		<![CDATA[
			import mx.controls.Alert;
			private var logined:Boolean = false;
			private function doLogin():void {
				if (!logined) {
					logined = true;
					tab.removeChild(can1);
					tab.addChild(can2);
					tab.addChild(can3);
				}
			}
			private function doLogout():void {
				logined = false;
				tab.addChild(can1);
				tab.removeChild(can2);
				tab.removeChild(can3);
			}
		]]>
	</mx:Script>
	<mx:TabNavigator id="tab" x="0" y="0" width="100%" height="100%">
		<mx:Canvas id="can1" label="Login" width="100%" height="100%">
			<mx:Button label="Login" click="doLogin()" />
		</mx:Canvas>
	</mx:TabNavigator>
	<mx:Canvas id="can2" label="Summary" width="100%" height="100%">
		<mx:Button label="Summary" click="Alert.show('Summary')" />
	</mx:Canvas>
	<mx:Canvas id="can3" label="Logout" width="100%" height="100%">
		<mx:Button label="Logout" click="doLogout()" />
	</mx:Canvas>			
</mx:Application>
