--- In flexcoders@yahoogroups.com, "Pat Buchanan" <[EMAIL PROTECTED]> wrote: > I'm experiencing runtime error # 2025 (The supplied DisplayObject must be a > child of the caller).
Hi there I am also experiencing the "The supplied DisplayObject must be a child of the caller" error and think I know whats causing it but cannot explain why its happening. Initially I got this error when casting a mouse-up event.target to an expected UIComponent that then got deleted. This did not work in the case when my dragged object moved onto something else, resulting in the event.target object being different to my expected UIComponent. I solved this by passing the expected UIComponent as an event argument. Enter problem II, here is the scenario: - draggable Image onto new position - if another Image exists at this position, remove it This works for the first occurance. But subsequent dragging and dropping images results in the error. My code is something like this: imageContainer.addChild(myImage) // imageContainer is a canvas . . . // sequence of drag drop image here, calls function updateViewArea ... // updateViewArea: if(removePiece) imageContainer.removeChild(myImage) When I do a trace of imageContainers children vs. myImage just before the exception, myImage is listed. When debugging and checking the values at UIComponent.$removeChild (just before the exception) the child looks like the correct Image and 'this' scope looks like the the correct Canvas. So I cannot understand why I am getting the error? ------------------------ Yahoo! Groups Sponsor --------------------~--> Yahoo! Groups gets a make over. See the new email design. http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/