Hi,
Enclosed is a simple example of a HTTPService.send. I set the
result, fault and xmlDecode properties in the call - however, they
do not appear to be called.
Could someone please shed light on what I am doing wrong.
Thanks.
------- startup.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns="*"
backgroundColor="white"
creationComplete="startupApp()">
<mx:Script>
<![CDATA[
function startupApp()
{
var handler:ServiceHandler = new
ServiceHandler(catalogRequest);
handler.getCatalog();
}
]]>
</mx:Script>
<mx:HTTPService id="catalogRequest" url="catalog.xml"
resultFormat="object" showBusyCursor="true"/>
<mx:Text text="This is a test" />
</mx:Application>
------- ServiceHandler.as
import mx.utils.Delegate;
class ServiceHandler
{
var service:mx.servicetags.HTTPService;
public function ServiceHandler
(service:mx.servicetags.HTTPService)
{
super();
this.service = service;
}
public function getCatalog()
{
var call = service.send();
// call.xmlDecode = Delegate.create( Object( this ),
this.onDecode )
call.result = Delegate.create( this, this.onResult )
call.fault = Delegate.create( this, this.onResult )
}
public function onResult( event : Object ) : Void
{
trace("onResult");
}
public function onFault( event : Object ) : Void
{
trace("onFault");
}
public function onDecode( node : XMLNode ) : Object
{
trace("onDecode");
return new Object();
}
}
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/