/** * The final class for the tutorial at http://dcook.org/articles/dcflash_shape_basics.html * The tutorial is for dcflash ( http://dcflash.sf.net/ ), showing basic usage * of the Line, Shape and Gradient classes. * * @author Darren Cook, 2006. * @copyright This sample code has been placed in the public domain. */ import org.dcflash.Line import org.dcflash.Shape import org.dcflash.Gradient class ShapeBasics{ public static function main(){ var line:Line=new Line(2,0xFF0000); line.setCanvas(_root); line.drawRectangle(10,110,200,100); var shape:Shape=new Shape(line,0xFFFF00); shape.setCanvas(_root); shape.drawCircle(50,50,40); var shape2:Shape=new Shape(new Line(null),0x00FFFF,0.5); shape2.setCanvas(_root); shape2.drawEllipse(80,80,60,30); var shape3:Shape=new Shape(new Line()); shape3.setCanvas(_root); shape3.gradient=new Gradient(); shape3.gradient.initLinear(0xFF0000,0x0000FF,1.0,1.0,10,120,200,100); shape3.drawRectangle(10,220,200,100); var shape4:Shape=new Shape(new Line(0)); shape4.setCanvas(_root); shape4.gradient=new Gradient(); shape4.gradient.initRadial(0x00FF00,0xFFFF00,1.0,1.0,320,105,100,100); shape4.drawCircle(320,105,100); } }