Event.COMPLETE issue‏

I have the issue here. can someone help me plz???

getBarcodes();

function getBarcodes():void {

for (var reg:int = 0; reg<regionIDs.length; reg++) {
for (var vin:int = 0; vin<vineyardIDs.length; vin++) {

 var pagination_variables:URLVariables = new URLVariables();
 //  Build the varSend URL variable
 var pagination_varSend:URLRequest = new URLRequest("[[COLOR=#0068cf]http://localhost/cms_control.php[/COLOR]](http://localhost/cms_control.php)");

 pagination_varSend.method = URLRequestMethod.POST;
 pagination_varSend.data = pagination_variables;
 // Build the varLoader variable
 var pagination_varLoader:URLLoader = new URLLoader();
 
 pagination_varLoader.addEventListener(Event.COMPLETE, getData);
 pagination_variables.sendRequest = "get_pagination";
 pagination_variables.categoryNameID = categoryIDs[cat];
 pagination_variables.varietyID = varietyIDs[vari];
 pagination_variables.regionID = regionIDs[reg];
 pagination_variables.vineyardID = vineyardIDs[vin];
 pagination_varLoader.load(pagination_varSend);
}

}

getTheAmountofData();
}

it seems like flash does getTheAmountofData() function first, then does all the getData functions in the for loop. but what i need is to call all the getData functions first, push the datas into an Array, then call the getTheAmountofData() function. how can i do that?? Hope it make sense. Cheers.