I follow the wizard to create a http service to connect to a php script. The script fetches some random record from the database.
The label definition is:
<s:Label id="label2" x="556" y="136" width="75" height="71"
creationComplete="label2_creationCompleteHandler(event)"
text="{GetQstResult2.lastResult}"/>
protected function label2_creationCompleteHandler(event:FlexEvent):void
{
GetQstResult2.token = qst.GetQst();
}
The result is formatted with the wizard into an array, but i don’t known how to access the values. Now, when i run the app it shows [object Question].
*Edit1:
<qst:Qst id="qst"
fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
showBusyCursor="true"/>
<s:CallResponder id="GetQstResult2"/>
The reason you see [object Question] is most likely because your lastResult is an instance of a question object, but the object did not implement a toString() method, so it is using the default toString() method defined somewhere in it’s object hierarchy–most likely the Object class.
You can define a toString() method in the Question class. Or you can set the text of your label in a result handler related to the remote call. I prefer the second approach. In the result handler, do something like this: