-
-
Save claus/4353850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flash.utils.Dictionary; | |
var key; | |
var dict = new Dictionary(); | |
dict['0'] = true; | |
dict['1'] = true; | |
dict['2'] = true; | |
dict['3'] = true; | |
dict['4'] = true; | |
var count:int = 3; | |
for (key in dict) { | |
trace('key = ' + key); | |
if (count-- == 0) { | |
trace("hello"); | |
dict['0'] = "hello0"; | |
dict['1'] = "hello1"; | |
dict['2'] = "hello2"; | |
dict['3'] = "hello3"; | |
} | |
delete dict[key]; | |
} | |
trace('-----------') | |
for (key in dict) { | |
trace('key = ' + key, dict[key]); | |
} | |
// key = 0 | |
// key = 1 | |
// key = 2 | |
// key = 3 | |
// hello | |
// key = 4 | |
// ----------- | |
// key = 0 hello0 | |
// key = 1 hello1 | |
// key = 2 hello2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment