Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class TabPane

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


class TabPane
extends LabelWrapper

A tabbed pane component that allows you to have several pages of content and display any single one by clicking on the appriate tab.

Events:

size - Fired whenever the component is resized.
change - Fired whenever the user changes the active tab.
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
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.

static
mergedClipParameters: Boolean


public
removeEventListener: Function
See the EventDispatcher Class in Flash Help

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

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
content: Array (read-only)
An array containing references to the attached movie clip in each tab section.

public
maxTabWidth: Number (write)
Sets the maximum width of a tab. Tabs are sized proportionately to the width of the tabpane. i.e. if the width is 200 and there are 5 tabs, each tab will be 40. If adding a new tab would cause the tab width to be less than minimum, the new tab will not be added.

public
maxTabWidth: Number (read)
Gets the maximum width of a tab.

public
minTabWidth: Number (write)
Sets the minimum width of a tab. Tabs are sized proportionately to the width of the tabpane. i.e. if the width is 200 and there are 5 tabs, each tab will be 40. If adding a new tab would cause the tab width to be less than minimum, the new tab will not be added.

public
minTabWidth: Number (read)
Gets the minimum width of a tab.

public
selectedIndex: Number (write)
Selects the specified tab.

public
selectedIndex: Number (read)
Gets the selected tab number.

public
tabAlign: String (write)
Sets the align of the tabs.

public
tabAlign: String (read)
Gets the align of the tabs.

public
tabHeight: Number (write)
Sets the height of the tab, usually this would be based on the skin you use for the tabs.

public
tabHeight: Number (read)
Gets the height of the tab.

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
TabPane ( Void)


Method Summary

public
addTab ( title: String, contentPath: String, icon: String ): Boolean
Adds a new tab to the tabpane. Tabs are sized proportionately to the width of the tabpane. i.e. if the width is 200 and there are 5 tabs, each tab will be 40. If adding a new tab would cause the tab width to be less than minimum, the new tab will not be added.

public
addTabAt ( title: String, contentPath: String, index: Number, icon: String ): Boolean
Adds a new tab to the tabpane at the specified position. Tabs are sized proportionately to the width of the tabpane. i.e. if the width is 200 and there are 5 tabs, each tab will be 40. If adding a new tab would cause the tab width to be less than minimum, the new tab will not be added.

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

public
removeAll ( Void ): Void
Removes all tabs from the tabpane

public
removeTabAt ( index: Number ): Void
Removes the tab at the specified index

public
setSize ( w: Number, h: Number ): Void
Sizes the component to the measurements specified.

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

focusHandler

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

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

killFocusHandler

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

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

mergedClipParameters

static var mergedClipParameters: Boolean

removeEventListener

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

sizeHandler

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

Usage:
myTabPane.sizeHandler = function(){
trace("I was resized.");
}

tabFocusHandler

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

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


Property Documentation

content

public content: Array (read-only)
An array containing references to the attached movie clip in each tab section.

Example:
myTabPane.content[0].addEventListener("click", this);
// this assumes that the content in tab zero is a component which broadcasts a click event

maxTabWidth

public maxTabWidth: Number (write)
Sets the maximum width of a tab. Tabs are sized proportionately to the width of the tabpane. i.e. if the width is 200 and there are 5 tabs, each tab will be 40. If adding a new tab would cause the tab width to be less than minimum, the new tab will not be added.

Example:
myTabPane.maxTabWidth = 100;

maxTabWidth

public maxTabWidth: Number (read)
Gets the maximum width of a tab.

Example:
myVar = myTabPane.maxTabWidth;

minTabWidth

public minTabWidth: Number (write)
Sets the minimum width of a tab. Tabs are sized proportionately to the width of the tabpane. i.e. if the width is 200 and there are 5 tabs, each tab will be 40. If adding a new tab would cause the tab width to be less than minimum, the new tab will not be added.

Example:
myTabPane.minTabWidth = 50;

minTabWidth

public minTabWidth: Number (read)
Gets the minimum width of a tab.

Example:
myVar = myTabPane.minTabWidth;

selectedIndex

public selectedIndex: Number (write)
Selects the specified tab.

Example:
myTab.selectedIndex = 2;

selectedIndex

public selectedIndex: Number (read)
Gets the selected tab number.

Example:
myVar = myTab.selectedIndex;

tabAlign

public tabAlign: String (write)
Sets the align of the tabs.

Example:
myTab.tabAlign = "right";

tabAlign

public tabAlign: String (read)
Gets the align of the tabs.

Example:
myVar = myTab.tabAlign;

tabHeight

public tabHeight: Number (write)
Sets the height of the tab, usually this would be based on the skin you use for the tabs.

Example:
myTab.tabHeight = 25;

tabHeight

public tabHeight: Number (read)
Gets the height of the tab.

Example:
myVar = myTab.tabHeight;


Constructor Documentation

TabPane

public function TabPane(Void)

Method Documentation

addTab

public function addTab(title: String,
 contentPath: String,
 icon: String): Boolean
Adds a new tab to the tabpane. Tabs are sized proportionately to the width of the tabpane. i.e. if the width is 200 and there are 5 tabs, each tab will be 40. If adding a new tab would cause the tab width to be less than minimum, the new tab will not be added.

Parameters:
title
a string that will be displayed in the new tab
contentPath
the linkage name of a movie clip in the library to attach in this section, or the url of an external swf or jpg to load in.
icon
the linkage name of a movie clip containing a graphic to be used as an icon for the tab (optional).
Returns:
nothing

Example:
myTabPane.addTab("Section One", "firstSectionMC");

addTabAt

public function addTabAt(title: String,
 contentPath: String,
 index: Number,
 icon: String): Boolean
Adds a new tab to the tabpane at the specified position. Tabs are sized proportionately to the width of the tabpane. i.e. if the width is 200 and there are 5 tabs, each tab will be 40. If adding a new tab would cause the tab width to be less than minimum, the new tab will not be added.

Parameters:
title
a string that will be displayed in the new tab
contentPath
the linkage name of a movie clip in the library to attach in this section, or the url of an external swf or jpg to load in.
index
icon
the linkage name of a movie clip containing a graphic to be used as an icon for the tab (optional).
Returns:
nothing

Example:
myTabPane.addTabAt("Section One", "firstSectionMC", 3);

create

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

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

Example:
import com.bjc.controls.TabPane;
var newTabPane:TabPane = TabPane.create(_root, "myTabPane", 0);

removeAll

public function removeAll(Void): Void
Removes all tabs from the tabpane

Returns:
nothing

Example:
myTabPane.removeAll();

removeTabAt

public function removeTabAt(index: Number): Void
Removes the tab at the specified index

Parameters:
index
the number of the tab (zero-indexed) to remove
Returns:
nothing

Example:
myTabPane.removeTab(4);

setSize

public function setSize(w: Number,
 h: Number): Void
Sizes the component to the measurements specified.

Overrides:

Parameters:
w
the new width of the component.
h
the new height of the component.

The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com