Panel drag and drop : Panel Action « Container « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Container » Panel ActionScreenshots 
Panel drag and drop
Panel drag and drop
            
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="horizontal"
    creationComplete="creationHandler();">

    <mx:Script>
        
            import mx.utils.ObjectUtil;
            import mx.events.DragEvent;
            import mx.collections.ArrayCollection;

            private function creationHandler():void
            {
                var collection:ArrayCollection = new ArrayCollection( ['A''B''C'] );
                contactList.dataProvider = collection;
            }

            private function dropHandlerevt:DragEvent ):void
            {
                var listItem:Object = evt.dragSource.dataForFormat"items" );
                var index:int = contactList.calculateDropIndexevt );
                ArrayCollectioncontactList.dataProvider ).setItemAt(ObjectUtil.copylistItem ), index );
            }

      
    </mx:Script>

    <mx:Panel title="Contact List:"
        width="200" height="200">
        <mx:List id="contactList"
            width="100%" height="100%"
            dragEnabled="true"
            dropEnabled="true"
            dragMoveEnabled="false"
            dragComplete="dropHandler(event);"
            />
    </mx:Panel>

</mx:Application>
    

   
    
    
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Panel mouse down effectPanel mouse down effect
2.Register an event handler for the Panel containerRegister an event handler for the Panel container
3.logs the change event to flashlog.txt each time the user changes panelslogs the change event to flashlog.txt each time the user changes panels
4.Panel rollOver and rollOut eventsPanel rollOver and rollOut events
w_ww_.j___a_v__a__2_s_.c__o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.