I am trying to do something seemingly simple. Open a pop-up. Anyone else get this error?
var myTitleWindow = new TitleWindow();
myTitleWindow.title = "My Window Title";
myTitleWindow.width = 220;
myTitleWindow.height = 150;
PopUpManager.addPopUp(myTitleWindow, FlexGlobals.topLevelApplication as DisplayObject, true);
ArgumentError: Undefined state 'inactive'. at mx.core::UIComponent/getState() at mx.core::UIComponent/findCommonBaseState() at mx.core::UIComponent/commitCurrentState() at mx.core::UIComponent/commitProperties() at spark.components.supportClasses::GroupBase/commitProperties() at spark.components::Group/commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateClient() at mx.managers::PopUpManagerImpl/addPopUp() at mx.managers::PopUpManager$/addPopUp()
You can't use the top-level Application as the "parent" argument for a popup of a class (TitleWindow) that the top-level Application hasn't imported when creating the pop-up within a module. I am just going to use the module but if you REALLY need the application to be the parent, here is the super-lame work-around: Just add an instance of TitleWindow to the main application.
private var oneVeryLameWorkAroundForParentingPopup:TitleWindow;