
Untitled
By: a guest on
Jul 17th, 2012 | syntax:
None | size: 1.29 KB | hits: 9 | expires: Never
Flash Builder: Get the result of HTTPService request with AS3 in Flex Mobile App
<fx:Declarations>
<s:HTTPService id="hsConfig"
url="{IR_BASE_URL}/getconfig.json"
result="onGetConfig(event)"
fault="onGetConfigError(event)"
method="POST"
showBusyCursor="false"
resultFormat="array"
makeObjectsBindable="true"
>
<s:request xmlns="">
<post1>Hello</post1>
<post2>World</post2>
</s:request>
</s:HTTPService>
</fx:Declarations>
protected function onGetConfig(e:ResultEvent):void
{
//var adata:XMLList = XML.(e.result);
var data:Object = e.result,
oo : HTTPService = (e.currentTarget as HTTPService);
trace( oo.lastResult );
trace( e.result.lastResult );
trace( data.cfg );
trace( e.result.length );
if( e.result.length )
{
trace( e.result[0].length );
}
}
<?xml version="1.0" encoding="UTF-8"?>
<cfg>
<param1>Hello</param1>
<param2>World</param2>
</cfg>