It depends on what the MXML looks like and whether you've added any other children dynamically. See if you can get that test case to show the problem.
Alex Harui Flex SDK Developer Adobe Systems Inc.<http://www.adobe.com/> Blog: http://blogs.adobe.com/aharui From: [email protected] [mailto:[email protected]] On Behalf Of jmfillman Sent: Wednesday, September 09, 2009 10:19 AM To: [email protected] Subject: [flexcoders] Re: The supplied DisplayObject must be a child of the caller Even though this.numChildren returns 7, this.removeChildAt(5) removes the correct child. It works, but I'm a bit confused. --- In [email protected]<mailto:flexcoders%40yahoogroups.com>, "jmfillman" <jmfill...@...> wrote: > > this.numChildren returns 7 > > Will work on a sample app to demonstrate. > > > --- In [email protected]<mailto:flexcoders%40yahoogroups.com>, Alex > Harui <aharui@> wrote: > > > > Maybe publish a full test case in 20 lines or so. What is this.numChildren? > > > > Alex Harui > > Flex SDK Developer > > Adobe Systems Inc.<http://www.adobe.com/> > > Blog: http://blogs.adobe.com/aharui > > > > From: [email protected]<mailto:flexcoders%40yahoogroups.com> > > [mailto:[email protected]<mailto:flexcoders%40yahoogroups.com>] On > > Behalf Of jmfillman > > Sent: Tuesday, September 08, 2009 10:11 PM > > To: [email protected]<mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] The supplied DisplayObject must be a child of the > > caller > > > > > > > > So I'm trying to remove a child from a canvas container. > > > > trace (this.getChildAt(6)); > > this.removeChild(this.getChildAt(6)); > > this.removeChildAt(6); > > > > The trace statement returns the path to the correct child, but when I try > > removeChild() or removeChildAt(), I get: > > > > The supplied DisplayObject must be a child of the caller > > at flash.display::DisplayObjectContainer/getChildIndex() > > > > Why??? > > >

