Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 在Flex4中的弹出窗口(由PopUpManager调用)上放置一个自定义组件_Actionscript 3_Apache Flex_Popup_Custom Component - Fatal编程技术网

Actionscript 3 在Flex4中的弹出窗口(由PopUpManager调用)上放置一个自定义组件

Actionscript 3 在Flex4中的弹出窗口(由PopUpManager调用)上放置一个自定义组件,actionscript-3,apache-flex,popup,custom-component,Actionscript 3,Apache Flex,Popup,Custom Component,如何在PopUpManager创建的弹出窗口上显示自定义组件(在应用程序级别声明) 在应用程序mxml中,我有以下几段代码: private var myCustomComp:CustomComp = new CustomComp; /** Called on by an event listener **/ protected function showCustomComp(event:MyEvent):void { myCustomComp.visible = true; //

如何在PopUpManager创建的弹出窗口上显示自定义组件(在应用程序级别声明)

在应用程序mxml中,我有以下几段代码:

private var myCustomComp:CustomComp = new CustomComp;

/** Called on by an event listener **/
protected function showCustomComp(event:MyEvent):void 
{
  myCustomComp.visible = true; 
  // place PopUpManager windows 
  this.setElementIndex(virtualKeyboard,this.numElements-1); // Also tried with 0 instead of numElements-1, but nothing! 
}
弹出窗口的名称如下:

PopUpManager.addPopUp(myPopup,FlexGlobals.topLevelApplication as DisplayObject,true, PopUpManagerChildList.APPLICATION);
无论如何,myCustomComp不会显示在PopUpManager调用的任何窗口上。有没有快捷方式,或者我应该让myCustomComp本身成为一个从PopUpManager调用的弹出窗口,这样它就可以位于顶部

你能给我一个提示吗?谢谢

试试这个

private var myCustomComp:CustomComp = new CustomComp();

showCustomComp(event:MyEvent):void 
{
 mx.managers.PopUpManager.addPopUp(myCustomComp ,this,true);
 mx.managers.PopUpManager.centerPopUp(myCustomComp );
}
这会给你一个弹出窗口。告诉我,如果你仍然面临任何问题