Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class ColorChooser

MovieClip
  |
  +--com.bjc.core.BJCComponent
        |
        +--com.bjc.controls.ColorChooser


class ColorChooser
extends BJCComponent

A component for selecting colors

Events:

change - Fired whenever the active color is changed by the user, either by clicking on a color square or pressing enter after changing the value in the text box.
focus - Fired whenever the component receives focus.
killFocus - Fired whenever the component loses focus.
tabFocus - Fired whenever the component receives focus by pressing the TAB key.


Author:
Flashloaded - www.flashloaded.com


Field Summary

public
addEventListener: Function
See the EventDispatcher Class in Flash Help

public
changeHandler: Function
Can be used to assign a direct event handler to the component instance.

public
eventOnValue: Boolean
Can be used to choose whetever the event handler will be called when the value has been set by code. This variable is set to true by default.

public
focusHandler: Function
Can be used to assign a direct event handler to the component instance.

public
killFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

public
removeEventListener: Function
See the EventDispatcher Class in Flash Help

public
tabFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Fields inherited from class com.bjc.core.BJCComponent

version

Property Summary

public
position: String (write)
Sets the position where the color chooser will open.

public
position: String (read)
Gets the position where the color chooser will open.

public
value: Number (write)
Sets the color in the color chooser. This will fire the change event if the eventOnValue is set to true (changed in version 1.3).

public
value: Number (read)
Retrieves the currently set color in the color chooser.

Properties inherited from class com.bjc.core.BJCComponent

disabledAlpha, enabled, focusTime, height, keyEnabled, style, width

Constructor

public
ColorChooser ( Void)


Method Summary

public static
create ( target: MovieClip, id: String, depth: Number, initObj: Object ): ColorChooser
Static method used to create an instance of a ColorChooser on stage at run time.

Methods inherited from class com.bjc.core.BJCComponent

draw, invalidate, move, remove, setSize



Field Documentation

addEventListener

public var addEventListener: Function
See the EventDispatcher Class in Flash Help

changeHandler

public var changeHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myColorChooser.changeHandler = function(){
trace("I was changed.");
}

eventOnValue

public var eventOnValue: Boolean
Can be used to choose whetever the event handler will be called when the value has been set by code. This variable is set to true by default.

Usage:
myColorChooser.eventOnValue = false;
myColorChooser.value = 0xFF0000;

focusHandler

public var focusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myColorChooser.focusHandler = function(){
trace("Set focus.");
}

killFocusHandler

public var killFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myColorChooser.killFocusHandler = function(){
trace("Kill focus.");
}

removeEventListener

public var removeEventListener: Function
See the EventDispatcher Class in Flash Help

tabFocusHandler

public var tabFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myColorChooser.tabFocusHandler = function(){
trace("Tab focus.");
}


Property Documentation

position

public position: String (write)
Sets the position where the color chooser will open.

Example:
myColorChooser.position = "topRight";

position

public position: String (read)
Gets the position where the color chooser will open.

Example:
myVar = myColorChooser.position;

value

public value: Number (write)
Sets the color in the color chooser. This will fire the change event if the eventOnValue is set to true (changed in version 1.3).

Example:
myColorChooser.value = 0xFF0000;

value

public value: Number (read)
Retrieves the currently set color in the color chooser.

Example:
myVar = myColorChooser.value;


Constructor Documentation

ColorChooser

public function ColorChooser(Void)

Method Documentation

create

public static function create(target: MovieClip,
 id: String,
 depth: Number,
 initObj: Object): ColorChooser
Static method used to create an instance of a ColorChooser on stage at run time.

Parameters:
target
the movie clip to which the color chooser will be attached.
id
the instance name given to the new color chooser attached.
depth
the depth at which to attach the new color chooser.
initObj
(optional) an object containing any properties you want to assign to the component when it is created
Returns:
a reference to the new color chooser attached.

Example:
import com.bjc.controls.ColorChooser;
var newColorChooser:ColorChooser = ColorChooser.create(_root, "myColorChooser", 0);


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com