Filling a Shape with a Solid or Translucent Color : Shape « Graphics « Flash / Flex / ActionScript






Filling a Shape with a Solid or Translucent Color

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var sampleSprite:Sprite = new Sprite();
        sampleSprite.graphics.lineStyle(  );
        sampleSprite.graphics.beginFill(0x00FF00);
        sampleSprite.graphics.lineTo(100, 0);
        sampleSprite.graphics.lineTo(100, 100);
        sampleSprite.graphics.lineTo(0, 100);
        sampleSprite.graphics.lineTo(0, 0);
        sampleSprite.graphics.endFill(  );
        addChild(sampleSprite);
    }
  }
}

        








Related examples in the same category

1.Shape Demo
2.Filling Shapes
3.Custom Graphical Classes
4.Filling a Shape with a Gradient