DrawShapes

Package:
Class:
Inheritance:
biz.flashscript.displayobjects
public class DrawShapes
Sprite
The DrawShapes class allows to create different shapes with fills. Use the constructor new DrawShapes().
Public Methods
Method Defined By
DrawShapes()
Creates a new instance of the DrawShapes class.
DrawShapes
doDrawCircleFill(size:Number, bgColor:uint = 0xCCCCCC, borderColor:uint = 0x000000, borderSize:Number = 0)
Draw a circle with fillcolor.
DrawShapes
doDrawCircle(size:Number, borderColor:uint = 0x000000, borderSize:Number = 0)
Draw a circle with fillcolor.
DrawShapes
doDrawRoundRectFill(_width:int, _height:int, cornerRadiusW:int=0, cornerRadiusH:int=0, bgColor:uint = 0xCCCCCC, borderColor:uint = 0x000000, borderSize:Number)
Draw a rectangle with fillcolor. Corners can be round.
DrawShapes
doDrawRoundRect(_width:int, _height:int, cornerRadiusW:int=0, cornerRadiusH:int=0, borderColor:uint = 0x000000, borderSize:Number)
Draw a rectangle. Corners can be round.
DrawShapes
Events
Event Defined By

All events of the Sprite class

Sprite
Constructor Detail
DrawShapes ()  Constructor
public function DrawShapes()
Intializes a new DrawShapes instance.
Method Detail

doDrawCircleFill()  method
public function doDrawCircleFill(size:Number, bgColor:uint = 0xCCCCCC, borderColor:uint = 0x000000, borderSize:Number = 0):Shape

Description here......

Parameters

  • size:Number ____ Specifies radius of the circle.
  • bgColor:uint = 0xCCCCCC ____ specifies the fillcolor. Default is 0xCCCCCC.
  • borderColor:uint = 0xCCCCCC ____ specifies the bordercolor. Default is 0x000000.
  • borderSize:Number = 1 ____ specifies the size of the border. Default is 1.

doDrawCircle()  method
public function doDrawCircle(size:Number, borderColor:uint = 0x000000, borderSize:Number = 0):Shape

Description here......

Parameters

  • size:Number ____ Specifies radius of the circle.
  • borderColor:uint = 0xCCCCCC ____ specifies the bordercolor. Default is 0x000000.
  • borderSize:Number = 1 ____ specifies the size of the border. Default is 1.

doDrawRoundRectFill()  method
public function doDrawRoundRectFill(_width:int, _height:int, cornerRadiusW:int=0, cornerRadiusH:int=0, bgColor:uint = 0xCCCCCC, borderColor:uint = 0x000000, borderSize:Number=1) :Shape

Description here......

Parameters

  • _width:int ____ Specifies the width.
  • _height:int ____ specifies height.
  • cornerRadiusW:int=0 ____ specifies the width of the corner. Default is 0.
  • cornerRadiusH:int=0 ____ specifies the height of the corner. Default is 0.
  • bgColor:uint = 0xCCCCCC ____ specifies the fillcolor. Default is 0xCCCCCC.
  • borderColor:uint = 0x000000 ____ specifies the bordercolor. Default is 0x000000.
  • borderSize:Number=1 ____ specifies the size of the border. Default is 1.

doDrawRoundRect()  method
public function doDrawRoundRect(_width:int, _height:int, cornerRadiusW:int=0, cornerRadiusH:int=0, borderColor:uint = 0x000000, borderSize:Number=1) :Shape

Description here......

Parameters

  • _width:int ____ Specifies the width.
  • _height:int ____ specifies height.
  • cornerRadiusW:int=0 ____ specifies the width of the corner. Default is 0.
  • cornerRadiusH:int=0 ____ specifies the height of the corner. Default is 0.
  • borderColor:uint = 0x000000 ____ specifies the bordercolor. Default is 0x000000.
  • borderSize:Number=1 ____ specifies the size of the border. Default is 1.
Examples
Create a new fla file and name it DrawShapes.fla. Set the Publish settings to Adobe Air. Place the fla in the same folder as the biz folder. Then create an Actionscript file, name it Drawshapes.as and place this script.
package 
{
	import flash.display.Sprite;
	import biz.flashscript.displayobjects.DrawShapes;
	public class Drawshapes extends Sprite
	{
		public function Drawshapes ():void
		{
			var _object:DrawShapes = new DrawShapes();
			_object.doDrawCircleFill(100);
			addChild(_object);
			//
			var _object2:DrawShapes = new DrawShapes();
			_object2.doDrawCircle(100);
			_object2.x = 105;
			addChild(_object2);
			//
			var _object3:DrawShapes = new DrawShapes();
			_object3.doDrawRoundRectFill(100, 100, 10, 10);
			_object3.x = 210;
			addChild(_object3);
			//
			var _object4:DrawShapes = new DrawShapes();
			_object4.doDrawRoundRect(100, 100, 10, 10);
			_object4.x = 315;
			addChild(_object4);
		}
	}
}