I’m making a SWF portfolio which is working fine for the most part. But when the loader tries to addChild with a SWF that has colorpickers, I get this message, once for each color picker:
TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground() at fl.controls::BaseButton/fl.controls:BaseButton::draw() at fl.core::UIComponent/drawNow() at fl.controls::ColorPicker/fl.controls:ColorPicker::createSwatch() at fl.controls::ColorPicker/fl.controls:ColorPicker::drawSwatches() at fl.controls::ColorPicker/fl.controls:ColorPicker::drawPalette() at fl.controls::ColorPicker/fl.controls:ColorPicker::draw() at fl.core::UIComponent/::callLaterDispatcher()
In earlier versions of the portfolio, this wasn’t a problem and the SWF with color pickers loaded fine. So I’m convinced that it’s an issue with my current SWF and not the target SWF , but I can’t find the problem!
Thanks in advance. B
- Attended a Community Meetup
- Community Moderator
- Has been a member for 5-6 years
- United Kingdom
- Contributed a Tutorial to a Tuts+ Site
- Won a Competition
- Contributed a Blog Post
- Beta Tester
- Bought between 50 and 99 items
somewhere you’re trying to add a null value via “addChild(...)”
It DOES actually add the child though, that’s the strange part. But the color pickers on the target swf don’t work. If I click any of them, I get the same Error #2007 message.
And occasionally the swf loads with no errors, but the colorPickers aren’t there!!
Really bizarre. Any help is greatly appreciated.
All the other SWF ’s load fine. It’s just the swf that contains color pickers that has the error.
Make sure the color picker component is in the library of the parent Flash file as well.
An enormous THANK YOU ! That was killing me.
Epic , Thank you !! insert the color picker to the base SWF and Fixed
