Disable dragging of Alert Windows in Flex
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??
精彩评论