Cant you use removeAllChildren()? Regards, Sandeep
--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote: > > I'd keep an array of labels. > > > > But you can search as well by testing if getChildAt(i) is Label > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of donvoltz > Sent: Tuesday, September 18, 2007 10:21 AM > To: [email protected] > Subject: [flexcoders] Removing children when they have no id > > > > Hi everyone, > > I am using the following code to dynamically add a number of labels to > a panal. > > for each (var item:XML in dataStream){ > var someLabel:Label = new Label(); > someLabel.text = item..title; > addChild(someLabel); > } > > This works well, however, I am now up against a problem. Each of these > labels does not have an id so I have no way to access them individually. > > What I need to do is remove all of the labels when a user clicks a > button, however, I can not use removeChild() since I do not have an id > to each label, and infact, may not even know programatically how many > labels are in the panal since it depends on what was returned from a > database. > > Any help on how I can "reset" this panal by removing the labels when a > button click event occurs would be appreciated > > Thanks > > Don >

