nice class.

On Jan 10, 2008 12:45 PM, Jamie S <[EMAIL PROTECTED]> wrote:

>   Tracey
>
> I have written a class that does just that. It's very similar to the
> Enumerable module in Prototype or Ruby. It's part of my open source
> framework JumpShip http://www.osflash.org/jumpship or grab it here:
>
> http://svn1.cvsdude.com/osflash/jumpship/AS3/com/jsjstudios/jumpship/core/JSEnumerable.as
>
> Jamie
>
>
> On Jan 10, 2008 8:50 AM, tsiesser <[EMAIL PROTECTED]<tsiesser%40yahoo.com>>
> wrote:
> >
> >
> >
> >
> >
> >
> > Is it possible to write a collection class in AS3 that is directly
> > enumerable by a for-each statement? For example:
> >
> > var myCollection:MyCollection = new MyCollection();
> > myCollection.addItem("red");
> > myCollection.addItem("green");
> > myCollection.addItem("blue");
> > for each (var item:Object in myCollection)
> > {
> > // do stuff to item
> > }
> >
> > In other languages there's an IEnumerable interface that gets
> > implemented, but I'm not sure what to do in AS3...
> >
> > Thanks in advance for your help!
> >
> > --Tracey
> >
> >
>  
>



-- 
j:pn
\\no comment

Reply via email to