/* ASVDrawing Class v1.0 Peter Hall 2003 [url]www.peterjoel.com[/url] MovieClip.draw(ASVDrawing); new ASVDrawing(array); ASVDrawing.setData(array); ASVDrawing.linesToCurves(); ASVDrawing.curvesToLines(); The data array is a special format, which can be obtained from graphics in a swf, using ASV 3.1 and onwards. ([url]http://www.buraks.com/asv/[/url]) It is structured as a list of commands, which correspond to the movieClip methods moveTo, lineTo etc. Each command is a two-element array. The first element is a string, indicating the type of command and the second element is another array, containing arguments. The following commands are supported: ['M',[x,y]] - moveTo(x,y) ['L',[x,y]] - lineTo(x,y) ['C',[cx,cy,ax,ay]] - moveTo(cx,cy,ax,ay) ['S',[th,col,alph]] - lineStyle(th,col,alph) ['F',[col,alph]] - beginFill(col,alph) ['EF'] - endFill() ['GF',[a,b,c,d,e,f]] - beginGradientFill(a,b,c,d,e,f) Note, that ASV can currently generate only the first four comands, due to the way that fills are described in the swf file format. Also, you can add your own commands like this: myASVDrawing.customComand = function(args){ // 'this' applies to the target MovieClip in this context } And then just use it in your data array: ['customComand',[args]] Here is an example, that draws a triangle: data = [['F',[0xFF0000]], // beginFill(0xFF0000) ['M',[20,50]], // moveTo (20,50) ['L',[80,90]], // lineTo (80,90) ['L',[20,90]], // lineTo (20,90) ['L',[20,50]] // lineTo (20,50) ]; myDrawing = new ASVDrawing(data); this.createEmptyMovieClip("drawing_mc",1); this.drawing_mc.draw(myDrawing); */ // method to draw the data // arg is an instance of ASVDrawing MovieClip.prototype.draw = function(dataObj){ var k = 0, d; var x = dataObj.data; var n = x.length; while (k