[flexcoders] Using a drag proxy
Hi, I have a fully functioning drag and drop operation going on. All I want to do is add an image using the drag proxy functionality to the application. Here is the tree I drag from: mx:Tree id=tree1 dataProvider={MyService.result} width=100% height=100% dragEnabled=true/ And here is the List I drag to: mx:List id=theList width=150 height=25 dragEnter=doDragEnter (event) dragExit=doDragExit(event); dragOver=doDragOver(event); dragDrop=doDragDrop(event)/ Where do I put the code to add the drag Proxy? I have already embedded an image (image1) in my actionscript and want to allow that image to show, with an offset (which is coded to offsetX and offsetY) of 0 and no initialization paramaters. Normally I would have thought that creating a mouseDown even on the tree would enable me to create a dragsource and doDrag method but this seems to screw up the rest of the drag operation as it is mostly handled in the doDragDrop(event)(and it completely froze IE6). Thanks in advance for any help! Iain 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/
Re: [flexcoders] Using a drag proxy
On 5/26/05, digital_eyezed [EMAIL PROTECTED] wrote: I have a fully functioning drag and drop operation going on. All I want to do is add an image using the drag proxy functionality to the application. Here is the tree I drag from: mx:Tree id=tree1 dataProvider={MyService.result} width=100% height=100% dragEnabled=true/ [...] You can do it by making your own drag proxy. See example below. ?xml version=1.0? mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; xmlns=* backgroundColor=white MyTree dragEnabled=true dataProvider mx:Array mx:Object label=foo / mx:Object label=bar / /mx:Array /dataProvider /MyTree /mx:Application // MyTree.as class MyTree extends mx.controls.Tree { function get dragImage() { return MyDragProxy; } } //MyDragProxy.as class MyDragProxy extends mx.controls.listclasses.DragProxy { public function createChildren():Void { super.createChildren(); var label = createClassObject(mx.controls.Label, , getNextHighestDepth(), {text: Watch me move}); label.y += 20; } } You can put your image in createChildren() 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/
RE: [flexcoders] Using a drag proxy
Note that overriding the dragImage getter is undocumented/unsupported/use-at-your-own-risk From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Manish Jethani Sent: Thursday, May 26, 2005 2:07 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Using a drag proxy On 5/26/05, digital_eyezed [EMAIL PROTECTED] wrote: I have a fully functioning drag and drop operation going on. All I want to do is add an image using the drag proxy functionality to the application. Here is the tree I drag from: mx:Tree id=tree1 dataProvider={MyService.result} width=100% height=100% dragEnabled=true/ [...] You can do it by making your own drag proxy. See example below. ?xml version=1.0? mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml xmlns=* backgroundColor=white MyTree dragEnabled=true dataProvider mx:Array mx:Object label=foo / mx:Object label=bar / /mx:Array /dataProvider /MyTree /mx:Application // MyTree.as class MyTree extends mx.controls.Tree { function get dragImage() { return MyDragProxy; } } //MyDragProxy.as class MyDragProxy extends mx.controls.listclasses.DragProxy { public function createChildren():Void { super.createChildren(); var label = createClassObject(mx.controls.Label, , getNextHighestDepth(), {text: Watch me move}); label.y += 20; } } You can put your image in createChildren() 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 the Yahoo! Terms of Service.