I'm having trouble referencing data retrived via HTTPService
listener and ResultEvent.
The DataGrid i've plugged into the HTTPService works fine,
but i can't seem to access the individual variables inside the
lastResult object properly.
As you can see in the "checkUser_listener" function i'm
trying to acces the username variable, used fine in the dataGrid,
but i can't seem to get the syntax right. Any help would be much
appreciated. Cheers, Dr_ross
First, using addListener is ok, but mor complicated than
necessary. As you have it, there is no listener when the service is
called the first time, on creationComplete, and I am pretty sure it
is too late to have if after the send in the checkUser() function.
Instead just specify the handler in the HTTPService tag:
result="checkUser_listener(event)" (note the "event" arg, it
That takes care of that once and for all.
Second, specify resultFormat="e4x". I think the default is
mx:OBject and is harder to work with that xml.
Third, don't use lastResult in a handler, it is for binding
private function checkUser_listener(event:ResultEvent):void
var xmlResult:XML = XML(event.result);
Alert.show(xmlResult.toXMLString()); //you shuld see your