PDA

View Full Version : Dragging an image out of a tilelist


lkelly
02-11-2009, 02:07 AM
I have a TileList control with cells that contain an image and a label. See the itemRenderer code:

<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalAlign="center"
verticalAlign="middle">

<mx:Image source="{data.@thumbnailImage}" width="75" height="50"/>

<mx:Label text="{data.@title}" />

</mx:HBox>


What I want to do is give the user the ability to drag just the image portion of the cell onto a different canvas. Here's where I am so far on the TileList code:

<mx:TileList id="myVidTilelist"
dataProvider="{xmlListColl}"
itemRenderer="CustomItemRenderer"
columnCount="1"
columnWidth="180"
rowCount="6"
verticalScrollPolicy="on"
dragEnabled="true"
mouseMove="mouseOverHandler(event);"
/>


Not sure if I should be using "mouseMove" to start the drag or some other event. But in the handler, I'm unsure of how to reference the image inside the cell of the TileList. I want to show that as the dragProxy (I think that's the correct term) and also resize it so it isn't the thumbnail size shown in the TileList.

Any thoughts would be greatly appreciated. If I need to provide more code to make this question more clear, please let me know.

Thanks.