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);
posted @ 2016-10-15 17:59  独裁者  阅读(116)  评论(0编辑  收藏  举报