Fill a rectangle : Rectangle « Graphics « Flash / Flex / ActionScript






Fill a rectangle

 

package{
  import flash.display.*;
  import flash.filters.*;
  public class Main extends Sprite{
    public function Main(){

        var box:Sprite = new Sprite(  );
        box.graphics.lineStyle(  );
        box.graphics.beginFill(0xFFFFFF);
        box.graphics.drawRect(0, 0, 100, 100);
        box.graphics.endFill(  );
        addChild(box);
        box.filters = [new DropShadowFilter(10), new GlowFilter(  )];

    }
  }
}

        








Related examples in the same category

1.Draw a rectangle
2.Draw Colored Rectangle
3.Rotating Rectangles
4.rotateChildren( ), applies the generalized code from Example 20-4. It randomly rotates all the descendants of a specified container (not just the children).
5.A rectangle in a Sprite is nested within another Sprite. Both Sprite instances are rotated 45 degrees.
6.Square