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.

Example<br />

The following example draws a circle using the mathematical constant pi, the tangent of an<br />

angle, <strong>and</strong> the Drawing API.<br />

drawCircle(this, 100, 100, 50);<br />

//<br />

function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void {<br />

mc.lineStyle(2, 0xFF0000, 100);<br />

mc.moveTo(x+r, y);<br />

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

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

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 />

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

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

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 />

See also<br />

acos (Math.acos method), asin (Math.asin method), atan (Math.atan method),<br />

atan2 (Math.atan2 method), cos (Math.cos method), sin (Math.sin method)<br />

Mouse<br />

Object<br />

|<br />

+-Mouse<br />

public class Mouse<br />

extends Object<br />

The Mouse class is a top-level class whose properties <strong>and</strong> methods you can access without<br />

using a constructor. You can use the methods of the Mouse class to add <strong>and</strong> remove listeners<br />

<strong>and</strong> to h<strong>and</strong>le mouse events.<br />

Note: The members of this class are supported in Flash Lite only if<br />

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

Mouse 393

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

Saved successfully!

Ooh no, something went wrong!