ActionScript Reference

com.bjc.menu

class BJCScrollMenu

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



class BJCScrollMenu
extends UIComponent

The BJC Scroll Menu is a highly customizable component that allows users to create scollable drop menus in Macromedia Flash. The BJC Scroll menu is designed to match the Halo-look of Macromedia components. With the BJC Scroll Menu you don't need to write a single row of ActionScript. Users may add items via the component parameters and customize the effects and the look of the component. The menu may also be controlled with the component methods, which are simple and easy to use.

Usage:
myBJCMenu.setCallback( "myCallback" ); // Set the function to call on click
 
function myCallback( index, link )
{
	trace( "item: " + value + ", link: " + link ); // This code will run on click
}
 
for( i=1; i<6; i++ )
{
	myBJCMenu.addItem( "To frame " + i, "", "$" + i, "" ); // Adds 5 items to the component. Items link to frames 1-5
}


Author:
Flashloaded - www.flashloaded.com

Version:
1.1.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
staticIcons: Array
This property may be used to set the icons of the static items.

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

public
staticTargets: Array
This property may be used to set the link targets of the static items.

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
BGColor: Number (write-only)
This property may be used to set the background color.

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

public
BrdColor1: Number (write-only)
This property may be used to set the bright border color.

public
BrdColor2: Number (write-only)
This property may be used to set the dark border color.

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

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 easing type.

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

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

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

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

public
Icon: String (write-only)
This property may be used to set the main icon.

public
MBBColor: Number (write-only)
This property may be used to set the main button border color.

public
MBColor: Number (write-only)
This property may be used to set the main button color.

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

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

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

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

public
Title: String (write-only)
This property may be used to set the main title.

Constructor


BJCScrollMenu ( )
Constructor

Method Summary

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

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

public
close ( ): Void
This method may be used to close the menu component.

public
open ( ): Void
This method may be used to open the menu component.

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



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 );
}

staticIcons

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

staticItems

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

staticTargets

public var staticTargets: Array
This property may be used to set the link targets of the static items.

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.

BGColor

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

BGGradColor

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

BrdColor1

public BrdColor1: Number (write-only)
This property may be used to set the bright border color.

BrdColor2

public BrdColor2: Number (write-only)
This property may be used to set the dark border color.

CallBackFunction

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

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 easing type.

Font

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

FontColor

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

FontSize

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

IColor

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

Icon

public Icon: String (write-only)
This property may be used to set the main icon.

MBBColor

public MBBColor: Number (write-only)
This property may be used to set the main button border color.

MBColor

public MBColor: Number (write-only)
This property may be used to set the main button color.

ROFontColor

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

SIHeight

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

Speed

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

Strength

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

Title

public Title: String (write-only)
This property may be used to set the main title.


Constructor Documentation

BJCScrollMenu

function BJCScrollMenu()
Constructor


Method Documentation

addItem

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

Usage:
myBJCMenu.addItem( "MenuItem 1", "icon1", "http://www.flashloaded.com", "_blank" );
myBJCMenu.addItem( "MenuItem 2", "icon2", "$5", "" );

Parameters:
title
The title of the item.
icon
The linkage id of the icon to be set in the menu item.
link
The link of the item. The $ -symbol in front of a number means that the link is to a frame number. The $ -symbol in front of a string means that link is to a frame name.
target
The URL target window of the item. If the link is set to an URL (for example to 'http://www.flashloaded.com'), you can set the target to define where the browser window will be opened. The default target is _blank.
Returns:
The index number of the added item.

clearMenu

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

Usage:
myBJCMenu.clearMenu();

Returns:
Nothing.

close

public function close(): Void
This method may be used to close the menu component.

Usage:
myBJCMenu.close();

Returns:
Nothing.

open

public function open(): Void
This method may be used to open the menu component.

Usage:
myBJCMenu.open();

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 the user clicks on a menu item. The index number and the link string of the clicked item will be sent to the callback function.

Usage:
myBJCMenu.setCallback( "_root.cbFunc" );
 
function cbFunc( index, link )
{
trace( "CLICKED ON ITEM: " + index + ", LINK: " + link );
}

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