Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 17th, 2012  |  syntax: None  |  size: 1.29 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Flash Builder: Get the result of HTTPService request with AS3 in Flex Mobile App
  2. <fx:Declarations>
  3.         <s:HTTPService id="hsConfig"
  4.                        url="{IR_BASE_URL}/getconfig.json"
  5.                        result="onGetConfig(event)"
  6.                        fault="onGetConfigError(event)"
  7.                        method="POST"
  8.                        showBusyCursor="false"
  9.                        resultFormat="array"
  10.                        makeObjectsBindable="true"
  11.                        >
  12.  
  13.             <s:request xmlns="">
  14.                 <post1>Hello</post1>
  15.                 <post2>World</post2>
  16.             </s:request>
  17.  
  18.         </s:HTTPService>
  19.     </fx:Declarations>
  20.        
  21. protected function onGetConfig(e:ResultEvent):void
  22.             {
  23.                 //var adata:XMLList = XML.(e.result);
  24.                 var data:Object = e.result,
  25.                     oo : HTTPService = (e.currentTarget as HTTPService);
  26.  
  27.  
  28.                 trace( oo.lastResult );
  29.                 trace( e.result.lastResult );
  30.                 trace( data.cfg );
  31.                 trace( e.result.length );
  32.                 if( e.result.length )
  33.                 {
  34.                     trace( e.result[0].length );
  35. }
  36.  
  37. }
  38.        
  39. <?xml version="1.0" encoding="UTF-8"?>
  40. <cfg>
  41.     <param1>Hello</param1>
  42.     <param2>World</param2>
  43. </cfg>