I'm getting the same error as well. It seems (at least to me) to be reading the index range of the "rawChildren" property. Don't know if that's true or not but I just can't get it to work right.
--- In [email protected], Matt Wicks <[EMAIL PROTECTED]> wrote: > > I tried this - and its very strange > > > this line > > trace (container.getChildAt(container.numChildren-1).name ) > > works fine > > but this > container.swapChildrenAt(index,container.numChildren-1) > > gives me a "supplied index is out of range" error > > ??? > On 15 Mar 2007, at 15:21, Paul DeCoursey wrote: > > > try swapChildrenAt instead of swapChildren. > > > > --- In [email protected], Matt Wicks <matt@> wrote: > > > > > > does anyone have any idea why this doesn't work? > > > > > > passing in a displayObkectContainer (container) and the > > displayObject > > > I want to rise to the top (objectToMove) > > > > > > for (var i:int =0; i<container.numChildren; i++) { > > > if (container.getChildAt(i) == objectToMove) { > > > index=i > > > > > > } > > > } > > > if (index == container.numChildren) { > > > return //already at the top > > > } else { > > > container.swapChildren(container.getChildAt > > > (index),container.getChildAt(container.numChildren-1)) > > > } > > > > > > the odd thing is that I can get both container.getChildAt(index) and > > > getChildAt(container.numchildren-1) but > > > > > > I get an error on the swapchildren line saying that The supplied > > > DisplayObject must be a child of the caller. > > > > > > something odd going on ... suggestions appreciated > > > > > > > > > Matt > > > > > > > > > >

