Skip to content

Instantly share code, notes, and snippets.

@claus
Forked from wolframkriesing/gist:4353437
Last active December 10, 2015 00:49
Show Gist options
  • Save claus/4353850 to your computer and use it in GitHub Desktop.
Save claus/4353850 to your computer and use it in GitHub Desktop.
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