Package com.bit101.components
Class public class ColorChooser
Inheritance ColorChooser InheritanceComponent Inheritance flash.display.Sprite



Public Properties
  Property Defined By
  Inherited enabled : Boolean
Sets/gets whether this component is enabled or not.
Component
  Inherited height : Number
[override] Sets/gets the height of the component.
Component
    model : DisplayObject
ColorChooser
    popupAlign : String
ColorChooser
  Inherited tag : int
Sets/gets in integer that can identify the component.
Component
    usePopup : Boolean
ColorChooser
    value : uint
Gets / sets the color value of this ColorChooser.
ColorChooser
  Inherited width : Number
[override] Sets/gets the width of the component.
Component
  Inherited x : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
  Inherited y : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
  Property Defined By
    _colors : BitmapData
ColorChooser
    _colorsContainer : Sprite
ColorChooser
    _defaultModelColors : Array
ColorChooser
  Inherited _enabled : Boolean = true
Component
  Inherited _height : Number = 0
Component
    _input : InputText
ColorChooser
    _model : DisplayObject
ColorChooser
    _oldColorChoice : uint
ColorChooser
    _popupAlign : String = bottom
ColorChooser
  Inherited Ronda : Class
Component
    _stage : Stage
ColorChooser
    _swatch : Sprite
ColorChooser
  Inherited _tag : int = -1
Component
    _tmpColorChoice : uint
ColorChooser
    _usePopup : Boolean = false
ColorChooser
    _value : uint = 0xff0000
ColorChooser
  Inherited _width : Number = 0
Component
Public Methods
  Method Defined By
   
ColorChooser(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, value:uint = 0xff0000, defaultHandler:Function = null)
Constructor
ColorChooser
   
draw():void
[override] Draws the visual ui of the component.
ColorChooser
  Inherited
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
  Inherited
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
  Inherited
setSize(w:Number, h:Number):void
Sets the size of the component.
Component
Protected Methods
  Method Defined By
   
addChildren():void
[override]
ColorChooser
   
backToColorChoice(e:MouseEvent):void
ColorChooser
   
browseColorChoice(e:MouseEvent):void
ColorChooser
   
The color picker mode Display functions
ColorChooser
   
drawColors(d:DisplayObject):void
ColorChooser
   
getDefaultModel():Sprite
Create the default gradient Model
ColorChooser
   
getGradientSprite(w:Number, h:Number, ca:Array):Sprite
ColorChooser
  Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
   
init():void
[override] Initializes the component.
ColorChooser
  Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
   
onChange(event:Event):void
Internal change handler.
ColorChooser
   
onColorsAddedToStage(e:Event):void
ColorChooser
   
The color picker mode Handlers
ColorChooser
  Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
   
onStageClick(e:MouseEvent):void
ColorChooser
   
onSwatchClick(event:MouseEvent):void
ColorChooser
   
placeColors():void
ColorChooser
   
setColorChoice(e:MouseEvent):void
ColorChooser
Public Constants
  Constant Defined By
    BOTTOM : String = bottom
[static]
ColorChooser
  Inherited DRAW : String = draw
[static]
Component
    TOP : String = top
[static]
ColorChooser
Property Detail
_colors property
protected var _colors:BitmapData

_colorsContainer property  
protected var _colorsContainer:Sprite

_defaultModelColors property  
protected var _defaultModelColors:Array

_input property  
protected var _input:InputText

_model property  
protected var _model:DisplayObject

_oldColorChoice property  
protected var _oldColorChoice:uint

_popupAlign property  
protected var _popupAlign:String = bottom

_stage property  
protected var _stage:Stage

_swatch property  
protected var _swatch:Sprite

_tmpColorChoice property  
protected var _tmpColorChoice:uint

_usePopup property  
protected var _usePopup:Boolean = false

_value property  
protected var _value:uint = 0xff0000

model property  
model:DisplayObject


Implementation
    public function get model():DisplayObject
    public function set model(value:DisplayObject):void
popupAlign property  
popupAlign:String


Implementation
    public function get popupAlign():String
    public function set popupAlign(value:String):void
usePopup property  
usePopup:Boolean


Implementation
    public function get usePopup():Boolean
    public function set usePopup(value:Boolean):void
value property  
value:uint

Gets / sets the color value of this ColorChooser.


Implementation
    public function get value():uint
    public function set value(value:uint):void
Constructor Detail
ColorChooser () Constructor
public function ColorChooser(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, value:uint = 0xff0000, defaultHandler:Function = null)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this ColorChooser.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
 
value:uint (default = 0xff0000) — The initial color value of this component.
 
defaultHandler:Function (default = null) — The event handling function to handle the default event for this component (change in this case).
Method Detail
addChildren () method
override protected function addChildren():void

backToColorChoice () method  
protected function backToColorChoice(e:MouseEvent):void

Parameters

e:MouseEvent
browseColorChoice () method  
protected function browseColorChoice(e:MouseEvent):void

Parameters

e:MouseEvent
displayColors () method  
protected function displayColors():void

The color picker mode Display functions

draw () method  
override public function draw():void

Draws the visual ui of the component.

drawColors () method  
protected function drawColors(d:DisplayObject):void

Parameters

d:DisplayObject
getDefaultModel () method  
protected function getDefaultModel():Sprite

Create the default gradient Model

Returns
Sprite
getGradientSprite () method  
protected function getGradientSprite(w:Number, h:Number, ca:Array):Sprite

Parameters

w:Number
 
h:Number
 
ca:Array

Returns
Sprite
init () method  
override protected function init():void

Initializes the component.

onChange () method  
protected function onChange(event:Event):void

Internal change handler.

Parameters

event:Event — The Event passed by the system.
onColorsAddedToStage () method  
protected function onColorsAddedToStage(e:Event):void

Parameters

e:Event
onColorsRemovedFromStage () method  
protected function onColorsRemovedFromStage(e:Event):void

The color picker mode Handlers

Parameters

e:Event
onStageClick () method  
protected function onStageClick(e:MouseEvent):void

Parameters

e:MouseEvent
onSwatchClick () method  
protected function onSwatchClick(event:MouseEvent):void

Parameters

event:MouseEvent
placeColors () method  
protected function placeColors():void

setColorChoice () method  
protected function setColorChoice(e:MouseEvent):void

Parameters

e:MouseEvent
Constant Detail
BOTTOM Constant
public static const BOTTOM:String = bottom

TOP Constant  
public static const TOP:String = top