Re: [Flashcoders] Implementing GroupName for my own component

2006-04-22 Thread elibol
Here is some sturdy logic for grabing some siblings, in any case: function getSiblings(target:Object):Array { var i:Number = radioButtons.length, r:Array=[]; while(i--)if(radioButtons[i]!=target)r.push(radioButtons[i]); return r; } More likely, you will be doing something like this in your group

Re: [Flashcoders] Implementing GroupName for my own component

2006-04-21 Thread Julian 'Julik' Tarkhanov
On 21-apr-2006, at 23:49, elibol wrote: I think the best way to implement this would be to have a RadioGroup class that would instantiate through static functions of the RadioButton class. A static variable of the RadioGroup class would manage RadioGroup instances, it would add and remove

Re: [Flashcoders] Implementing GroupName for my own component

2006-04-21 Thread Michael Klishin
Julian 'Julik' Tarkhanov wrote: That is, if I have 5 instances of RadioCompnent inside a specific timeline, can I programmatically retrieve all of them? What I would do is to create a class with static methods only as groups manager so you just need to register RadioButton components within t

Re: [Flashcoders] Implementing GroupName for my own component

2006-04-21 Thread elibol
I think the best way to implement this would be to have a RadioGroup class that would instantiate through static functions of the RadioButton class. A static variable of the RadioGroup class would manage RadioGroup instances, it would add and remove RadioGroup instances through a static API. A stat

[Flashcoders] Implementing GroupName for my own component

2006-04-21 Thread Julian 'Julik' Tarkhanov
I would like to implement a radio-like component and provide a groupName for it (I don't use MM components because they do not fit my application). Is there a way to dynamically retrieve all siblings of the component's instance which have the same class (or subclass) of the component and