<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#BF5DC5, #010708]" xmlns:net="flash.net.*" creationComplete="show(event)">
<mx:Script>
	<![CDATA[
		import mx.utils.URLUtil;
		import mx.managers.BrowserManager;
		import mx.managers.IBrowserManager;
		import mx.controls.Alert;
		import mx.rpc.events.ResultEvent;
		
		
		private var bm:IBrowserManager;
		private var UName:String;
		private var CityId:String;
		
		public function show(e:Event):void
		{
			bm=BrowserManager.getInstance();
			bm.init("","Welcome");
			var o:Object=URLUtil.stringToObject(bm.fragment,"&");
			
			UName=o.UserName;
			CityId=o.CityId;
		}
		
		public function handleresult(event:ResultEvent):void
		{
			vd.source=event.result.toString();
			vd.play();
		}
		
		public function getvideo():void
		{
			myWebService.GetVideoPath(CityId);
		}
		public function Home():void
	{
		var url:URLRequest=new URLRequest("Booking.html#UserName="+UName+"&CityId="+CityId);
			navigateToURL(url,"_self");
	}
	
	public function Logout():void
	{
		var url:URLRequest=new URLRequest("Login.html");
			navigateToURL(url,"_self");
	}
	]]>
</mx:Script>

  
	<mx:VBox verticalAlign="middle" horizontalAlign="center" width="649" height="370">
	 <mx:HBox width="535">
	 	 <mx:VideoDisplay id="vd" width="227" height="208">
	 </mx:VideoDisplay>
	 <mx:VBox width="201">
	 	<mx:Button id="btn1" label="Display Vedio" width="125" height="23" fillAlphas="[1.0, 1.0]" fillColors="[#C54242, #CFB3B3]" cornerRadius="20" click="getvideo()"  >
	 </mx:Button>
	<mx:Button x="850" y="50" label="Booking" width="123" height="23" fillAlphas="[1.0, 1.0]" fillColors="[#C54242, #CFB3B3]" cornerRadius="20" click="Home()" />
	<mx:Button x="980" y="50" label="Logout" width="120" height="23" fillAlphas="[1.0, 1.0]" fillColors="[#C54242, #CFB3B3]" cornerRadius="20" click="Logout()" />
	
	 </mx:VBox>
	 </mx:HBox>
	 </mx:VBox>
	 
	 <mx:WebService 
		id="myWebService" 
		wsdl="http://localhost:50854/HTWS/Service.asmx?WSDL"
		showBusyCursor="true"
		fault="mx.controls.Alert.show('Error loading WSDL', 'Webservice Error');" >
        <mx:operation name="GetVideoPath" resultFormat="object" result="handleresult(event)">
        </mx:operation>
    </mx:WebService>
	
</mx:Application>
