Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class BitList

MovieClip
  |
  +--com.bjc.core.BJCComponent
        |
        +--com.bjc.core.LabelWrapper
              |
              +--com.bjc.controls.BitList


class BitList
extends LabelWrapper

A list component for showing a number of values and allowing the user to choose one.

Events:

change - Fired whenever the user changes the selected item of the component either by clicking a new item on the list or using the cursor keys to move to a new item.
click - Fired whenever the user clicks on an item in the list, changing the currently selected item.
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.
itemRollOver - Fired whenever the user rolls over on an item in the list.
itemRollOut - Fired whenever the user rolls off an item in the list.


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
clickHandler: Function
Can be used to assign a direct event handler to the component instance.

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
dataProvider: Array (write)
Sets the array of items used to populate the list.

public
dataProvider: Array (read)
Gets the array of items used to populate the list.

public
highlightColor: Number (write)
Sets the color to use when an item in the list is rolled over.

public
highlightColor: Number (read)
Gets the color used when an item in the list is rolled over.

public
highlightTextColor: Number (write)
Sets the font color to use when an item in the list is rolled over.

public
highlightTextColor: Number (read)
Gets the font color to use when an item in the list is rolled over.

public
rowHeight: Number (write)
Sets the height for the individual rows in the list.

public
rowHeight: Number (read)
Gets the height of the individual rows in the list.

public
scrollBarWidth: Number (write)
Sets the width of the scrollbar used in the list (if needed)

public
scrollBarWidth: Number (read)
Gets the width of the scrollbar used in the list

public
selectedColor: Number (write)
Sets the color to use when an item in the list is clicked on.

public
selectedColor: Number (read)
Gets the color used when an item in the list is clicked on.

public
selectedIndex: Number (write)
Sets the selected item.

public
selectedIndex: Number (read)
Retrieves the number of the currently selected item in the list.

public
selectedItem: Object (read-only)
A reference to the currently selected item in the list.

public
selectedTextColor: Number (write)
Sets the font color used when an item in the list is clicked on.

public
selectedTextColor: Number (read)
Gets the font color used when an item in the list is clicked on.

Properties inherited from class com.bjc.core.LabelWrapper

align, disabledColor, disableStyles, embedFont, fontColor, fontFace, fontSize, html

Properties inherited from class com.bjc.core.BJCComponent

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

Constructor

public
BitList ( Void)


Method Summary

public
addItem ( item: Object ): Void
Adds a new item to the list, tacking it on to the end of the list.

public
addItemAt ( item: Object, index: Number ): Void
Adds a new item to the list, placing it in the position specified.

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

public
removeAll ( Void ): Void
Removes all existing items from the list.

public
removeItemAt ( index: Number ): Void
Removes the item at the specified index.

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:
myList.changeHandler = function(){
trace("I was changed.");
}

clickHandler

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

Usage:
myList.clickHandler = function(){
trace("I was clicked.");
}

focusHandler

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

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

killFocusHandler

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

Usage:
myList.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:
myList.tabFocusHandler = function(){
trace("Tab focus.");
}


Property Documentation

dataProvider

public dataProvider: Array (write)
Sets the array of items used to populate the list.

Example:
var myDP:Array = ["item one", "item two", "item three"];
myList.dataProvider = myDP;

dataProvider

public dataProvider: Array (read)
Gets the array of items used to populate the list.

Example:
myVar = myList.dataProvider;

highlightColor

public highlightColor: Number (write)
Sets the color to use when an item in the list is rolled over.

Example:
myList.highlightColor = 0xcccccc;

highlightColor

public highlightColor: Number (read)
Gets the color used when an item in the list is rolled over.

Example:
myVar = myList.highlightColor;

highlightTextColor

public highlightTextColor: Number (write)
Sets the font color to use when an item in the list is rolled over.

Example:
myList.highlightTextColor = 0x555555;

highlightTextColor

public highlightTextColor: Number (read)
Gets the font color to use when an item in the list is rolled over.

Example:
myVar = myList.highlightTextColor;

rowHeight

public rowHeight: Number (write)
Sets the height for the individual rows in the list.

Example:
myList.rowHeight = 25;

rowHeight

public rowHeight: Number (read)
Gets the height of the individual rows in the list.

Example:
myVar = myList.rowHeight;

scrollBarWidth

public scrollBarWidth: Number (write)
Sets the width of the scrollbar used in the list (if needed)

Example:
myList.scrollBarWidth = 20;

scrollBarWidth

public scrollBarWidth: Number (read)
Gets the width of the scrollbar used in the list

Example:
myVar = myList.scrollBarWidth;

selectedColor

public selectedColor: Number (write)
Sets the color to use when an item in the list is clicked on.

Example:
myList.selectedColor = 0xaaaaaa;

selectedColor

public selectedColor: Number (read)
Gets the color used when an item in the list is clicked on.

Example:
myVar = myList.selectedColor;

selectedIndex

public selectedIndex: Number (write)
Sets the selected item.

Example:
myList.selectedIndex = 5;

selectedIndex

public selectedIndex: Number (read)
Retrieves the number of the currently selected item in the list.

Example:
myVar = myList.selectedIndex;

selectedItem

public selectedItem: Object (read-only)
A reference to the currently selected item in the list.

Example:
trace(myList.selectedItem.label);

selectedTextColor

public selectedTextColor: Number (write)
Sets the font color used when an item in the list is clicked on.

Example:
myList.selectedTextColor = 0x555555;

selectedTextColor

public selectedTextColor: Number (read)
Gets the font color used when an item in the list is clicked on.

Example:
myVar = myList.selectedTextColor;


Constructor Documentation

BitList

public function BitList(Void)

Method Documentation

addItem

public function addItem(item: Object): Void
Adds a new item to the list, tacking it on to the end of the list.

Parameters:
item
an object containing minimally a parameter called label. This would be the string displayed in the list. The object can also contain any other properties, usually stored in a data property. Item can also be a simple string itself.
Returns:
nothing

Example:
// using an object
myList.addItem({label:"First item", data:100});
// using a string
myList.addItem("Second Item");

addItemAt

public function addItemAt(item: Object,
 index: Number): Void
Adds a new item to the list, placing it in the position specified.

Parameters:
item
an object containing minimally a parameter called label. This would be the string displayed in the list. The object can also contain any other properties, usually stored in a data property. Item can also be a simple string itself.
index
the position at which to place the item
Returns:
nothing

Example:
// using an object
myList.addItem({label:"First item", data:100}, 3);
// using a string
myList.addItem("Second Item", 4);

create

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

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

Example:
import com.bjc.controls.BitList;
var newList:BitList = BitList.create(_root, "myList", 0);

removeAll

public function removeAll(Void): Void
Removes all existing items from the list.

Returns:
nothing

Example:
myList.removeAll();

removeItemAt

public function removeItemAt(index: Number): Void
Removes the item at the specified index.

Parameters:
index
the position of the item you want to remove
Returns:
nothing

Example:
myList.removeItemAt(1);


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com