Hi again and thanks for your help. I had saw the sample from de the docs, but the sample tries to drag and drop a Canvas.
Following that sample I can drag and drop full tree object, but I want to drag only one node. The problem is how to instantiate that node and not the tree: var dragInitiator:Tree=Tree(event.currentTarget); This, obviously, works, but drags entire tree. What I need is something likd: var dragInitiator:Object=Tree(event.currentTarget).selectedItem; But it has to bee a UIComponent, not just an object. Is ther any component such a TreeNode or similar? Thanks again. -----Mensaje original----- De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] En nombre de Tom Chiverton Enviado el: jueves, 20 de julio de 2006 12:40 Para: flexcoders@yahoogroups.com Asunto: Re: [flexcoders] Not acept drag on Tree nodes On Thursday 20 July 2006 11:34, Jesús Iglesias wrote: > private function dragIt(event:MouseEvent):void { > var dragInitiator:Tree=Tree(event.currentTarget); > var ds:DragSource = new DragSource(); > DragManager.doDrag(dragInitiator, ds, event); > } > var dragInitiator:Obejct=Tree(event.currentTarget).selectedItem; I've got: private function dragIt(event:MouseEvent, text:String, format:String):void { // Get the drag initiator component from the event object. var dragInitiator:Canvas=Canvas(event.currentTarget); // Create a DragSource object. var ds:DragSource = new DragSource(); // Add the data to the object. ds.addData(text, format); // Create a Canvas container to use as the drag proxy. // You must specify a size for the proxy image, // or else it will not appear. var canvasProxy:Canvas = new Canvas(); canvasProxy.width=30; canvasProxy.height=30; canvasProxy.setStyle('backgroundColor', dragInitiator.getStyle('backgroundColor')); // Call the DragManager doDrag() method to start the drag. // For information on this method, see // the "Initiating the drag" section. DragManager.doDrag(dragInitiator, ds, event, canvasProxy); } here from the docs, and it has more stuff in the doDrag() call... -- Tom Chiverton ------------------------ Yahoo! Groups Sponsor --------------------~--> Something is new at Yahoo! Groups. Check out the enhanced email design. http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/