Hey AJ,

In the class your are defining to use as the dragProxyImage you can
create your own 'createChildren' method to attach whatever image/icon
you want to display during dragging, instead of showing data from the
actual row you're dragging.

If you look at the view source of my example for the
CustomDragProxy.as class you could simplify it down to something like
this which should work.


override protected function createChildren():void
{
   super.createChildren();
            
   var item:Object = mx.controls.DataGrid(owner).selectedItem;

   var itemY:int = 0; //y position to place item at
            
   var dg:mx.controls.DataGrid = mx.controls.DataGrid(owner);
                
   var container: UIComponent = new UIComponent();
   addChild(DisplayObject(container));    
                
   var loader:Loader = new Loader();
   loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
handleComplete);
   container.addChild(loader);

   var imagePath:String = item.image; //put in the path to the
image/icon you want to load
   var request:URLRequest = new URLRequest(imagePath);
   loader.load(request);

   container.y = itemY;

   var src:IListItemRenderer = dg.indexToItemRenderer(item);
   y = src.y;
   x = this.mouseX - 30;

}

Derrick
--------------
Derrick Grigg
www.dgrigg.com


--- In [email protected], "aseelund" <[EMAIL PROTECTED]> wrote:
>
> Hi All, Im trying to override the datagridproxy image, and its not
> working over so well.
> 
> Ive been using Derrick Grigg's CustomDragProxy
> (http://www.dgrigg.com/post.cfm/11/03/2006/DataGrid-Drag-Image) class
> and i cant modify it to my needs. Basically, ive got a datagrid, and
> im only dragging one item at a time, so multi-select isnt necessary. I
> just want to change the dragimage to be an icon i created, and drag
> that onto a canvas.
> the drop part is working, but the drag image is my holdup.
> 
> any suggestions?
>


Reply via email to