Hi all, I want to drag a image from "GridItem" and drop it on "Canvas" (Just drag & drop).With referring "flex samples(Drag&drop-->Custom class example)" I wrote below code. But it is not working. This is my first drag&drop(among components) code and I am not sure what's wrong.
Can someone help... Thanks, Prasad --------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Script> <![CDATA[ function beginDrag1() { var ds = new mx.core.DragSource(); mx.managers.DragManager.doDrag(this, ds,"Canves1"); } function doDragEnter1(event) { event.handled="true"; } function doDragExit1(event) { event.target.hideDropFeedback(); } function doDragOver1(event) { event.target.showDropFeedback(); } function doDragDrop1(event) { doDragExit1(event); } ]]> </mx:Script> <mx:Panel width="100%" height="100%" title="panel1"> <mx:Canvas width="100%" height="100%"> <mx:Canvas x="3" y="2" width="100%" height="50" backgroundColor="#B9C6F9"> <mx:Grid x="1" y="1" > <mx:GridRow> <mx:GridItem> <mx:GridItem> <mx:Image source="jo2.jpg" width="32" height="32" id="dg" mouseMove="beginDrag1()"/> </mx:GridItem> <mx:GridItem> <mx:Image source="jo3.jpg" width="32" height="32" id="dg1" mouseMove="beginDrag1()"/> </mx:GridItem> </mx:GridItem> </mx:GridRow> </mx:Grid> </mx:Canvas> <!-- Drop Target --> <mx:Canvas id="Canves1" x="4" y="65" width="100%" height="225" dragEnter="doDragEnter1(event)" dragExit="doDragExit1(event)" dragDrop="doDragDrop1(event)" dragOver="doDragOver1(event)" backgroundColor="#DEE0FE" vScrollPolicy="auto" visible="true"> </mx:Canvas> </mx:Canvas> </mx:Panel> </mx:Application> --------------------------------------------------------------------- ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/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/