Thanks a lot Gagan for reply. I really appreciate your assistance. Here is brief code snippet of my problem -
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp();"> <mx:Script> <![CDATA[ import mx.core.IUIComponent; import mx.core.UIComponent; import mx.collections.ArrayCollection; import mx.events.DragEvent; import mx.managers.DragManager; private function initApp():void { sourceList.dataProvider = new ArrayCollection(['Orange', 'Apple', 'Banana']); } private function item_dragEnter(evt:DragEvent):void { var obj:IUIComponent = evt.currentTarget as UIComponent; //evt.stopImmediatePropagation(); DragManager.acceptDragDrop(obj); DragManager.showFeedback( DragManager.LINK ); } private function item_dragDrop(evt:DragEvent):void { var item:Object = sourceList.selectedItem; var idx:int = sourceList.dataProvider.getItemIndex(item); sourceList.dataProvider.removeItemAt(idx); } ]]> </mx:Script> <mx:HBox> <mx:VBox> <mx:Label text="My Items"/> <mx:List id="sourceList" allowMultipleSelection="true" dragEnabled="true" dragMoveEnabled="true"/> </mx:VBox> <mx:VBox > <mx:Label text="Remove items target "/> <mx:Box height="25" backgroundColor="red" id="trash" width="100%" dragDrop="item_dragDrop(event);" dragEnter="item_dragEnter(event);" /> <!-- dragOver="item_dragEnter(event)" --> </mx:VBox> </mx:HBox> </mx:Application> I haven't get a single example will using hitTest for DragDrop. Mostly seeing that ppls are used hitTest for charts and graph components. Issue is - I want to remove draggble item on drag over of the red box. Right now its removing (accepting) on dragenter / dragover + mouse up. As soon as the tilelist item coves over the red box (drop-able target)it should be removed immediately. Thanks, Nilesh On May 7, 6:04 pm, GAGAN anand <[email protected]> wrote: > Hi Nilesh, > > In your case, i got to know that while u r dragging the image from bottom to > the drop target then ur half image is in the drop area but ur mouse is not > in the drop area. > > So thats why u are not able to drop the image in the target area. > > For this, I think just make use of hitTest. It means whenever image object > hits the target area then hitTest will be true and then u dispatch the Drag > Enter event of the target area. > > Rest job will be done by the handler of that event. > > Hope this helps... > > Regards > Gagan Deep > > On 7 May 2010 12:11, Nilesh Pawar <[email protected]> wrote: > > > > > Please help ! > > > On May 6, 4:37 pm, Nilesh Pawar <[email protected]> wrote: > > > Hello Members, > > > > I am new to Flex and this is my first post to FUG. I am using dragdrop > > > in TileList having big boxes as TileList itemrenders. > > > > I have defined one invisible drop target to accept these tilelist > > > boxes so user can remove items from tilelist with dragging them on > > > above invisible target. > > > > In accept DragDrop function I am facing problem with Drag Event as it > > > extends MouseEvent. If user want to remove big box object the target > > > is accepting same if the mouse cursor is on the target. > > > > If user picks box from one side and dragged it over the invisible > > > target event entering this big box more than half way I am not able to > > > catch "DragEvent" as mouse pointer is at the bottom side of box object > > > and not > > > over the drop target. > > > > Is there any way to define co-ordinates to the mouse while dragging, > > > so when dragged object touches to the target it should be acceptable. > > > > Here is my sample code - > > > > <mx:TileList dragEnabled="true" id="tileList" > > > dataProvider="{TileListdp}" dropEnabled="true" > > > doubleClick="showPopup(event)" > > > > itemRenderer="com.servient.renderers.BigBoxItemRenderer" > > > dragMoveEnabled="true" > > > rowHeight="150" columnWidth="400" width="100%" > > > height="100%"> > > > </mx:TileList> > > > > // invisible Trash Can where use is dragging object to remove > > > <mx:Image dragDrop="item_dragDrop(event);" > > > dragEnter="item_dragEnter(event);" height="42" width="42" > > > source="@Embed('images/trash-small.png')" /> > > > > //Drag Drop Event Handling > > > private function item_dragEnter(evt:DragEvent):void { > > > //Alert.show("In DragEnter"); > > > var obj:IUIComponent = evt.currentTarget as UIComponent; > > > DragManager.acceptDragDrop(obj); > > > DragManager.showFeedback( DragManager.LINK ); > > > } > > > > private function item_dragDrop(evt:DragEvent):void { > > > //Alert.show("Here in DragDrop"); > > > var item:Object = tileList.selectedItem; > > > var idx:int = TileListdp.getItemIndex(item); > > > TileListdp.removeItemAt(idx); > > > } > > > > Thanks in advance! > > > > - Nilesh > > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Flex India Community" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > [email protected]<flex_india%[email protected]> > > . > > > For more options, visit this group athttp:// > > groups.google.com/group/flex_india?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Flex India Community" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<flex_india%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/flex_india?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/flex_india?hl=en. -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

