Actionscript 3 如何在flex 4.6 mobile中打开方法后立即关闭弹出窗口

Actionscript 3 如何在flex 4.6 mobile中打开方法后立即关闭弹出窗口,actionscript-3,apache-flex,flex4,flex4.5,Actionscript 3,Apache Flex,Flex4,Flex4.5,当调用popup.open方法时,如果未触发打开事件,我将立即使用popup.close方法关闭弹出窗口。问题是弹出式容器中的内容已创建,但尚未完全从阶段中删除,因此我无法单击按钮。请运行下面的代码,并告诉我如何从第二次点击按钮的解决方案 <?xml version="1.0" encoding="utf-8"?> 添加PopUpManager.removePopUp(SPRCRL)后问题得到修复 <fx:Script> <![CDATA[

当调用popup.open方法时,如果未触发打开事件,我将立即使用popup.close方法关闭弹出窗口。问题是弹出式容器中的内容已创建,但尚未完全从阶段中删除,因此我无法单击按钮。请运行下面的代码,并告诉我如何从第二次点击按钮的解决方案

<?xml version="1.0" encoding="utf-8"?>



添加PopUpManager.removePopUp(SPRCRL)后问题得到修复

<fx:Script>
    <![CDATA[
        import flash.utils.setInterval;

        private var sprCtrl:SpinnerControlWithText;
        private var timer:Timer = new Timer(1);

        protected function button1_clickHandler(event:MouseEvent):void
        {
            sprCtrl = new SpinnerControlWithText();
            sprCtrl.open(this,true);
            sprCtrl.x =0;
            sprCtrl.y = 0;
            sprCtrl.width = this.width;
            sprCtrl.height = this.height;
            sprCtrl.close();//Here i have to close this in backend response
        }

    ]]>
</fx:Script>

<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>

<s:Button click="button1_clickHandler(event)" label="Click Me" horizontalCenter="0" verticalCenter="0"/>
<?xml version="1.0" encoding="utf-8"?>      
<s:SkinnablePopUpContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
                               xmlns:s="library://ns.adobe.com/flex/spark"
                               width="100%" height="100%" xmlns:control="control.*" creationComplete="skinnablepopupcontainer1_creationCompleteHandler(event)">
    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;

            [Bindable]
            public var msg:String = "Please wait...";
            [Bindable]
            public var colorToSet:uint = 0x000000;

            protected function skinnablepopupcontainer1_creationCompleteHandler(event:FlexEvent):void
            {
                // TODO Auto-generated method stub
                trace("busy cursor creation complete");
            }

        ]]>
    </fx:Script>

    <s:BorderContainer id="spinnerBorderContainer" height="100%" width="100%" backgroundColor="#000000" backgroundAlpha=".5">
        <s:layout>
            <s:VerticalLayout verticalAlign="middle" horizontalAlign="center" />
        </s:layout>
        <s:BorderContainer height="23%" width="32%" backgroundColor="#FFFFFF" backgroundAlpha=".7"> 
        <s:layout>
            <s:VerticalLayout verticalAlign="middle" horizontalAlign="center" />
        </s:layout>
            <!--<control:Spinner id="spinner"  tickColor="{colorToSet}" size="40"  />-->
            <s:BusyIndicator id="spinner" symbolColor="white" rotationInterval="200" />
            <s:Label text="{msg}" fontWeight="normal" textAlign="center" />
        </s:BorderContainer>
    </s:BorderContainer>

</s:SkinnablePopUpContainer>
sprCtrl.close();//Here i have to close this in backend response
 PopUpManager.removePopUp(sprCtrl);