[转]Flex中TitleWindow居中方法

(1)

var popUp:content=content(PopUpManager.createPopUp(this,content,true));
popUp.width = 500;
popUp.height = 300;
popUp.showCloseButton=true;

PopUpManager.centerPopUp(popUp);  

(2)

  1. var popwin:TitleWindow = new TitleWindow();
  2. PopUpManager.addPopUp(popwin,this,true);
  3. PopUpManager.centerPopUp(this);

 (3)

<mx:TitleWindow id="titleWindow_popUp" status="单击图片选择聊天表情" height="200" showCloseButton="true" creationComplete="init();"> 

  1. private function init():void
  2. {
  3. // 可以通过this.x ,this.y 来设置位置
  4. this.x = Capabilities.screenResolutionX/2-this.width/2
  5. this.y = Capabilities.screenResolutionY/2-this.height/2 - 50
  6. }
原文地址:https://www.cnblogs.com/jjj250/p/2020662.html