<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
	<![CDATA[
		import mx.controls.Button;
		import mx.controls.Alert;
		import mx.collections.XMLListCollection;
		import mx.rpc.events.FaultEvent;
		import mx.rpc.events.ResultEvent;
		
		[Bindable]
		private var re:String=new String;
		public var querydata:XMLListCollection;
		public function init():void
		{
			HolidayTripWebService.getcountry();
		}
		public function getcon(event:ResultEvent):void
		{
			//if(event.result!=" ")
			//{
			var query:XML=new XML(event.result);
			//var querydata:XMLListCollection = new XMLListCollection(query.Table);
			querydata = new XMLListCollection(query.Country);
rp.dataProvider=querydata;			
			
		}
		public function fault(event:FaultEvent):void
		{
		}		
		public function Home():void
	{
		var url:URLRequest=new URLRequest("Home.html");
			navigateToURL(url,"_self");
	}
	
	public function Logout():void
	{
		var url:URLRequest=new URLRequest("Login.html");
			navigateToURL(url,"_self");
	}
	]]>
</mx:Script>

	<mx:WebService
		id="HolidayTripWebService" 
		wsdl="http://localhost:1042/HTWS/Service.asmx?wsdl"
		showBusyCursor="true" fault="mx.controls.Alert.show('Error loading WSDL', 'Webservice Error');" >
		<mx:operation name="getcountry" resultFormat="object" result="getcon(event)">
        </mx:operation>
        		
	</mx:WebService>

	<mx:VBox verticalGap="20" >
		<mx:RadioButtonGroup id="rdgroup"/>
			<mx:Repeater id="rp" >
				<mx:RadioButton id="radiobuttons" label="{rp.currentItem.CountryName}"/>			
			</mx:Repeater>
	</mx:VBox>       
	<mx:LinkButton x="661" y="28" label="Home" cornerRadius="20" themeColor="#ECF0F3" click="Home()"/>
	<mx:LinkButton x="763" y="28" label="Logout" themeColor="#ECF0F3" cornerRadius="20" click="Logout()"/>
	
</mx:Application>
