Generally, not without seeing some code. A couple of thoughts...
addChild assumes "this". What is "this" at the time of the call? addChild counts the number of display children and does an addChildAt(count + 1). If you do a this.getAllChildren(), how many elements are in the array? What are the elements are in the array? Debug before the line. Is model.panel instantiated at this point? --- In flexcoders@yahoogroups.com, sony antony <pow_like_me...@...> wrote: > > Hey.. > I have created a global instance of a Container - Panel, and tried adding it > to one of the files in my application as addChild(model.panel); > here model is the instance of a singleton class in which i create global > variables and panel is such a variable. > but this addChild(model.panel) throws exception > RangeError: Error #2006: The supplied index is out of bounds. at > flash.display::DisplayObjectContainer/addChildAt() at > mx.core::Container/addChildAt()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\Container.as:2206] > at > mx.core::Container/addChild()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\Container.as:2140] > at > rarf.views::ProjectSummaryDetailsView/ShowCalendar1()[D:\Invision\Works\RARFClient\src\rarf\views\ProjectSummaryDetailsView.mxml:1058] > at > rarf.views::ProjectSummaryDetailsView/__appDeadlineCalIcon_click()[D:\Invision\Works\RARFClient\src\rarf\views\ProjectSummaryDetailsView.mxml:1328] > > Can anybody help me on this.. ?? > > Regards... > Sony > > > Check out the all-new Messenger 9.0! Go to > http://in.messenger.yahoo.com/ >