flex子窗口控制父页面

flex.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" fontSize="12" width="100%" height="100%" layout="absolute">

    <mx:Script>

       <![CDATA[

           import mx.managers.PopUpManager;   
   
           private function showAlertWindow():void{           
           
            var myPanel:alertWindowExample = alertWindowExample(PopUpManager.createPopUp(this, alertWindowExample, false));
            PopUpManager.centerPopUp(myPanel);
            label1.enabled=false;
           
           }
       ]]>

    </mx:Script>

    <mx:Button label="按我一下瞅瞅" id="label1" click="showAlertWindow()" x="600" y="500"/>

</mx:Application>

alertWindowExample.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="300" height="300"
       fontSize="12" title="标题"   >
    <mx:Script>
       <![CDATA[
           import mx.managers.PopUpManager;
       ]]>
    </mx:Script>
    <mx:Label text="第一个:" x="10" y="10"/>
    <mx:TextInput x="52" y="8" text="Y-boy.cn"/>
    <mx:Label text="蝶舞人格:" x="10" y="38"/>
    <mx:TextArea x="52" y="55" height="62" text="哈哈哈哈...^_^&#xa;http://www.RiaHome.cn"/>
    <mx:Button label="点击返回" x="160" y="128" click="this.parentApplication.label1.enabled=true;PopUpManager.removePopUp(this);"/>
</mx:Panel>

    A+
发布日期:2009年12月12日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: