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>
    转自:http://www.cnblogs.com/taobataoma/archive/2008/08/28/1278192.html
  • 相关阅读:
    大数模板(Java)
    HDU 2473 Junk-Mail Filter 【并查集删除】
    Codeforces 868A Bark to Unlock【字符串+二维string输入输出+特判】
    HDU 1280 前m大的数【排序 / hash】
    马拉车模板
    51nod 1137 矩阵乘法【矩阵】
    51nod 1183 编辑距离【线性dp+类似最长公共子序列】
    RMQ问题心得
    逆序数多种求法
    位运算心得
  • 原文地址:https://www.cnblogs.com/wuhenke/p/1642751.html
Copyright © 2011-2022 走看看