Mar
19

Implementation of the List Iterator in Flash

2 comments Posted by: Nahuel 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. Category: Flash |

2 Comments so far

Write yours
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...
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

Leave your comment

Comment etiquette: As a gesture to those subscribed to this post, please keep your comments relevant to the post.

Your email address will never be displayed.
Email is gravatar enabled.Gravatar are the pictures you see next to the comments. If you like to have one, visit gravatar



Allowed tags:

<code>
All other tags will be shown as such, when in doubt, use the preview.




Preview:

Refresh Preview
1. You wrote on