Shape Demo : Shape « Graphics « Flash / Flex / ActionScript






Shape Demo

 
package{
import flash.display.Sprite;
import flash.display.Shape;

public class Main extends Sprite
{
   public function Main()
   {
       var shape:Shape = new Shape();
       shape.graphics.beginFill(0x00ff00, 1.0);
       shape.graphics.drawRect(10, 10, 50, 50);
       shape.graphics.endFill();
       addChild(shape);
   }
}
}
 

        








Related examples in the same category

1.Filling Shapes
2.Custom Graphical Classes
3.Filling a Shape with a Solid or Translucent Color
4.Filling a Shape with a Gradient