Name

checkdragstate

Synopsis

LZX: checkdragstate
JavaScript: checkdragstate
Type: Class
Access: public
Topic: Incubator.Components
Declared in: lps/components/incubator/draglib.lzx

Description

This should be declared as a child of the thing for which you want to enable dragging. You will need to define a view (an instance of a subclass of basedragimage) to define the visual look of the thing while its being dragged.
        <class name="dragger" >
            ...
            <method event="onmousedown">
                checkdrag.apply();
            </method>
            <method event="onmouseup">
                canvas.dragimage.stopdrag(this);
                checkdrag.remove();
            </method>

            <checkdragstate name="checkdrag" draggername="dragimage"/>
        </class>
        
The object that you want to accept a drop action, needs to register with LzTrack using the same group as is declared in the dragimage.
        <class name="droptarget">
            ...
            <method name="init">
                super.init();
                LzTrack.register(this, 'target');
            </method>

            <method event="onmousetrackover">
               setAttribute('bgcolor', 0xffff00); // hilite
            </method>
            <method event="onmousetrackout">
               setAttribute('bgcolor', null); // normal
            </method>
            <method event="onmousetrackup">
               setAttribute('bgcolor', null); // normal
               canvas.dragimage.dropcomplete(this);
               Debug.write('dropped: '+dragimage.source.text);
            </method>
        </class>
        

Superclass Chain

node (LzNode) » state (LzState) » checkdragstate

Known Subclasses

Details

Properties (1)

draggername
<attribute name="draggername" type="string" value="dragimage" />
public var draggername : String;
an instance subclass of basedragimage that defines the visual representation of the item while it is being dragged

LZX Synopsis

<class name="checkdragstate" extends=" LzState ">
  <attribute name=" draggername " type="string" value="dragimage" />
</class>

JavaScript Synopsis

public checkdragstate extends  LzState  {
  public var draggername  : String;
}