PDA

View Full Version : The supplied DisplayObject must be a child of the caller?


thomen
09-27-2007, 09:35 AM
I've created a tilelist who's itemrenderer is a class called bead.. this bead class will also be implementing a drag/drop/rotate on the bead objects placed into the tilelist...

however on mouseover im getting the following error?? can anyone think of the problem i can't trace it through with breakpoints...



ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::Loader/flash.display:Loader::_load()
at flash.display::Loader/load()
at com.Beads::Bead/com.Beads:Bead::updateDisplayList()[C:\Users\Tom\Development\Flex\PasticheBraceletBuil der\com\Beads\Bead.as:201]
at mx.core::UIComponent/validateDisplayList()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UICompo nent.as:5760]
at mx.managers::LayoutManager/validateClient()[C:\dev\flex_201_gmc\sdk\frameworks\mx\managers\Lay outManager.as:858]
at mx.core::UIComponent/validateNow()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UICompo nent.as:5218]
at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::drawItem()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\lis tClasses\ListBase.as:3905]
at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::mouseOverHandler ()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\lis tClasses\ListBase.as:6855]
at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::mouseMoveHandler ()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\lis tClasses\ListBase.as:6975]

flexy
09-27-2007, 12:54 PM
I've seen this problem before when a call or reference is made to a DisplayObject that isn't actually a child of the component. This is often when the DisplayObject hasn't been added to the display list using addChild() or has been removed, but is still being referenced in your code.

Check your execution order to make sure you aren't trying to reference your DisplayObject before you've added it.