View Single Post
Old 08-11-2010, 05:39 PM  
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
:stoned FLEX guru in here ?

Here a fairly simple question yet I can't find an awnser anywhere.
I'm droping an object on one of my component which is HBox based and everything works fine execept for the fact that I can only do the drop when I'm on the HBox border or one of the objects it contains. Do I need to set something so the HBox background accepts the drop ... ?


Code:
		// Check if drag proxy has format ...
			private function doDragEnter(event:DragEvent):void{
				if(event.dragSource.hasFormat('treeItems'))
					DragManager.acceptDragDrop(IUIComponent(event.target));
			}
		
		// Performs the drop op.
			private function doDragDrop(event:DragEvent):void{
				var items:Object = event.dragSource.dataForFormat("treeItems");
				
				for (var i:int=0; i<items.length; i++)
					Object(dataBox.getChildAt(i))._value.text = '#ref('+items[i].@id+':'+items[i].localName()+')';
			}
and in Init() I add the two event listners.
Code:
this.addEventListener(DragEvent.DRAG_ENTER, doDragEnter);
this.addEventListener(DragEvent.DRAG_DROP, doDragDrop);
thanks for your help.
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote