Whoah, you’re at our level cap. Good job, you rock! Here, have some cake.
Community Get activity updates from around Kongregate.
Explore Kongregate & earn 10 kreds Here are your 10 free kreds Explore Kongregate & earn a trophy Here’s a shiny trophy for you 15%
Keep exploring Kongregate with more badges and games!
Hide the progress bar forever? Yes No
5 posts
Sign in to reply
Is it possible to use char or string indexes in arrays in as3? In the way that instead of:
array[0] = a; array[1] = b;
I could use:
array['a'] = a; array["str"] = b;
use Object type or Dictionary type for this.
Originally posted by vesperbot:use Object type or Dictionary type for this.
But also, it is perfectly possible with Arrays in AS3 as well, yes.
You can attach dynamic properties to any object like that. But if that’s what you’re trying to do, either use Object (i.e. var x:Object = {}), or if the properties are always going to be the same, write a class to encapsulate them.
var x:Object = {}
Thank you for replies. I thought there had to be more efficient way rather than searching through all array/sorting the array.
X
Loading