draggedphotos.lzx

<library>
    <include href="photocollection.lzx"/>    
    <class name="draggedphotos" extends="photocollection">

        <attribute name="stackoffset" value="4"/>
        <attribute name="sellist"/>

        <method name="startDrag" args="who, sel , ix , iy">
            this.setAttribute('x', who.getAttributeRelative( 'x', this ) + ix );
            this.setAttribute('y', who.getAttributeRelative( 'y', this ) + iy );
            if ( activephotos.length ) this.poolAll();
            this.sellist = sel.concat();
            this.addSelection( sellist );

            ds.setAttribute('applied', true);

            lz.Track.activate( "photos" );

            gClipboard.dragStarted();
        </method>

        <method name="stopDrag">
            ds.setAttribute('applied', false);
            this.poolAll();
            lz.Track.deactivate( "photos" );
            gClipboard.dragFinished( sellist );
        </method>

        <method name="showAfterLoad" args="ignore">
            
            var animdur = 250;
            var adur = activephotos.length > 1 ? animdur : 0;
            for ( var i = activephotos.length -1; i >=0; i-- ){
                var p = activephotos[ i ];
                if ( !( p.loaded && !p.visible ) ) continue;
                var e = sellist[ i ];
                p.setAttribute('visible',  true );
                p.setAttribute('x', e.getAttributeRelative( 'x', p ) );
                p.setAttribute('y', e.getAttributeRelative( 'y', p ) );
                p.setAttribute( "clipfactor" , 0 );

                p.animate( "x", i * stackoffset , adur );
                p.animate( "y", i * stackoffset , adur );
                p.animate( "clipfactor", 1 , animdur );
            }
            
        </method>

        <dragstate name="ds"/>

    </class>
</library>
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
* Copyright 2006, 2008 Laszlo Systems, Inc.  All Rights Reserved.          *
* Use is subject to license terms.                                        *
* X_LZ_COPYRIGHT_END ******************************************************-->

Cross References

Includes

Classes