Children renumber after one is removed
 
0 = childA
1 = childB
2 = childC
 
After removeChildAt(0)
 
0 = childB
1 = childC
 
Look at the code for removeAllChildren.
 
It will either removeChildAt(0) j times or iterate backwards.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Nate Pearson
Sent: Tuesday, March 27, 2007 5:22 PM
To: [email protected]
Subject: [flexcoders] Scaling Custom Components



I have a custom component that adds multiple shapes during
UpdateDisplayList. When I scale the browser it calls update display
list and draws over all of my shapes.

I have tried:

j = this.numChildren;
for (i=0; i<j; i++){
this.removeChildAt(i);
}

Before I write redraw my shapes in UpdateDisplayList. I always get an
outofbounds error after i exceed numAutomationChildren(?). If i try
the same loop with numAutomationChildren nothing disappears.

It won't let me call this.removeAllChildren (i think because I'm
extending an UIComponent and not a Container)! Isnt there a way for
me to get all those shapes outta there?

Maybe I'm taking the wrong approach.

Thanks in advance,

Nate



 

Reply via email to