开发者

Disable dragging of Alert Windows in Flex

开发者 https://www.devze.com 2023-02-15 19:07 出处:网络
I have a problem with Flex. How can I disable dragging of the Alert window in Flex? I don\'t开发者_StackOverflow社区 want the users to move my alert windows. What shall I do?

I have a problem with Flex.

How can I disable dragging of the Alert window in Flex? I don't开发者_StackOverflow社区 want the users to move my alert windows. What shall I do?

Thanks

var a:Alert=new Alert();
a.text="Alert Message";
PopUpManager.addPopUp(a,this,true);


You can disable it by listening for the mouseDown event from the Alert window and calling the stopImmediatePropagation() method.

var a:Alert = new Alert();
a.text = "Alert message";
a.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, true);
PopUpManager.addPopUp(a, this, true);

private function mouseDownHandler(event:MouseEvent):void {
     event.stopImmediatePropagation();
}


Dragging can be disable, by setting "isPopUp" property to "false".

var a:Alert = Alert.show("Alert message");
a.isPopUp = false;


I think if you invoke the action using a.show, or Alert.show("text"), the window that appears is not movable. Can you try that??

0

精彩评论

暂无评论...
验证码 换一张
取 消