maasss18
11-12-2008, 10:30 AM
Hi! I have a question regarding database and sequence flow.
This is my code:
private function resultGetRelationships(event:ResultEvent):void{
testArea1._linkCollection.removeAll();
for each(var rShipId:int in ModelDbService2.getRelationships.lastResult){
var MDrShipID:ModelDb=new ModelDb();
MDrShipID.rShipID = rShipId;
ModelDbService.getRShipTest(MDrShipID); <---- getting result from database
trace("for each first");
}
testArea1.addChildrenLink(); <---- is a function.
}
When i run, this is what i get on the console:
for each first
aaa2 <------- this is trace in method testArea1.addChildrenLink();
aaa2 <------- this is trace in method testArea1.addChildrenLink();
linkCollection1 <------ this is trace in method ModelDbService.getRShipTest(MDrShipID);
The problem is now before it finish to do the database, it will already started doing the function. Is there any setting so that the sequence flow won't be effected.
This is my code:
private function resultGetRelationships(event:ResultEvent):void{
testArea1._linkCollection.removeAll();
for each(var rShipId:int in ModelDbService2.getRelationships.lastResult){
var MDrShipID:ModelDb=new ModelDb();
MDrShipID.rShipID = rShipId;
ModelDbService.getRShipTest(MDrShipID); <---- getting result from database
trace("for each first");
}
testArea1.addChildrenLink(); <---- is a function.
}
When i run, this is what i get on the console:
for each first
aaa2 <------- this is trace in method testArea1.addChildrenLink();
aaa2 <------- this is trace in method testArea1.addChildrenLink();
linkCollection1 <------ this is trace in method ModelDbService.getRShipTest(MDrShipID);
The problem is now before it finish to do the database, it will already started doing the function. Is there any setting so that the sequence flow won't be effected.