Hi, you will never get any reply like that...
First please share you url xml with us. it is not clear what you want to show in the _result variable. The second thing you are sending the information in the _param to the server and server is returning you an xml. you are putthing the result of that xml into a string, that is your first error. now if you xml containing only one node like <result>Shaleen</result> than it will give you "Shaleen" in the alert box. if you pass the myXML itself in the alert box if you have xml then you need to parse them in the a xmllistcollection to get a value at any particular location in the xml. If you want to show the value passed in the register_customer(), then you need to get items in xml/xmllist/xmllistcollection as the case may be. Thanks, Shaleen Jain On Jan 1, 5:27 pm, caydauxanh <[email protected]> wrote: > I'm writing my class: > package database > { > import mx.rpc.events.ResultEvent; > import mx.rpc.http.HTTPService; > > public class db_request > { > private var _service:HTTPService; > private var _params:Object; > private var _result:String; > private var _xml_result:XML; > > public function db_request() > { > _service = new HTTPService; > _service.url = "http://localhost/backend/"; > _service.method = "POST"; > _service.resultFormat = "xml"; > _params = new Object; > } > > public function getResult():String > { > return _result; > } > > private function > register_customer_Result(event:ResultEvent):void > { > var myXML:XML = new XML(event.result); > _result = myXML.result; > import mx.controls.Alert; > Alert.show(_result); // This show what I need > } > > public function register_customer > (email:String,password:String,name:String,phone:String,address:String):void > { > _params['function'] = "register_customer"; > _params['email'] = email; > _params['password'] = password; > _params['name'] = name; > _params['phone'] = phone; > _params['address'] = address; > _service.addEventListener(ResultEvent.RESULT, > register_customer_Result); > _service.send(_params); > } > > } > > } > > And my application's code to show _result variable > private function DoClick():void > { > var mysc:db_request = new db_request(); > mysc.register_customer > ("[email protected]","thetruth","mrdeen","1231232130","address"); > Alert.show(mysc.getResult()); > } > > It shows empty :((, Totally, I think that at the > register_customer_Result function, it can not set value for variable > _result. > Any body help me? > Thank you very much ! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

