Flex PopUpManager

时间:2012-12-08 11:09:28

标签: actionscript-3 flash flex

我想用我的服务器创建一个pm系统。我怎样才能使这个工作?这是我的概念

public function messagePopUp(_userName:String,_target:String,msg:String):void{
//Server sends _userName the person who sent the pm, _target which is you, and a msg (pm)
            if(_target == _username){
//Server checks if you're the _target so popUp will show up
//If it does create the pop up and set window title and the msg in popUp chatTxt text area
                var win:Window = new Window()
                win.title = _userName
                win.chatTxt.text = msg;
                PopUpManager.addPopUp(win,this,false)
                PopUpManager.centerPopUp(win);
            }
        }

1 个答案:

答案 0 :(得分:0)

如果我理解你的问题:

使用可以绑定到UI元素的公共变量创建一个面板(mx:titlewindow works)。创建它时,请使用您的值填充它。

示例:http://www.riacodes.com/flex/build-a-popup-window-with-flex/

所以你只需将代码更改为:

  

var mywin:MyWindowClass = new MyWindowClass();