Tutorials, extensions, and source files for ActionScript, Flash, and other Adobe products.

 

Flash Source Files

Progressively Draw Closed Shape

Posted August 05, 2004 by senocular

Version: Flash MX

Using an array of coordinates, a function in this example progressively draws a shape (as defined by those coordinates) via a movieclip's onEnterFrame event. Once completed the onEnterFrame event is freed (deleted). Each line represents a segment from one point to the next, each being drawn within the same time period independantly of how far away those two points are away from each other (i.e. lines drawn between two close points will be drawn slower than lines drawn between two points who are further apart). Because of this, this method works best on shapes whose sides are of equal length as those in this example.