1 Reply Latest reply on Aug 22, 2008 3:33 AM by anirudhs

    Drag-and-drop error on Vista

    Rozanov
      Hello,
      Users of an application I'm developing are reporting a problem with the native drag and drop. When they drag an object using Javascript the runtime shuts down with an error. The HTML is loaded in the AIR project using HTMLLoader and its loadString method and the object is being dragged outside the HTML loader boundaries into a Flash-player-loaded content.

      This is only happening on Vista and only randomly, although a couple of users were able to replicate the problem. I got them to run the app in the debug launcher and attached trace statements after every line of code. Mousedown event attached to the object was fired ok, dragstart event was added but it never fired. The app reports no exceptions or errors in the code. Works fine on XP.

      Here are some snippets of the code:
      HTML:
      <div class="thumbnail">
      <img id="45" src=" http://127.0.0.1:4548/getFace?FaceId=45&amp;sid=1217909264750" style="width: 70px; height: 81px; margin-top: 29.5px; margin-left: 20px" onmousedown="mouseDownHandler(event)" ondragstart="startThumbDrag(event)" oncontextmenu="showContextMenu(event)" ondblclick="editTheFace(event)" ondragenter="dragOverEnterHandler(event)" ondragover="dragOverEnterHandler(event)" ondrop="faceDropHandler(event)" imageid="37"/>
      </div>

      Javascript:
      function startThumbDrag(e) {
      e.stopPropagation();
      if (selection.length() == 0) {
      return;
      }
      e.dataTransfer.setData("Fotobounce_faces",selection.items);
      var imageIds = new Array();
      for (var i=0; i<selection.length(); i++) {
      imageIds.push(parseInt(document.getElementById(selection.items ).getAttribute("imageid")));
      }
      e.dataTransfer.setData("Fotobounce_photo_tab",{label:"Images of faces",query:{query:[{imageids:imageIds}]},description:"Images of faces"});
      e.dataTransfer.effectAllowed = "copyMove";
      e.target.addEventListener("drag",reportDragging);
      e.target.addEventListener("dragend",endDrag);
      }