Flex 4 addPopUp 抛出错误:"ArgumentError: Undefined state 'inactive' "



我想做一些看似简单的事情。打开弹出窗口。还有人看到这个错误吗?

 var myTitleWindow = new TitleWindow();
        myTitleWindow.title = "My Window Title";
        myTitleWindow.width = 220;
        myTitleWindow.height = 150;
        PopUpManager.addPopUp(myTitleWindow, FlexGlobals.topLevelApplication as DisplayObject, true);

ArgumentError:未定义状态'inactive'。在mx.core:: UIComponent/getState ()在mx.core: UIComponent/findCommonBaseState ()在mx.core: UIComponent/commitCurrentState ()在mx.core: UIComponent/commitProperties ()在spark.components.supportClasses: GroupBase/commitProperties ()在spark.components:集团/commitProperties ()在mx.core: UIComponent/validateProperties ()在mx.managers: LayoutManager/validateClient ()在mx.managers: PopUpManagerImpl/addPopUp ()在mx.managers: PopUpManager美元/addPopUp ()

当在模块中创建弹出窗口时,顶层应用程序不能将顶层应用程序作为未导入的类(TitleWindow)的弹出窗口的"父"参数。我只是要使用的模块,但如果你真的需要应用程序的父,这里有一个超级蹩脚的解决方案:只需添加一个实例的TitleWindow的主应用程序。

private var oneVeryLameWorkAroundForParentingPopup:TitleWindow;
http://forums.adobe.com/thread/713069

相关内容

最新更新