开发者

What's the difference between send() and sendAndLoad() in flash?

Quoted from this page:

send(url: String, target: String, [method: String])

Sends the variables in the my_lv object to the specified URL.

sendAndLoad(url: String, target: Object, [method: String])

Posts variables in the my_lv object to the specified URL.

I don't see any differe开发者_运维百科nce there...


sendAndLoad will put received variables (if output from server is like "&a=3&b=9") to object specified as second argument. AFAIK specified object should be type of LoadVars().

For example:

var result_lv:LoadVars = new LoadVars();
var send_lv:LoadVars = new LoadVars();

send_lv.sendAndLoad(  ...url... , result_lv , "POST");


result_lv.onLoad = function(success:Boolean) 
{
if (success) 
{
... retreive received variables here from result_lv

I don't know why i can't put comments. It's asynchronous, onLoad function will just be called after response from server

...url... it's just url like "http://mydomain.com/myfile.php"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜