Home Tutorial Flex Flex-components Two way drag and drop in Flex`


Share on Google+Share on Google+
Two way drag and drop in Flex`
Posted on: March 12, 2010 at 12:00 AM
In this tutorial you will get to know about two way drag and drop in Flex. Examples will illustrate the concept.


Flex Two Way Drag and Drop :-

In this tutorial you can see two way drag and drop for list based controls. In this example we can set dragEnabled="true" dragMoveEnabled="true" dropEnabled="true"  for both lists as you can see in this example.

Two-way Drag and Drop in Flex Example :-

<?xml version="1.0"?>

<!-- dragdrop\SimpleListToListMove.mxml -->

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp();">



import mx.collections.ArrayCollection;

private function initApp():void {

nameList.dataProvider = new ArrayCollection(['RK', 'BK', 'MK', 'AK', 'SK', 'JK']);

petNameList.dataProvider = new ArrayCollection([]);






<mx:Label text="Names List"/>

<mx:List id="nameList" allowMultipleSelection="true" dragEnabled="true"

dragMoveEnabled="true" dropEnabled="true" backgroundColor="yellow"/>



<mx:Label text="My Pet Name Is"/>

<mx:List id="petNameList" dropEnabled="true" dragMoveEnabled="true" dragEnabled="true" backgroundColor="yellow"/>



<mx:Button id="button1" label="Reset" click="initApp()"/>





Related Tags for Two way drag and drop in Flex`:

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 12, 2010

Recommend the tutorial

Advertisements Advertisements