« Indy Flex is Back | Main | SWFAddress or URLKit »
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
| By Rich Tretola | December 13, 2008 | |
| 17,540 views |
Have you seen this error in your Flex 3 application when tabbing between components using the debug player?
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/getChildIndex()
at mx.core::Container/getChildIndex()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2407]
at mx.containers::Panel/getChildIndex()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\Panel.as:1032]
at fl.managers::FocusManager/getChildIndex()
at fl.managers::FocusManager/sortByDepth()
at Array$/_sort()
at Array/http://adobe.com/AS3/2006/builtin::sort()
at fl.managers::FocusManager/sortFocusableObjects()
at fl.managers::FocusManager/keyDownHandler()
I had this occurring in one of my apps that had hundreds of files and it took me hours to finally find out that the problem was a stupid little progress animation SWF that I had loaded into the app. The SWF was pretty old and probably compiled before AS3 was available. The error only occurs after an Alert or Popup window is launched and closed.
[kml_flashembed movie="http://www.everythingflex.com/flex3/2025Error/Bug.swf" height="212" width="200" /]
Try it out for yourself. Make sure you have the debug player installed and then tab between the TextInput’s. Now click Show Alert, then close the alert and try tabbing between the TextInputs again.
So, the solution, DON’T USE OLD AS2 SWFS IN YOUR AS3 APPS!
Topics: ActionScript 3, Flash Player, Flex | 9 Comments »









December 13th, 2008 at 3:53 pm
I’ve gotten this error when loading AS3 swfs that use the Flash components into a Flex app. The fl.managers.FocusManager class, which is causing the error, is part of the Flash component library.
The only solution I found for this issue was to monkey patch the FocusManager class so that it does not attach key event listeners to the stage.
Derek
Reply to this comment
Doug Schmidt Reply:
December 13th, 2008 at 8:24 pm
Derek, is this a generic solution? Once that can be submitted to the Flex SDK?
If so, submit it. Who knows, you can get t-shirt out the deal, just like I did.
Cheers,
Doug
Reply to this comment
Alex Reply:
April 10th, 2009 at 6:43 pm
Derek. Would you explain how you “monkey patched” the Focus Manager class.
Reply to this comment
Dana Reply:
August 5th, 2009 at 9:25 pm
Hi Derek
I’ve been pulling my hair out over this error for days.
How did you manage to monkey patch a Flash class?
Can you post some more details?
Reply to this comment
February 9th, 2009 at 6:56 am
Thanks alot for the solution!
Reply to this comment
February 9th, 2009 at 11:41 am
Has anyone submitted this bug to Adobe so they can fix it? We are having the same problem with AS3 .swf(s).
Thanks,
Reply to this comment
Vijay Reply:
July 23rd, 2010 at 5:56 am
Hi I am getting the following problem some times when press tab key. There is lot of swf’s are loading in a sinle swf and the current loaded swf having 4 checkboxes.
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/getChildIndex()
at fl.managers::FocusManager/getChildIndex()
at fl.managers::FocusManager/sortByDepth()
at Array$/_sort()
at Array/http://adobe.com/AS3/2006/builtin::sort()
at fl.managers::FocusManager/sortFocusableObjects()
at fl.managers::FocusManager/getNextFocusManagerComponent()
at fl.managers::FocusManager/setFocusToNextObject()
at fl.managers::FocusManager/keyFocusChangeHandler()
Reply to this comment
February 9th, 2009 at 11:42 am
Any feedback would be great!
Reply to this comment
May 21st, 2009 at 7:44 am
Have you tried to debug the display list itself to find exactly what sits there? Check http://play.blog2t.net/finding-the-missing-child/
Reply to this comment