1 Reply Latest reply on Nov 21, 2007 8:54 PM by lucky_raga

    drag & drop item within Tree not working

    lucky_raga
      Hi,

      I want to be able to drag & drop items within a tree but items cannot move accross branches
      It can only be moved within its branch.
      For this I have a condition in dragDrop(event) handler.
      When i drag item it does not move accross branches which is intended but when i drop within its branch
      on a different location,
      the item does not get dropped
      Though i have dragMoveEnabled set to true.

      my code looks like this:
      private function onDragDrop(event:DragEvent):void {

      var dropTarget:Tree = Tree(event.currentTarget);
      var node:XML = myTree.selectedItem as XML;
      var p:*;

      p = node.parent();

      if(node.parent().@label != "sameBranch") {
      return;
      } else {
      // drop target.
      }
      }

      Do i need to do anything else...
      Please advice.

      Thanks
      Lucky