Packagecom.bit101.components
Classpublic class Component
InheritanceComponent Inheritance flash.display.Sprite
SubclassesCheckBox, ColorChooser, IndicatorLight, InputText, Knob, Label, Meter, Panel, ProgressBar, PushButton, RadioButton, RotarySelector, Slider, Text, UISlider



Public Properties
 PropertyDefined by
  height : Number
Component
  width : Number
Component
  x : Number
[write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
  y : Number
[write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
 PropertyDefined by
  _height : Number = 0
Component
  _width : Number = 0
Component
Public Methods
 MethodDefined by
  
Component(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0)
Constructor
Component
  
draw():void
Abstract draw function.
Component
  
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
  
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
  
setSize(w:Number, h:Number):void
Sets the size of the component.
Component
Protected Methods
 MethodDefined by
  
addChildren():void
Overriden in subclasses to create child display objects.
Component
  
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
  
init():void
Initilizes the component.
Component
  
invalidate():void
Marks the component to be redrawn on the next frame.
Component
Public Constants
 ConstantDefined by
  DRAW : String = "draw"
[static]
Component
Property detail
_heightproperty
protected var _height:Number = 0
heightproperty 
height:Number  [read-write]Implementation
    public function get height():Number
    public function set height(value:Number):void
_widthproperty 
protected var _width:Number = 0
widthproperty 
width:Number  [read-write]Implementation
    public function get width():Number
    public function set width(value:Number):void
xproperty 
x:Number  [write-only]

Overrides the setter for x to always place the component on a whole pixel.

Implementation
    public function set x(value:Number):void
yproperty 
y:Number  [write-only]

Overrides the setter for y to always place the component on a whole pixel.

Implementation
    public function set y(value:Number):void
Constructor detail
Component()constructor
public function Component(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this component.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
Method detail
addChildren()method
protected function addChildren():void

Overriden in subclasses to create child display objects.

draw()method 
public function draw():void

Abstract draw function.

getShadow()method 
protected function getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter

DropShadowFilter factory method, used in many of the components.

Parameters
dist:Number — The distance of the shadow.
 
knockout:Boolean (default = false) — Whether or not to create a knocked out shadow.

Returns
DropShadowFilter
init()method 
protected function init():void

Initilizes the component.

initStage()method 
public static function initStage(stage:Stage):void

Utility method to set up usual stage align and scaling.

Parameters
stage:Stage
invalidate()method 
protected function invalidate():void

Marks the component to be redrawn on the next frame.

move()method 
public function move(xpos:Number, ypos:Number):void

Moves the component to the specified position.

Parameters
xpos:Number — the x position to move the component
 
ypos:Number — the y position to move the component
setSize()method 
public function setSize(w:Number, h:Number):void

Sets the size of the component.

Parameters
w:Number — The width of the component.
 
h:Number — The height of the component.
Constant detail
DRAWconstant
public static const DRAW:String = "draw"