There are also UIComponents that must have children added at specific places. I can't remember what these components are off-hand but I did run into this same kind of problem with a window control bar that had to be added as the last child. If another child was added after it, then I got a range error.
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote: > > The number of children in a container is virtualized so if you've fooled > it somehow, it will use the wrong index. You'll have to figure out how > it got fooled > > > > ________________________________ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of Maciek Sakrejda > Sent: Monday, June 02, 2008 7:24 PM > To: flexcoders > Subject: [flexcoders] addChild() (not addChildAt) throws RangeError: > Error #2006: Thesupplied index is out of bounds > > > > The stack trace follows. > > I'm curious as to how addChild() can be throwing a range error, when > it's clearly determining the range itself. Is it that the component is > somehow not ready to accept children or something? > > Thanks, > Maciek Sakrejda > > Stacktrace:RangeError: Error #2006: The supplied index is out of bounds. > at flash.display::DisplayObjectContainer/addChildAt() > at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal:: > <http://www.adobe.com/2006/flex/mx/internal::> > $addChildAt()[E:\dev\flex_201_borneo\sdk\frameworks\mx\core > \UIComponent.as:4680] > at mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks > \mx\core\Container.as:2278] > at mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx > \core\Container.as:2214] > at > com.truviso.application.ui.visualization.visualizer::Visualizer/com.truv > iso.application.ui.visualization.visualizer:Visualizer::initButtonBar()[ > /home/maciek/svn/scripts/packaging/trunk/build/blank/xdeps/application/W > EB-INF/flex/user_classes/com/truviso/application/ui/visualization/visual > izer/Visualizer.as:405] > at > com.truviso.application.ui.visualization.visualizer::Visualizer/postInit > ()[/home/maciek/svn/scripts/packaging/trunk/build/blank/xdeps/applicatio > n/WEB-INF/flex/user_classes/com/truviso/application/ui/visualization/vis > ualizer/Visualizer.as:168] > at > com.truviso.application.ui.visualization::VisualizationController/launch > VisualizationWithParamValues()[/home/maciek/svn/scripts/packaging/trunk/ > build/blank/xdeps/application/WEB-INF/flex/user_classes/com/truviso/appl > ication/ui/visualization/VisualizationController.as:383] > at > com.truviso.application.ui.visualization.visualizer::Visualizer/openDril > ldown()[/home/maciek/svn/scripts/packaging/trunk/build/blank/xdeps/appli > cation/WEB-INF/flex/user_classes/com/truviso/application/ui/visualizatio > n/visualizer/Visualizer.as:613] >