I want you to trace to check "aa" is intialized and getting values.
Thanks for your reply.....
In the above example the aa array was getting data ..............
but when i assign to hh array ,then the hh array was not contain data
Try this, way of intializing hh value. Because Flex follow asynchronous process of execution.
public function init():void
private function resultHandler(event:ResultEvent):void
var custresultdata:XMLList=new XMLList();
var labelsArray:Array /* of String */ = new Array(custresultdata.length);
var index : int = 0;
for each (var labelText:String in custresultdata)
labelsArray[index++] = labelText;
The sample code provided by the other poster indeed highlights the fact that in Flex, data communication is asynchronous. So never call send() and have some other code that expects the data to be there.
As the other poster showed, call functions, reassign data, etc. in the result handler for the data access method, in this case the result handler.
If this post helped you on this question, please mark it as such.
You have to do your assignment in the handler, and not after the call.