Our Blog

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.
Nahuel Foronda

Nahuel Foronda

2 Comments

  1. darron
    Nice work! I'm sincerely hoping the next version of Flash comes with a better class library. It seems like, as a community, we're always porting Java functionality to AS2 to aid us in our development efforts...
  2. Cesar Tardaguila
    Congrats!

    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