云自無心水自閑

          天平山上白云泉,云自無心水自閑。何必奔沖山下去,更添波浪向人間!
          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)">



          主站蜘蛛池模板: 奉节县| 黄浦区| 察雅县| 涟水县| 平和县| 漳州市| 阳城县| 武功县| 太仆寺旗| 策勒县| 涿州市| 上思县| 彰化市| 左权县| 西丰县| 当涂县| 新郑市| 利辛县| 苏州市| 平顶山市| 禹州市| 登封市| 高邑县| 台湾省| 麻江县| 通河县| 温宿县| 天峨县| 内乡县| 榆树市| 祁阳县| 东阳市| 古浪县| 平阴县| 聂荣县| 贵德县| 清水河县| 山丹县| 阜平县| 长治市| 利川市|