View Full Version : Strange FOR loops behavior
10basetom
12-28-2006, 06:41 AM
Hello,
Given this code...
for (var i:uint = 0; i < 10; i++)
{
Alert.show(i.toString());
}
The alert box counts down from 9 -- shouldn't it start counting up from 0?? Why does it appear that loops are going in reverse?
Thanks,
Tom
CDHBookingEdge
12-28-2006, 12:58 PM
Are you basing that on the fact that the first alert you see on your screen says "9"? That's because the alert boxes come all on top of each other. So essentially the first alert box you see is the last one that came up.
Hope that makes sense. It's early morning not enough coffee yet LOL.
Christopher
10basetom
12-28-2006, 10:23 PM
DOH! I'm so used to JavaScript's modal alert dialogs that I never considered Flash's alerts to be non-modal and non-casacading, resulting in what "appeared" to be counting down the loop in reverse.
Thanks, Christopher.
Tom
Are you basing that on the fact that the first alert you see on your screen says "9"? That's because the alert boxes come all on top of each other. So essentially the first alert box you see is the last one that came up.
Hope that makes sense. It's early morning not enough coffee yet LOL.
Christopher
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.