首页 > 代码库 > as2 loadvars

as2 loadvars

var submitListener:Object = new Object(); 
submitListener.click = function(evt:Object) { 
    var result_lv:LoadVars = new LoadVars(); 
    var send_lv:LoadVars = new LoadVars(); 
    send_lv.userName = name_ti.text; 
    send_lv.msg = msg_ta.text; 
    send_lv.sendAndLoad("http://www.riafan.com/service/echo.asp", result_lv, "POST"); 
    result_lv.onLoad = function(success:Boolean) { 
        if (success) { 
            result_ta.text = result_lv.resultVar; 
        } else { 
            result_ta.text = "连接到服务器失败"; 
        } 
    } 
send_btn.addEventListener("click", submitListener);

as2 loadvars