drag-and-drop.lzx

<canvas layout="spacing: 10">
  
  <text multiline="true" width="300">The following view uses the
  <i>dragging</i> library.</text>
  
  <view resource="../images/laszlo_explorer_logo.png" onmousedown="dragging.setAttribute('applied', true)" onmouseup="dragging.setAttribute('applied', false); stop()">
    <dragstate name="dragging"/>
  </view>
  
  <text multiline="true" width="100%">Implement custom dragging
  behaviors by subclassing <i>dragstate</i>, or with states and
  constraints.</text>
  
  <view resource="../images/laszlo_explorer_logo.png" onmousedown="dragging.setAttribute('applied', true)" onmouseup="dragging.setAttribute('applied', false)">
    <state name="dragging">
      <attribute name="x" value="${parent.getMouse('x')}"/>
    </state>
  </view>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@                                                         -->

Cross References