Enable and Disable Drag Operations : Drag Drop « Development « Flex






Enable and Disable Drag Operations

Enable and Disable Drag Operations
          

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" creationComplete="creationHandler();">
    <mx:Script>
        
            import mx.events.DragEvent;
            import mx.collections.ArrayCollection;

            [Bindable]
            public var isEnabled:Boolean = true;

            private function creationHandler():void {
                list1.dataProvider = new ArrayCollection(['A', 'B', 'C']);
                list2.dataProvider = new ArrayCollection(['D', 'E', 'F']);
            }
            private function dragEnterHandler( evt:DragEvent ):void {
                evt.target.dropEnabled = ( evt.target != evt.dragInitiator );
            }
      
    </mx:Script>
    <mx:VBox width="100%" height="100%">
        <mx:List id="list1" width="200" height="200" dragEnabled="{isEnabled}" dragMoveEnabled="true"
                dragEnter="dragEnterHandler(event);"/>
        <mx:List id="list2" width="200" height="200" dragEnabled="{isEnabled}"
                dragMoveEnabled="true" dragEnter="dragEnterHandler(event);"/>
    </mx:VBox>

</mx:Application>
 

   
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Setting the dragMoveEnabled property to move instead of copySetting the dragMoveEnabled property to move instead of copy
2.Dragging and dropping within a component, to allow orderingDragging and dropping within a component, to allow ordering
3.Create DragSource object and add data to itCreate DragSource object and add data to it
4.Performing a two-way drag and dropPerforming a two-way drag and drop
5.Dragging and dropping in the same controlDragging and dropping in the same control
6.The drag initiators, and drop targetThe drag initiators, and drop target
7.Get Drag source data formatGet Drag source data format
8.Press control key as drag and dropPress control key as drag and drop
9.Canvas Drag and DropCanvas Drag and Drop
10.Specifying the drag indicator by using the DragSpecifying the drag indicator by using the Drag
11.Specify a Drag ProxySpecify a Drag Proxy
12.Drag Drop To ComponentDrag Drop To Component
13.Set liveDragging to true to dispatch change event continuously as moving the thumbSet liveDragging to true to dispatch change event continuously as moving the thumb
14.Get drag source from DragEventGet drag source from DragEvent
15.Canvas drag enter eventCanvas drag enter event
16.Explpicitly handle the dragOver eventExplpicitly handle the dragOver event