zoukankan      html  css  js  c++  java
  • Creating an undraggable Alert control in Flex

    The following example shows how you can create a Flex Alert control that isn’t draggable by listening for the mouseDown event and calling the stopImmediatePropagation() method in the event handler.

    Full code after the jump.

    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2008/03/21/creating-an-undraggable-alert-control-in-flex/ -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout
    ="vertical"
            verticalAlign
    ="middle"
            backgroundColor
    ="white">

        
    <mx:Script>
            
    <![CDATA[
                import mx.controls.Alert;

                private function draggableAlert():void {
                    Alert.show("Drag me!");
                }

                private function undraggableAlert():void {
                    var alert:Alert = Alert.show("Drag me!");
                    alert.addEventListener(MouseEvent.MOUSE_DOWN, alert_mouseDown, true);
                }

                private function alert_mouseDown(evt:MouseEvent):void {
                    evt.stopImmediatePropagation();
                }
            
    ]]>
        
    </mx:Script>

        
    <mx:ApplicationControlBar dock="true">
            
    <mx:Button label="Draggable Alert"
                    click
    ="draggableAlert();" />
            
    <mx:Button label="Undraggable Alert"
                    click
    ="undraggableAlert();" />
        
    </mx:ApplicationControlBar>

    </mx:Application>
  • 相关阅读:
    [BUUOJ记录] [强网杯 2019]随便注(三种方法)
    Content Security Policy (CSP)内容安全策略总结
    [HGAME Week2] Cosmos的博客后台
    [BUUOJ记录] [ACTF2020 新生赛]Include
    PHP弱类型hash比较缺陷
    CTF常见源码泄漏总结
    Sqlmap Tamper绕过脚本详解
    Golden Pyramid
    Prime Palindrome Golf
    Min and Max
  • 原文地址:https://www.cnblogs.com/taobataoma/p/1278192.html
Copyright © 2011-2022 走看看