/** * This file generated by AMFPHP 1.0 * You can get AMFPHP to generate code customized to your preferences * By modifying the /browser/templates/as2.tpl file */ import mx.remoting.*; import mx.rpc.*; import mx.utils.Delegate; import mx.remoting.debug.NetDebug; class StatesService { //Change the gateway URL as needed private var gatewayUrl:String = "http://www.rightactionscript.com/states/flashremoting/gateway.php"; private var service:Service; function StatesService() { NetDebug.initialize(); this.service = new Service(this.gatewayUrl, null, "StatesService"); } //get countries array function getCountries() { var pc:PendingCall = service.getCountries(); pc.responder = new RelayResponder(this, "handleGetCountries", "handleRemotingError"); } //get states array function getStates(country) { var pc:PendingCall = service.getStates(country); pc.responder = new RelayResponder(this, "handleGetStates", "handleRemotingError"); } function handleGetCountries(re:ResultEvent) { //Implement custom callback code } function handleGetStates(re:ResultEvent) { //Implement custom callback code } function handleRemotingError( fault:FaultEvent ):Void { NetDebug.trace({level:"None", message:"Error: " + fault.fault.faultstring }); } }