Stage.scaleMode = "noScale"; fscommand("showmenu",false); XML.prototype.ignoreWhite = true; var url_so:SharedObject = SharedObject.getLocal("debug"); var sendTextStr:String; var gbdata = new Object() gbdata.URL = new String() gbdata.params = new XML() gbdata.results = new XML() initStage(); function initStage () { _global.style.setStyle("themeColor", "haloBlue"); url_txt.text = "http://www.vika.com/ws/ws_general.php"; //url_txt.text = "http://ws.vika.cn/index.php"; //url_txt.color = "0x000080"; send_txt.text = ''; highlightSendTxt(); initSo(); txtStyle(); } function initSo () { if (url_so.data.debug == undefined) { debug = new Object(); debug.str = url_txt.text; url_so.data.debug = debug; url_txt.text = url_so.data.debug.str; } else { url_txt.text = url_so.data.debug.str; } } save_btn.onRelease = function() { url_so.data.debug.str = url_txt.text; } function txtStyle() { var obj_array = ["receive_txt", "send_highlight_txt","send_txt", "url_txt"]; for (var i in obj_array) { var obj = this[obj_array[i]]; obj.setStyle("borderStyle", "solid"); obj.setStyle("borderColor", "0xBABABA"); } } /* gbdata.addEventListener("result", function (evt) { var t = XMLHighlighter.highlight(evt.target.results); receive_txt.text = t; }); gbdata.addEventListener("status", function (stat) { if (stat.data.faultcode != undefined) { receive_txt.text = stat.data.faultcode+"\n"+stat.data.faultstring; } }); */ gbdata.trigger = function(){ this.results = new XML() this.params.sendAndLoad(this.URL,this.results) this.results.onLoad = function(succeed){ if(succeed){ var t = XMLHighlighter.highlight(this); receive_txt.text = t; }else{ var t = "读取失败" t = XMLHighlighter.highlight(t); receive_txt.text = t; } } } submit_btn.onRelease = function() { gbdata.URL = url_txt.text; //gbdata.params = new XML() gbdata.params = new XML(send_txt.html?sendTextStr:send_txt.text); gbdata.trigger(); }; resetSend_btn.onRelease = function() { send_txt.text = sendTextStr = "";}; resetReceive_btn.onRelease = function() { receive_txt.text = ""; }; //---------------------------------------------------------- // 发送文本区彩显 send_txt.onSetFocus = function () { send_txt.html = false; send_txt.text = sendTextStr; setSendTxtSbar(); } send_txt.onKillFocus = function (newfocus) { if(newfocus!=null) highlightSendTxt(); } send_txt.onChanged = function(){ sendTextStr = send_txt.text; setSendTxtSbar(); } function setSendTxtSbar () { send_txt_sbar._visible = send_txt.textHeight