Getting a key in the ActionScript Dictionary
Posted
by Rudy
on Stack Overflow
See other posts from Stack Overflow
or by Rudy
Published on 2010-05-28T19:28:34Z
Indexed on
2010/05/28
19:32 UTC
Read the original article
Hit count: 320
Hello,
I am using a Dictionary in ActionScript as a queue, sort of, still reading most of the time as an associative container, but I need one time to make a loop to run through the whole dictionary, such as for (var key:String in queue) . Inside this for loop I perform some actions on an element and then call delete on that key.
My issue is that I would like to wait for an Event before fetching the next element in this queue. Basically my for loop runs too fast. I would like to fetch the next key all the time, but I know there is no built in method.
A solution I thought is to add a break to the loop, as the for.. in will automatically fetch the next key, but it would be a loop which always executes one time, simply to fetch the next key. This sounds a bit counter intuitive.
I hope my problem makes sense and I really look for some better ideas than what I currently have. Thanks for your help!
Rudy
© Stack Overflow or respective owner