Yeah, that worked great... Thanks!
On 10/8/07, Sandeep Malik <[EMAIL PROTECTED]> wrote:
>
> Can you try something like this;
>
> private function search(clazz : Class, component : UIComponent): void {
> for(var i : int = 0; i < component.numChildren; i++) {
> var c : DisplayObject = component.getChildAt(i);
> if(c is clazz) doSomething();
> }
> }
>
> Regards,
> Sandeep
>
>
> --- In [email protected] <flexcoders%40yahoogroups.com>, "Claudia
> Barnal" <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > What is a good implementation of finding an instance of a
> > textfield/button or any other type within a component?
> >
> > Say for example I have a Button and want to get a hold of all the
> > instances of a textfield within it
> >
> > <mx:Button id="bananaButton" label="Banana" />
> >
> > Then I would like to do something like this:
> >
> > var textFields:Array = searchFor(TextField, bananaButton);
> >
> > this would give me an array of 1 with the reference to the button's
> "textField".
> >
> > I know a lot depends on the scope of the actual instance (if it's
> > private, protected, public, etc.), but what would the best
> > approximation or strategy be?
> >
> > Thanks,
> > Claudia
> >
>
>
>