繁体   English   中英

flex3中的LoadVars等效于什么?

[英]What's the equivalent for LoadVars in flex3?

    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");

在Flex 3中如何做以上工作?

UPDATE

如何使用URLLoader做到这一点?

使用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);

使用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);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM