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
-~----------~----~----~----~------~----~------~--~---