开发者

Flex 4 addPopUp throwing error: "ArgumentError: Undefined state 'inactive' "

I am trying to do something seemingly simple. Open a pop-up. Anyone else get this err开发者_如何学JAVAor?

 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;

http://forums.adobe.com/thread/713069

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜