开发者

What's the equivalent for LoadVars in flex3?

开发者 https://www.devze.com 2023-01-30 06:33 出处:网络
var lv = new LoadVars(); var r = new LoadVars(); lv.action = \"update\"; r.onLoad = function(success) { //do further logic here
    var lv = new LoadVars();
    var r = new LoadVars();
    lv.action = "update";
            r.onLoad = function(success) 
    {
                //do further logic here
            }
    lv.sendAndLoad("http://example.net/service.php", r, "POST");

How to do the above in flex 开发者_如何学运维3?

UPDATE

How to do it with URLLoader ??


WITH HTTPService

var vo:Object = new Object;
    vo.action = "update";
    s = new HTTPService();
    s.url = "http://example.net/service.php"
    s.method = "POST";
    s.resultFormat = "e4x"; //or xml or whatever
    s.send(vo);
    s.addEventListener(ResultEvent.RESULT,onLoad);

WITH URLLoader

var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("url here");
var vars:URLVariables = new URLVariables();     
vars.action = "update";
request.data = vars;
request.method = URLRequestMethod.POST;
loader.load(request);
loader.addEventListener(Event.COMPLETE,onComplete);
0

精彩评论

暂无评论...
验证码 换一张
取 消