?? proxyfunction.as
字號(hào):
?import mx.events.EventDispatcher;
dynamic class XMLRPC.ProxyFunction {
private var res:XML;
private var req:XML;
private var url:String;
private var unmarshaller:XMLRPC.Unmarshaller;
public function ProxyFunction(fn_name:String, fn_params:Array, url:String) {
EventDispatcher.initialize(this);
//create XML objects to hold the request and the response
this.req = new XMLRPC.Marshaller().ASToXML(fn_name, fn_params);
this.res = new XML();
this.res.ignoreWhite = true;
//store the URL
this.url = url;
//create one unmarshaller for now
this.unmarshaller = new XMLRPC.Unmarshaller();
//register the callback function if it exists
var self = this;
this.res.onLoad = function (success:Boolean) {
var o = new Object();
o.type = "On"+fn_name;
//unmarshal the result
if(success) {
o.target = self.unmarshaller.XMLToAS(self.res);
}
// or indicate a problem connecting with the server
else {
var r = new XMLRPC.Result();
r.Fault = {code: 2, description: "Could not connect to server"}
o.target = r;
}
self.dispatchEvent(o);
};
}
public function Execute() {
//send a request and wait for a response
this.req.sendAndLoad(this.url, this.res);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -