Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Initialize Dictionary inline in AS3

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

like image 983
Daniele Avatar asked Jul 26 '12 21:07

Daniele


1 Answers

No, you can't do it. You have to construct a dictionary and then add the values in a loop or individually.

like image 131
Peter Hall Avatar answered Oct 09 '22 21:10

Peter Hall