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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

mc.curveTo(-Math.tan(Math.PI/8)*r+x, -r+y, x, -r+y);<br />

mc.curveTo(Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x,<br />

-Math.sin(Math.PI/4)*r+y);<br />

mc.curveTo(r+x, -Math.tan(Math.PI/8)*r+y, r+x, y);<br />

}<br />

An example is also in the drawingapi.fla file in the ActionScript samples folder at<br />

www.adobe.com/go/learn_fl_samples. Download <strong>and</strong> decompress the .zip file <strong>and</strong> navigate to<br />

the folder for your version of ActionScript to access the sample.<br />

See also<br />

beginFill (MovieClip.beginFill method), createEmptyMovieClip<br />

(MovieClip.createEmptyMovieClip method), endFill (MovieClip.endFill method),<br />

lineStyle (MovieClip.lineStyle method), lineTo (MovieClip.lineTo method),<br />

moveTo (MovieClip.moveTo method), Math<br />

_droptarget (MovieClip._droptarget property)<br />

public _droptarget : String [read-only]<br />

Returns the absolute path in slash-syntax notation of the movie clip instance on which this<br />

movie clip was dropped. The _droptarget property always returns a path that starts with a<br />

slash (/). To compare the _droptarget property of an instance to a reference, use the eval()<br />

function to convert the returned value from slash syntax to a dot-syntax reference<br />

(ActionScript 2.0 does not support slash syntax.)<br />

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

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

Example<br />

The following example evaluates the _droptarget property of the garbage_mc movie clip<br />

instance <strong>and</strong> uses eval() to convert it from slash syntax to a dot syntax reference. The<br />

garbage_mc reference is then compared to the reference to the trashcan_mc movie clip<br />

instance. If the two references are equivalent, the visibility of garbage_mc is set to false. If<br />

they are not equivalent, the garbage instance resets to its original position.<br />

origX = garbage_mc._x;<br />

origY = garbage_mc._y;<br />

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

this.startDrag();<br />

};<br />

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

this.stopDrag();<br />

if (eval(this._droptarget) == trashcan_mc) {<br />

this._visible = false;<br />

MovieClip 419

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

Saved successfully!

Ooh no, something went wrong!