I've made a nice little JSFiddle showcasing this:

http://jsfiddle.net/83KjH/

On Aug 13, 10:38 am, Thomas Aylott <[email protected]> wrote:
> myClass.instances.invoke(‘method’) ?
>
> — Tom Aylott – SubtleGradient – MooTools —
>
> On Aug 13, 2010, at 1:32 AM, reaktivo wrote:
>
>
>
> > This is nice, do you know if something like the following is possible?
>
> > myClass.all.method() //calls method() on each instance
>
> > On Jul 31, 2:53 am, Devign <[email protected]> wrote:
> >> Hi guys
>
> >> I wrote a Class Mutator to preserve class instances in an array, to
> >> have the ability to alter all of them or just for debugging (console
> >> etc.)http://devign.me/mootools-track-class-instances-with-the-trackinstanc...
>
> >> For example:
>
> >> var x=new MyClass();
> >> var y=new MyClass();
>
> >> MyClass.instances // [x, y]
> >> MyClass.instances.each(function (o) { o.reposition(); });

Reply via email to