ahhh yes.... my apologies. I meant ResultEvent.RESULT. Here is a code
snippet from a class in my app that does this very thing. In this case
I have written AppService to extend HTTPService so I can add on some app
specific stuff that pertains to all of my services.
public function AppService(url:String, timeout:int)
{
super(url);
this.resultFormat="e4x";
this.requestTimeout = timeout;
this.addEventListener(FaultEvent.FAULT, handleFault);
this.addEventListener(ResultEvent.RESULT, handleResult);
this.url = url;
}
hth
Scott
Steve Hueners wrote:
Gives:
1119: Access of possibly undefined property RESULT through a
reference with static type Class.
am importing:
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
import mx.rpc.events.FaultEvent;
import mx.collections.XMLListCollection;
On 9/10/07, *Scott - FastLane* < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Steve -
I believe you intend to be adding the listener for the
Event.RESULT event instead of the Event.COMPLETE.
hth
Scott
Steve Hueners wrote:
All the samples i've come across so far show the mxml route - I'm
able
to instantiating and fireing the send correctly with:
public var myRequest:HTTPService = new HTTPService;
public var modules:XMLListCollection;
public function MenuItemEnum ( value:String, ordinal:int )
{
myRequest.url = "/xml/modules.xml";
myRequest.resultFormat="e4x"
myRequest.addEventListener(Event.COMPLETE, onResult)
myRequest.send(); //>>>>>> Is hit.
}
private function onResult(e:ResultEvent):void
{
modules = e.result as XMLListCollection;
}
private function onFault(e:FaultEvent):void
{
Alert.show(e.fault.message, "Could not load");
}
But the handlers never fire.