I'm trying to find a way to initialize a Dictionary inline in ActionScript 3, like:
private var sampleDic:Dictionary = new Dictionary (
{ "zero", "Hello" },
{ "one", "World" }
);
I tried many ways, but none works. Anyone knows if it's possible, and how?
Thanks
No, you can't do it. You have to construct a dictionary and then add the values in a loop or individually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With