Line

Code Actionscript 2.0

Frame action

createEmptyMovieClip("drawing", 1);
drawing.lineStyle(0, 0x000000, 100);
drawing.moveTo(100, 100);
drawing.lineTo(150, 120);
drawing.lineTo(190, 40);

Code Actionscript 3.0

var drawing:MovieClip = new MovieClip(); drawing.graphics.lineStyle(0, 0x000000, 1); drawing.graphics.moveTo(100, 100); drawing.graphics.lineTo(150, 120); drawing.graphics.lineTo(190, 40); this.addChild(drawing);

Description

A line is defined by declaring a beginning and an end point. The command moveTo defines the position of our starting point for a new line, however nothing has been drawn. Every subsequent lineTo command will draw a line from the declared starting point, to the indicated coordinates, forming a line to our end point.

Download

Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File


Share