I made an AS2.0 class that implements a similar interface to the Java List Iterator. This class is useful for going through every element in an Array, but without the famous i++ variable.
A nice use of this class is when you have a loop on an EnterFrame so that you don’t need to maintain the variable i across the frames but simply evaluate hasNext() and call next() if there are more elements.
If you want to know more about this Interface you can take a look in the
Sun site.
You can download the
source and an example.
You can
view the code in the browser.
darron
Cesar Tardaguila
I also implemented an iterator class as part of my hsahmap implementation.
You can view it here:
http://www.design-nation.net/en/archives/000151.php