首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

ActionScript中施用PopUpManager弹出窗口

2012-09-18 
ActionScript中使用PopUpManager弹出窗口一、在父窗口中(点击添加弹出子窗口)import mx.managers.PopUpMana

ActionScript中使用PopUpManager弹出窗口

一、在父窗口中(点击添加弹出子窗口)

   import mx.managers.PopUpManager;
   import com.fairycomic.view.CompanyManagewindow;(子对窗口的类)

   
   protected function user_add_clickHandler(event:MouseEvent):void
   { 
    var pop1:CompanyManagewindow;
    pop1 = new CompanyManagewindow();       
    PopUpManager.addPopUp(pop1,CompanyManagewindow.GetParentWindows(), true);   
    PopUpManager.centerPopUp(pop1);   
   }

二、在子窗口中

 public static function GetParentWindows():Sprite
  {
       var parent:Sprite=null;
      if (!parent)
     {
             var sm:ISystemManager = ISystemManager(FlexGlobals.topLevelApplication.systemManager);
             var mp:Object = sm.getImplementation("mx.managers.IMarshallPlanSystemManager");
            if (mp && mp.useSWFBridge())
                 parent = Sprite(sm.getSandboxRoot());
            else
                 parent = Sprite(FlexGlobals.topLevelApplication);
            }
           return parent;
  }

 

protected override function createChildren():void
  {
   
    var label1:Label;    
   super.createChildren();
   label1=new Label();
   label1.text="公司名称:";
   label1.x=27;
   label1.y=14;
   label1.width=80;
   label1.height=12;
   this.addElement(label1);//不能使用addChild

}

热点排行