0 Replies Latest reply on Aug 18, 2008 12:24 AM by paravoice

    How to cancel acceptDragDrop()

    paravoice
      Hi,
      I want to accept the drop only in panel 1 and 3.
      Any one can tell me how to do this? And notice that this is an AIR app.
      I appreciate.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:Script>
      <![CDATA[
      import mx.events.*;
      import mx.core.DragSource;
      import mx.managers.DragManager;

      private function onDragStart(e:MouseEvent):void
      {
      var ds:DragSource = new DragSource();
      DragManager.doDrag(hoge, ds, e);
      }
      ]]>
      </mx:Script>

      <mx:Canvas id="hoge" backgroundAlpha="1.0" backgroundColor="#FFFFFF"
      width="40" height="40" mouseDown="onDragStart(event)" />

      <mx:Panel title="panel1" id="pnl1"
      width="800" height="600"
      backgroundColor="#FFFFFF"
      horizontalAlign="center" verticalAlign="middle">
      <mx:Panel title="panel2" id="pnl2"
      width="70%" height="70%"
      backgroundColor="#FFFF00"
      horizontalAlign="center" verticalAlign="middle">
      <mx:Panel title="panel3" id="pnl3"
      width="70%" height="70%"
      backgroundColor="#FF00FF"
      horizontalAlign="center" verticalAlign="middle">
      <mx:Panel title="panel4" id="pnl4"
      width="70%" height="70%"
      backgroundColor="#00FFFF"
      horizontalAlign="center" verticalAlign="middle">

      </mx:Panel>
      </mx:Panel>
      </mx:Panel>
      </mx:Panel>

      </mx:WindowedApplication>