云自無心水自閑

          天平山上白云泉,云自無心水自閑。何必奔沖山下去,更添波浪向人間!
          posts - 288, comments - 524, trackbacks - 0, articles - 6
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          用HttpService加載發送Xml數據

          Posted on 2006-03-01 01:18 云自無心水自閑 閱讀(581) 評論(0)  編輯  收藏 所屬分類: Flex

          I've been looking at sending and receiving data asyncronously using Flex's HTTPService and native Flash data loading capabilities.
          One thing that tripped me up with that xml.load() was an asyscronous data call -- which means you cannot use the result/return object until it is completly loaded. One way around this is to use the AS delegate to invoke a function which uses the result. Below is some code.

          http://www.macromedia.com/2003/mxml">

          function LoadRequest() {
            var myXML = new XML();
            myXML.ignoreWhite = true;
            myXML.load ("tree.xml");
            myXML.onLoad = mx.utils.Delegate.create(this, function() { myService.send(myXML) });
          }

          function ProcResult(event) {
            txtDebug.text = event.result;
          }

          function ProcFault(errorString, code) {
            txtIssuerList.text = errorString + " " + code ;
          }

          http://localhost:8700/flex/servlet/test.MyServletPrintln" contentType="application/xml" method="post" id="myService"
          fault="ProcFault(event.fault.faultstring, event.fault.faultcode)" result="ProcResult(event)">



          主站蜘蛛池模板: 游戏| 桑日县| 阳高县| 随州市| 靖州| 大厂| 开阳县| 海宁市| 安西县| 宁波市| 绵阳市| 屏山县| 三河市| 芦溪县| 隆安县| 鄢陵县| 普格县| 德保县| 大埔区| 寻甸| 葵青区| 泸定县| 林口县| 翁源县| 崇明县| 商都县| 乌鲁木齐市| 宜兰县| 宁南县| 缙云县| 乐都县| 潜江市| 平泉县| 泸溪县| 东乡| 鸡东县| 正阳县| 罗平县| 成安县| 新宁县| 惠东县|