Let’s check the following code first:

1
2
3
4
5
6
7
8
dict[btn1] = false;
dict[btn2] = false;
dict[btn3] = false;
for (var key:Object in dict)
{
dict[key] = true;
}

How many times do you think the loop would be entered in this case?

NOT only 3!

I run the codes in flash player 11.1, it sometimes was 4! Under flash player 11.5, I haven’t encountered any issue.

Comments

2012-12-21