<?xml version="1.0" encoding="utf-8"?>  
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
    width="650" height="100%" viewSourceURL="srcview/index.html"> 
    
    <mx:Style source="main.css"/>
    
    <mx:Script>  
        <![CDATA[

            [Bindable]
            private var userName:String;

            [Bindable]
            private var roomName:String;

            private function joinRoom():void
            {
                userName = connectPanel.userName;
                roomName = connectPanel.roomName;
                vs.selectedIndex = 1;
            }
             
        ]]>  
    </mx:Script>  

    <mx:ViewStack id="vs" width="100%" height="100%">
        <ConnectPanel id="connectPanel" joinRoom="joinRoom()"/>
        <mx:VBox width="100%" height="100%">
            <MapArea id="mapArea" userName="{userName}" roomName="{roomName}" height="500"/>
            <ChatPanel id="chatPanel" height="100%" userName="{userName}" roomName="{roomName}"/>
        </mx:VBox>    
    </mx:ViewStack>    

</mx:Application>