troubleshooting Question

mx:ComboBox selected item on load

Avatar of stargateatlantis
stargateatlantis asked on
Apache Flex
5 Comments1 Solution4794 ViewsLast Modified:
Basically i have a XML file called countries.xml which contains the following XML code.  What I want to do is when the application runs CANADA is selected in the combo box.  

   <ctnry countryCode='0' label='Select Country' />
   <ctnry countryCode='CAN' label='Canada' />
   <ctnry countryCode='USA' label='United States' />
   <ctnry countryCode='UK' label='United Kingdom' />
   <ctnry countryCode='OTH' label='Other' />
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="" layout="absolute" creationComplete="initDash();">	
				var lstCounVal;		
		//int dash when load
		public function initDash():void
			//Close Event Country//
		public function handleCloseEventCountry(eventObj:Event):void 
			//Get Country value//
		public function countryinit():void
			   lstcountry.selectedItem = "{countires['CAD']}";
	<mx:ComboBox x="21" y="54" width="143" id="lstcountry" labelField="label" dataProvider="{sercountry.lastResult.countires.ctnry}" creationComplete="countryinit();"></mx:ComboBox>
  <mx:HTTPService id='sercountry' url='countires.xml' useProxy="false" method="POST">
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros