2 Replies Latest reply on Jun 13, 2008 2:52 AM by soup_pot

    Double-clicking a draggable component

    soup_pot Level 1
      I have an image that I want to be draggable as well as double-clickable.

      However, when I use a mouseDown event to initiate the drag, and a doubleClick event to do something else (display a popup form), the doubleClick event seems to get canceled out (ie the popup form doesn't appear upon double-clicking the image). Only when I remove the mouseDown event can I get the doubleClick event to register. Similarly, after double-clicking, my dragComplete event fires - consequently removing my image.

      Is there something I'm doing wrong? A snippet of the code below, trimmed for simplicity:

      // drop the dragged item
      private function dropData(parameters...):void{
      var dropData:Image = new Image();
      // set properties on the dropped data
      dropData.source = "images/image-placeholder.jpg";
      dropData.doubleClickEnabled = true;
      dropData.addEventListener("doubleClick", showImageForm);
      dropData.addEventListener("mouseDown", dragItHandler);
      dropData.addEventListener("dragExit", dragExitHandler);
      dropData.addEventListener("dragComplete", dragCompleteHandler);
      event.currentTarget.addChildAt(dropData, 0);