Quote:
|
In other words, are the lines of code within a function executed procedurally, one after the other? Does Flex wait for the loop to complete before calling clear()?
|
Yes.
And in your first example I think clear only gets called after save is finished.
Here's an example of the single thread nature of AS3
ActionScript Code:
var status:Boolean;
private function one(forever:Boolean = true):void {
while(forever) {
three();
}
three();
}
private function two():Boolean {
if(status) {
return true;
} return false;
}
private function three():void {
status = true;
}
//... case 1
one(true);
trace(two());
//the trace is never called and the Flash Player freezes up.
//.. case 2
one(false);
trace(two());
//traces true.