Saturday, February 23, 2008

Drag-drop between two containers instead of list based controls in Flex

I keep seeing many questions on forums about drag-drop of images between two containers or between a control and a container. So I thought a sample may help.

The sample shows a side toolbox from which cursors can be dragged and dropped into the canvas on the right hand side. The code is simple so I won't try to explain the steps in detail here.

The source for this sample is here.

The source for dragging and dropping items between a DataGrid and container can be found here.

4 comments:

Unknown said...

Hello,

I am trying to get your example to work and I only see a blank screen when I run the project. I am using flexbuilder 3. Any suggestions you have would be very helpful. I am very new to flex and I am trying to learn.

Thanks

Sreenivas said...

The assets folder needs to be present along with the built swf. Do you see it in your configuration ?

The swf dynamically loads the images instead embedding the images.

I can't think of any other reason for a blank screen.

Unknown said...

Sreenivas,

Thanks for your reply. Here is a screenshot of the project with your sample files. Do you see anything out of the ordinary at first glance?

Thanks again!

http://www.meetbg.com/shot1.jpg

http://www.meetbg.com/shot2.jpg

Sreenivas said...

I see that the main mxml file is a actual file where as other files are links. I cannot say 100% that this is the reason but something is different with your project setup.

I have posted my project here