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 code draws a triangle with a 5-pixel, solid magenta line with no fill.<br />

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

triangle_mc.lineStyle(5, 0xff00ff, 100);<br />

triangle_mc.moveTo(200, 200);<br />

triangle_mc.lineTo(300, 300);<br />

triangle_mc.lineTo(100, 300);<br />

triangle_mc.lineTo(200, 200);<br />

See also<br />

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

(MovieClip.beginGradientFill method), clear (MovieClip.clear method), curveTo<br />

(MovieClip.curveTo method), lineTo (MovieClip.lineTo method), moveTo<br />

(MovieClip.moveTo method)<br />

lineTo (MovieClip.lineTo method)<br />

public lineTo(x:Number, y:Number) : Void<br />

Draws a line using the current line style from the current drawing position to (x, y); the<br />

current drawing position is then set to (x, y). If the movie clip that you are drawing in contains<br />

content that was created with the Flash drawing tools, calls to lineTo() are drawn<br />

underneath the content. If you call lineTo() before any calls to the moveTo() method, the<br />

current drawing position defaults to (0,0). If any of the parameters are missing, this method<br />

fails <strong>and</strong> the current drawing position is not changed.<br />

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

Parameters<br />

x:Number - An integer indicating the horizontal position relative to the registration point of<br />

the parent movie clip.<br />

y:Number - An integer indicating the vertical position relative to the registration point of the<br />

parent movie clip.<br />

Example<br />

The following example draws a triangle with a 5-pixel, solid magenta line <strong>and</strong> a p artially<br />

transparent blue fill:<br />

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

triangle_mc.beginFill(0x0000FF, 30);<br />

triangle_mc.lineStyle(5, 0xFF00FF, 100);<br />

triangle_mc.moveTo(200, 200);<br />

triangle_mc.lineTo(300, 300);<br />

440 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!