It isn't the DragProxy you want to change, but probably just the
dragImage handed into DragManager.doDrag.  The place to do that is in a
handler for DRAG_START where you call preventDefault() so the default
dragImage isn't used.  You can also subclass and override dragImage.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of nwebb
Sent: Monday, May 12, 2008 7:04 AM
To: [email protected]
Subject: Re: [flexcoders] Drag and Drop (modify default dragProxy)

 

Hi Douglas, 

thanks for the reply - yeah that's pretty much what I have at the moment
(I capture the data on MouseDown and create/display a Label on
MouseMove), but I thought it could be a little cleaner and so I was
hoping I could access the current dragProxy, use the existing data
within it, all within the MouseMove method.

This is what I currently have:

//Capture the row data when the user clicks on an item...
private function dropZoneMouseDown(event:MouseEvent):void
{
    var selectedData:XML = DataGrid(event.currentTarget).selectedItem as
XML;
    _lastSelectedName = [EMAIL PROTECTED];
    _lastSelectedAge = [EMAIL PROTECTED];
}
            
private function dropZoneMouseMove(event:MouseEvent):void
{
    var dragInitiator:IUIComponent = event.target as IUIComponent;
    var dragSource:DragSource = new DragSource();
    var dragProxy:Label = _dragLabel;
    dragProxy.text = _lastSelectedName + "  " + _lastSelectedAge;
    DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
 }

Cheers,
Neil




On Mon, May 12, 2008 at 2:41 PM, Douglas Knudsen
<[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote:

perhaps you can create a Label with the text from these twocolumns and
then use this method
http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768
<http://livedocs.adobe.com/flex/3/html/dragdrop_7.html#226768> 

DK

 

On Mon, May 12, 2008 at 8:40 AM, nwebb <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

Hi, 

I'm drag/dropping items within a DataGrid. I would like to modify the
default dragProxy label that is shown when you drag an item. 

(i.e. my DataGrid may have 4 columns, but I only want to show text from
the last two columns). 

Does anyone know how to access it?







-- 
Douglas Knudsen
http://www.cubicleman.com <http://www.cubicleman.com> 
this is my signature, like it? 

 

 

Reply via email to