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();, 0x000000, 1);, 100);, 120);, 40); this.addChild(drawing);


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.


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