03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Lets the user drag the specified movie clip. The movie clip remains draggable until explicitly<br />

stopped through a call to MovieClip.stopDrag(), or until another movie clip is made<br />

draggable. Only one movie clip at a time is draggable.<br />

You can extend the methods <strong>and</strong> event h<strong>and</strong>lers of the MovieClip class by creating a subclass.<br />

Note: This method is supported in Flash Lite only if System.capabilities.hasMouse is<br />

true or System.capabilities.hasStylus is true.<br />

Parameters<br />

lockCenter:Boolean [optional] - A Boolean value specifying whether the draggable movie<br />

clip is locked to the center of the mouse position (true), or locked to the point where the user<br />

first clicked on the movie clip (false).<br />

left:Number [optional] - Value relative to the coordinates of the movie clip's parent that<br />

specify a constraint rectangle for the movie clip.<br />

top:Number [optional] - Value relative to the coordinates of the movie clip's parent that<br />

specify a constraint rectangle for the movie clip.<br />

right:Number [optional] - Value relative to the coordinates of the movie clip's parent that<br />

specify a constraint rectangle for the movie clip.<br />

bottom:Number [optional] - Value relative to the coordinates of the movie clip's parent that<br />

specify a constraint rectangle for the movie clip.<br />

Example<br />

The following example creates a draggable movie clip instance called mc_1:<br />

this.createEmptyMovieClip("mc_1", 1);<br />

with (mc_1) {<br />

lineStyle(1, 0xCCCCCC);<br />

beginFill(0x4827CF);<br />

moveTo(0, 0);<br />

lineTo(80, 0);<br />

lineTo(80, 60);<br />

lineTo(0, 60);<br />

lineTo(0, 0);<br />

endFill();<br />

}<br />

mc_1.onPress = function() {<br />

this.startDrag();<br />

};<br />

mc_1.onRelease = function() {<br />

this.stopDrag();<br />

};<br />

MovieClip 467

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!