<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<![CDATA[
private function initializeHandler(event:Event):void {
statesService.getCountries.send( );
}
private function changeHandler(event:Event):void {
statesService.getStates.send( );
}
]]>
</mx:Script>
<mx:WebService id="statesService"
wsdl="http://www.rightactionscript.com/states/webservice/StatesServic
e.php?wsdl">
<mx:operation name="getCountries" />
<mx:operation name="getStates">
<mx:request>
<country>{country.value}</country>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:VBox>
<mx:ComboBox id="country"
dataProvider="{statesService.getCountries.lastResult}"
change="changeHandler(event)" />
<mx:ComboBox dataProvider="{statesService.getStates.lastResult}"
/>
</mx:VBox>
</mx:Application>