Just some quick information on something I found today. When loading multiple SWFs into a main SWF there are some important issues to consider, especially with library assets.
A breakdown of my situation: I had had a textfield on the main stage of my main movie. I was loading a menu into a loader object in the main movie. In the menu SWF a ComboBox component was added to the stage via ActionScript 3.0. When the ComboBox changes some text is added to the textfield. This all worked perfectly.
When I changed the textfield to a TextArea component I received this error in the output panel:
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::ScrollBar/fl.controls:ScrollBar::draw()
at fl.controls::UIScrollBar/fl.controls:UIScrollBar::draw()
at fl.core::UIComponent/drawNow()
at fl.controls::TextArea/fl.controls:TextArea::updateScrollBars()
at fl.controls::TextArea/fl.controls:TextArea::drawLayout()
at fl.controls::TextArea/fl.controls:TextArea::draw()
at fl.core::UIComponent/::callLaterDispatcher()
So, why did this happen?
Originally, I was attaching a ComboBox which was stored in the Menu’s library. The main movie’s SWF was empty so the loaded asset was looking for a component in the library of the main movie. When there was nothing there it looked in the menu’s library and found the ComboBox. But, when I added the TextArea component to the library of the main movie, that library became the main asset holder ( Not sure about the terminology ). So, any asset being accessed via a library now came from the main movie’s library. When I added a ComboBox to the main library, the problem was solved.
If there are any exceptions to this, or anyone has a different story. Please leave a comment. Thanks.
2 Comments
permalink | 11.6.2008 a las 5:32 am:
Thanks for the explaination - that problem was bugging me for a while!