I can’t seem to iterate through values of a Dictionary on Flash target, works fine on Windows target.
Map class doesn’t have this issue : I can iterate through keys and values with no problem on both targets so I’ll use that but thought I would post about the issue anyway
Here is sample code to reproduce the issue :
var dic:Dictionary<String, String> = new Dictionary<String, String>();
for (i in 0...3)
{
dic["key" + i] = "value" + i;
}
for (str in dic.iterator())
{
trace(str);
}
for (str in dic.each())
{
trace(str);
}
flash output :
Test.hx:117: key1
Test.hx:117: key0
Test.hx:117: key2
Test.hx:122: null
Test.hx:122: null
Test.hx:122: null
windows (c++) output :
Test.hx:117: key1
Test.hx:117: key2
Test.hx:117: key0
Test.hx:122: value1
Test.hx:122: value2
Test.hx:122: value0