1 Reply Latest reply on Aug 10, 2007 12:08 PM by Fidoogle

    Drag Drop with FABridget

    adamhamel
      In the code sample below when I mouse down on a SWT control "dragme" my beginFlexDrag is called. The problem is that because I am holding down the mouse the document events for mousemove are not being registered, until I release the mouse. This goes for any other event binding. I can't call addEventListener from within the beginFlexDrag function. Is the FABridge doing something to prevent this. If you do the same thing in a straight up html example the document events get bound.

      function initialize()
      {
      getApp().getDragme().addEventListener('mouseDown', beginFlexDrag, false);
      }

      function beginFlexDrag(e)
      {
      addEvent(document, 'mousemove', draggingFlexDrag);
      addEvent(document, 'mouseup', endFlexDrag);
      }

      function getApp()
      {
      return FABridge.example.root();
      }

      function addEvent(obj, evType, fn)
      {
      obj.addEventListener(evType, fn, false);
      return true;
      }