Packagegraphics.drawing
Classpublic dynamic class RoundedComplexRectanglePen
InheritanceRoundedComplexRectanglePen Inheritance CornerRectanglePen Inheritance RectanglePen Inheritance Pen Inheritance flash.utils.Proxy
Subclasses BubblePen

Draws a complex rounded rectangle. You can set the corner radius of the rectangle with the top left, top right, bottom left and bottom right corner.

Example :

     package examples 
     {
         import graphics.Align;
         import graphics.FillStyle;
         import graphics.LineStyle;
         import graphics.Corner;
         
         import graphics.drawing.RoundedComplexRectanglePen;
         
         import flash.display.CapsStyle;
         import flash.display.JointStyle;
         import flash.display.LineScaleMode;
         import flash.display.Shape;
         import flash.display.Sprite;
         import flash.display.StageScaleMode;
         import flash.events.KeyboardEvent;
         import flash.ui.Keyboard;
         
         public class ExampleRoundedComplexRectanglePen extends Sprite
         {
             public function ExampleRoundedComplexRectanglePen()
             {
                 stage.scaleMode = StageScaleMode.NO_SCALE ;
                 stage.align     = "" ;
                 
                 var shape:Shape = new Shape() ;
                 
                 shape.x = stage.stageWidth  / 2 ;
                 shape.y = stage.stageHeight / 2 ;
                 
                 addChild( shape ) ;
                 
                 pen      = new RoundedComplexRectanglePen( shape , 0, 0, 200, 180, 12, 0, 0, 24, Align.CENTER ) ;
                 pen.fill = new FillStyle( 0xFF0000 , 0.5 ) ;
                 pen.line = new LineStyle( 2, 0xFFFFFF , 1 , true, LineScaleMode.NORMAL , CapsStyle.SQUARE, JointStyle.MITER ) ;
                 
                 pen.draw() ;
                 
                 stage.addEventListener( KeyboardEvent.KEY_DOWN , keyDown ) ;
             }
             
             public var pen:RoundedComplexRectanglePen ;
             
             public function keyDown( e:KeyboardEvent ):void
             {
                 var code:uint = e.keyCode ;
                 switch( code )
                 {
                     case Keyboard.LEFT :
                     {
                         pen.draw( 0, 0, 200, 180, 12, 12, 32, 32, Align.LEFT ) ;
                         break ;
                     }
                     case Keyboard.RIGHT :
                     {
                         pen.draw( 0, 0, 200, 180, 32, 12, 32, 32, Align.RIGHT ) ;
                         break ;
                     }
                     case Keyboard.UP :
                     {
                         pen.draw( 0, 0, 200, 180, 32, 12, 0, 0, Align.TOP ) ;
                         break ;
                     }
                     case Keyboard.DOWN :
                     {
                         pen.draw( 0, 0, 200, 180, 0, 0, 24, 24, Align.BOTTOM ) ;
                         break ;
                     }
                     case Keyboard.SPACE :
                     {
                         pen.x = -10 ;
                         pen.y = 10 ;
                         pen.bottomLeftRadius  = 0 ;
                         pen.bottomRightRadius = 0 ;
                         pen.topLeftRadius     = 0 ;
                         pen.topRightRadius    = 0 ;
                         pen.align  = Align.TOP_RIGHT ;
                         pen.draw() ;
                         break ;
                     }
                     case Keyboard.NUMPAD_7 :
                     {
                         pen.cornerRadius = 10 ;
                         pen.draw( 0, 0, 200, 180 ) ;
                         break ;
                     }
                     case Keyboard.NUMPAD_8 :
                     {
                         pen.cornerRadius = NaN ;
                         pen.draw( 0, 0, 200, 180 ) ;
                         break ;
                     }
                     case Keyboard.NUMPAD_9 :
                     {
                         pen.corner = new Corner(false, false, false, false) ;
                         pen.draw( 0, 0, 200, 180 ) ;
                         break ;
                     }
                     case Keyboard.NUMPAD_6 :
                     {
                         pen.corner = new Corner() ;
                         pen.draw( 0, 0, 200, 180 ) ;
                         break ;
                     }
                 }
             }
         }
     }
     



Public Properties
 PropertyDefined By
 Inheritedalign : uint
Determinates the align value of the pen.
Pen
  bottomLeftRadius : Number
The radius of the bottom-left corner, in pixels.
RoundedComplexRectanglePen
  bottomRightRadius : Number
The radius of the bottom-left corner, in pixels.
RoundedComplexRectanglePen
 Inheritedcorner : Corner
Determinates the Corner value of this pen.
CornerRectanglePen
  cornerRadius : Number
The global corner radius corner, in pixels.
RoundedComplexRectanglePen
 Inheritedfill : IFillStyle
Determinates the fill style object of the pen.
Pen
 Inheritedgraphics : *
Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.
Pen
 Inheritedheight : Number
Defines the height of the shape rectangle.
RectanglePen
 Inheritedline : ILineStyle
Determinates the line style object of the pen.
Pen
 Inheritedrectangle : Rectangle
[read-only] Returns the Rectangle reference of this pen.
RectanglePen
  topLeftRadius : Number
The radius of the upper-left corner, in pixels.
RoundedComplexRectanglePen
  topRightRadius : Number
The radius of the upper-right corner, in pixels.
RoundedComplexRectanglePen
 InheriteduseClear : Boolean = true
Indicates if the clear() method is invoked at the end of the draw method.
Pen
 InheriteduseEndFill : Boolean = true
Indicates if the endFill() method is invoked at the end of the draw method.
Pen
 Inheritedwidth : Number
Defines the width of the shape rectangle.
RectanglePen
 Inheritedx : Number
Defines the x position of the shape rectangle.
RectanglePen
 Inheritedy : Number
Defines the y position of the shape rectangle.
RectanglePen
Public Methods
 MethodDefined By
  
RoundedComplexRectanglePen(graphic:*, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, topLeftRadius:Number = 0, topRightRadius:Number = 0, bottomLeftRadius:Number = 0, bottomRightRadius:Number = 0, align:uint = 10)
Creates a new RoundedComplexRectanglePen instance.
RoundedComplexRectanglePen
 Inherited
BF(... arguments):void
Defines a shortcut reference to used the beginBitmapFill method.
Pen
 Inherited
C(... arguments):void
Defines a shortcut reference to used the curveTo method.
Pen
 Inherited
CL():void
Defines a shortcut reference to used the clear method.
Pen
 Inherited
draw(... args):void
[override] Draws the shape.
RectanglePen
  
drawShape():void
[override] This method contains the basic drawing shape algorithm.
RoundedComplexRectanglePen
 Inherited
EF():void
Defines a shortcut reference to used the endFill method.
Pen
 Inherited
F(... arguments):void
Defines a shortcut reference to used the beginFill method.
Pen
 Inherited
GF(... arguments):void
Defines a shortcut reference to used the beginGradientFill method.
Pen
 Inherited
GS(... arguments):void
Defines a shortcut reference to used the lineGradientStyle method.
Pen
 Inherited
L(... arguments):void
Defines a shortcut reference to used the lineTo method.
Pen
 Inherited
M(... arguments):void
Defines a shortcut reference to used the moveTo method.
Pen
 Inherited
S(... arguments):void
Defines a shortcut reference to used the lineStyle method.
Pen
  
setPen(... args):void
[override] Sets the shape options to defined all values to draw the shape.
RoundedComplexRectanglePen
Protected Methods
 MethodDefined By
 Inherited
Invoked to refresh the offset x and y position defines by the align property.
RectanglePen
Property Detail
bottomLeftRadiusproperty
bottomLeftRadius:Number

The radius of the bottom-left corner, in pixels.


Implementation
    public function get bottomLeftRadius():Number
    public function set bottomLeftRadius(value:Number):void
bottomRightRadiusproperty 
bottomRightRadius:Number

The radius of the bottom-left corner, in pixels.


Implementation
    public function get bottomRightRadius():Number
    public function set bottomRightRadius(value:Number):void
cornerRadiusproperty 
cornerRadius:Number

The global corner radius corner, in pixels.

The cornerRadius property no change the other corner properties.

If this property is NaN the bottomLeftRadius, bottomRightRadius, topLeftRadius and topRightRadius properties are used.


Implementation
    public function get cornerRadius():Number
    public function set cornerRadius(value:Number):void
topLeftRadiusproperty 
topLeftRadius:Number

The radius of the upper-left corner, in pixels.


Implementation
    public function get topLeftRadius():Number
    public function set topLeftRadius(value:Number):void
topRightRadiusproperty 
topRightRadius:Number

The radius of the upper-right corner, in pixels.


Implementation
    public function get topRightRadius():Number
    public function set topRightRadius(value:Number):void
Constructor Detail
RoundedComplexRectanglePen()Constructor
public function RoundedComplexRectanglePen(graphic:*, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, topLeftRadius:Number = 0, topRightRadius:Number = 0, bottomLeftRadius:Number = 0, bottomRightRadius:Number = 0, align:uint = 10)

Creates a new RoundedComplexRectanglePen instance.

Parameters
graphic:* — The Graphics reference to control with this helper. You can passed-in a Shape or Sprite/MovieClip reference in argument.
 
x:Number (default = 0) — (optional) The x position of the pen. (default 0)
 
y:Number (default = 0) — (optional) The y position of the pen. (default 0)
 
width:Number (default = 0) — (optional) The width of the pen. (default 0)
 
height:Number (default = 0) — (optional) The height of the pen. (default 0)
 
topLeftRadius:Number (default = 0) — (optional) The radius of the upper-left corner, in pixels. (default 0)
 
topRightRadius:Number (default = 0) — (optional) The radius of the upper-right corner, in pixels. (default 0)
 
bottomLeftRadius:Number (default = 0) — (optional) The radius of the bottom-left corner, in pixels. (default 0)
 
bottomRightRadius:Number (default = 0) — (optional) The radius of the bottom-right corner, in pixels. (default 0)
 
align:uint (default = 10) — (optional) The align value of the pen. (default Align.TOP_LEFT)
Method Detail
drawShape()method
override public function drawShape():void

This method contains the basic drawing shape algorithm.

setPen()method 
override public function setPen(... args):void

Sets the shape options to defined all values to draw the shape.

Parameters

... args — (optional) The x position of the pen.