Here's the mouseOverHandler function that is throwing the type 
conversion error.  It's basically copied from the docs 
example "Specifying the drag proxy". Not sure how to reference the 
image portion of the TileList element so that I'm not converting 
TileList to Image...

private function mouseOverHandler(event:MouseEvent):void 
            {      
                var dragInitiator:Image=Image(event.currentTarget);
                var ds:DragSource = new DragSource();
                ds.addData(dragInitiator, "img");               

                // The drag manager uses the Image control 
                // as the drag proxy and sets the alpha to 1.0 
(opaque),
                // so it appears to be dragged across the Canvas.
                var imageProxy:Image = new Image();
                imageProxy.source = event.currentTarget;
                imageProxy.height=15;
                imageProxy.width=15;                
                DragManager.doDrag(dragInitiator, ds, event, 
                    imageProxy, -15, -15, 1.00);
                
            }

--- In flexcoders@yahoogroups.com, "lanekelly5" <lkel...@...> wrote:
>
> First post to the group.  Glad I found this as a resource...
> 
> 
> I have a TileList control with cells that contain an image and a 
> label. See the itemRenderer code:
> 
> Code:
> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml";
>         horizontalAlign="center"
>         verticalAlign="middle">
> 
>     <mx:Image source="{da...@thumbnailimage}" width="75" 
height="50"/>
> 
>     <mx:Label text="{da...@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:
> 
> 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.  I don't want the 
> label to be part of the dragged item (it should just disappear).
> 
> Any thoughts would be greatly appreciated. If I need to provide 
more 
> code to make this question more clear, please let me know.
> 
> Thanks.
>


Reply via email to