ActionScript 2 Reference

com.bjc.menu

class BJCBounceMenu

mx.core.UIComponent
  |
  +--com.bjc.menu.BJCBounceMenu



class BJCBounceMenu
extends UIComponent

The BJC Bounce Menu is a highly customizable component that allows users to create vertical and horizontal menus in Macromedia Flash. Users can set the component settings via the component parameters panel and even add items to the component in that way. By using the 'Static items' and 'Static links' you don't need to code ActionScript at all. You can also define the target window for your item links. Item adding is also available via the AS methods of the component. Set the menu mode to 'Vertical' or 'Horizontal', set the item padding, item colors, text sizes and text alignment. Select your effects and customize the effect speed and methods. Create your own item text clips and pointer clips and customize them via the component parameters.

Usage:
myBJCMenu.setCallback( "myCallback" ); // Set the function to call on click
 
function myCallback( value )
{
	trace( "item" + value ); // This code will run on click
}
 
for( var i=0; i<5; i++ )
{
	myBJCMenu.addItem( "Title" + i ); // Adds 5 items to the component
}


Author:
Flashloaded - www.flashloaded.com

Version:
1.4.0


Field Summary

public
onMouseOut: Function
This event is invoked when the mouse leaves a specified item.

public
onMouseOver: Function
This event is invoked when the mouse is on a specified item.

public
staticItems: Array
This property may be used to add static items to the menu.

public
staticURLs: Array
This property may be used to set the links of the static items.

Property Summary

public
Align: String (write-only)
This property may be used to set the text alignment.

public
CallBackFunction: String (write-only)
This property may be used to set the function to be called when an item has been clicked.

public
Easing: String (write-only)
This property may be used to set the easing type.

public
Elasticity: Number (write-only)
This property may be used to set the easing elasticity.

public
EType: String (write-only)
This property may be used to set the text effect mode.

public
FontColor: Number (write-only)
This property may be used to set the font color.

public
FontROColor: Number (write-only)
This property may be used to set the font color on rollover.

public
FontSColor: Number (write-only)
This property may be used to set the font color of the selected item.

public
FontSize: Number (write-only)
This property may be used to set the font size.

public
ItemPadding: Number (write-only)
This property may be used to set the item padding.

public
Mode: String (write-only)
This property may be used to set the menu mode.

public
Pointer: String (write-only)
This property may be used to set the pointer clip.

public
PointerMode: String (write-only)
This property may be used to set the pointer mode.

public
RoSize: Number (write-only)
This property may be used to set the item scale on rollover.

public
Speed: Number (write-only)
This property may be used to set the easing speed.

public
StretchPointer: Boolean (write-only)
This property may be used to set the stretching mode of the pointer.

public
TFclip: String (write-only)
This property may be used to set the textfield clip used in items.

public
URLTgt: String (write-only)
This property may be used to set the link target.

Constructor


BJCBounceMenu ( )
Constructor

Method Summary

public
addItem ( title: String, URL: String ): Number
This method may be used to add an item to the component.

public
addItemCustom ( title: String, URL: String, urlTarget: String, size: Number, fontColor: Number, fontROColor: Number, fontSColor: Number ): Number
This method may be used to add a customized item to the component.

public
clearMenu ( ): Void
This method may be used to remove all the items in the component.

public
setCallback ( cb: String ): Void
This method may be used to set the function to be called when an item is pressed.

public
setSelected ( index: Number ): Void
This method may be used to set a specified item selected.



Field Documentation

onMouseOut

public var onMouseOut: Function
This event is invoked when the mouse leaves a specified item.

Usage:
myBJCMenu.onMouseOut = function( value )
{
trace( "MOUSEOUT: " + value );
}

onMouseOver

public var onMouseOver: Function
This event is invoked when the mouse is on a specified item.

Usage:
myBJCMenu.onMouseOver = function( value )
{
trace( "MOUSEOVER: " + value );
}

staticItems

public var staticItems: Array
This property may be used to add static items to the menu.

staticURLs

public var staticURLs: Array
This property may be used to set the links of the static items.


Property Documentation

Align

public Align: String (write-only)
This property may be used to set the text alignment.

CallBackFunction

public CallBackFunction: String (write-only)
This property may be used to set the function to be called when an item has been clicked.

Easing

public Easing: String (write-only)
This property may be used to set the easing type.

Elasticity

public Elasticity: Number (write-only)
This property may be used to set the easing elasticity.

EType

public EType: String (write-only)
This property may be used to set the text effect mode.

FontColor

public FontColor: Number (write-only)
This property may be used to set the font color.

FontROColor

public FontROColor: Number (write-only)
This property may be used to set the font color on rollover.

FontSColor

public FontSColor: Number (write-only)
This property may be used to set the font color of the selected item.

FontSize

public FontSize: Number (write-only)
This property may be used to set the font size.

ItemPadding

public ItemPadding: Number (write-only)
This property may be used to set the item padding.

Mode

public Mode: String (write-only)
This property may be used to set the menu mode.

Pointer

public Pointer: String (write-only)
This property may be used to set the pointer clip.

PointerMode

public PointerMode: String (write-only)
This property may be used to set the pointer mode.

RoSize

public RoSize: Number (write-only)
This property may be used to set the item scale on rollover.

Speed

public Speed: Number (write-only)
This property may be used to set the easing speed.

StretchPointer

public StretchPointer: Boolean (write-only)
This property may be used to set the stretching mode of the pointer.

TFclip

public TFclip: String (write-only)
This property may be used to set the textfield clip used in items.

URLTgt

public URLTgt: String (write-only)
This property may be used to set the link target.


Constructor Documentation

BJCBounceMenu

function BJCBounceMenu()
Constructor


Method Documentation

addItem

public function addItem(title: String,
URL: String): Number
This method may be used to add an item to the component.

Usage:
myBJCMenu.addItem( "MenuItem 1", "http://www.flashloaded.com" );

Parameters:
title
The title of the item.
URL
The URL of the item. May be set to null for the item not to be linked to an URL.
Returns:
The index number of the added item.

addItemCustom

public function addItemCustom(title: String,
URL: String,
urlTarget: String,
size: Number,
fontColor: Number,
fontROColor: Number,
fontSColor: Number): Number
This method may be used to add a customized item to the component.

Usage:
myBJCMenu.addItemCustom( "MenuItem 1", "http://www.beamjive.com", "_blank", 10, 0xCCCCCC, 0x000000, 0x0000FF );

Parameters:
title
The title of the item.
URL
The URL of the item. May be set to null for the item not to be linked to an URL.
urlTarget
The URL target window of the item.
size
The size of the item text.
fontColor
The default color of the item text.
fontROColor
The rollover color of the item text.
fontSColor
The selected color of the item text.
Returns:
The index number of the added item.

clearMenu

public function clearMenu(): Void
This method may be used to remove all the items in the component.

Usage:
myBJCMenu.clearMenu();

Returns:
Nothing.

setCallback

public function setCallback(cb: String): Void
This method may be used to set the function to be called when an item is pressed.

This method may be used to set the callback function of the component. The function will be called when an item is selected if the item does not have a URL. Items with URL act as normal HTTP links. The callback function is useful when applying the menu actions in Flash files.

Usage:
myBJCMenu.setCallback( "_root.cbFunc" );

Parameters:
cb
The function to be called when an item is pressed.
Returns:
Nothing.

setSelected

public function setSelected(index: Number): Void
This method may be used to set a specified item selected.

Usage:
myBJCMenu.setSelected( 10 );

Parameters:
index
The index of the item to be set selected.
Returns:
Nothing.