I am working on a AS3/Flash game and we are running into an issue when we load our home page swf into our login swf after someone successfully logs in.
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/addChildAt()
at fl.controls::BaseButton/drawBackground()
at fl.controls::LabelButton/draw()
at fl.controls::Button/draw()
at fl.core::UIComponent/drawNow()
at fl.controls::List/drawList()
at fl.controls::List/draw()
at fl.core::UIComponent/callLaterDispatcher()
We are developing in Flash Builder, importing a .swc with the artwork and components into our project. We load our homepage swf and add it as a display object like this:
private function LoadComplete(e:Event):void
{
//trace("LoadComplete");
m_loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, LoadProgress);
m_homePage = e.target.content as DisplayObject;
}
Adding it:
addChild(m_homePage as DisplayObject);
Is there a better way to load a swf into another swf? Why would we be getting errors when loading the homepage swf through our login swf but not when we are debugging the home page separately?
Any advice would be very helpful.