ActionScript Reference

com.bjc.menu

class BJCDropMenu

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



class BJCDropMenu
extends UIComponent

The BJC Drop Menu is a highly customizable component that allows users to create vertical and horizontal two-level menus in Macromedia Flash. The BJC Drop menu is designed to match the Halo-look of Macromedia components. Users can set the component settings via the component parameters panel. By using the 'Source' parameter you don't need to code ActionScript at all. The menu is created form a very simple XML-file or object. Set the menu mode to 'Vertical right', 'Vertical left', 'Horizontal up' or 'Horizontal down', set the item padding, item colors, font and text alignment. Select your effects and customize the effect speed and methods.

Usage:
xmlObject = new XML();
xmlObject.ignoreWhite = true;
xmlObject.onLoad = function()
{
	myBJCMenu.setSource( xmlObject ); // Set the function to call on click
}
xmlObject.load( "menuSource.xml" ); // Load menu source from XML-file
 
myBJCMenu.setCallback( "myCallback" ); // Set the function to call on click
function myCallback( main, sub )
{
	trace( "ITEM: " + main + ", " + sub ); // This code will run on click
}


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.

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

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

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

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

public
Source: String (write-only)
This property may be used to set the XML source ( XML-object or XML-file ).

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.

Constructor


BJCDropMenu ( )
Constructor

Method Summary

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 ( index ): Void
This method may be used to open a submenu of 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.

public
setSource ( src: XML ): Void
This method may be used to set the XML-source of the component.



Field Documentation

onMouseOut

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

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

onMouseOver

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

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


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.

BgGR

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

BrdColor

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

BtnGR

public BtnGR: Number (write-only)
This property may be used to set the item gradient 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.

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.

ROBGColor

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

ROFontColor

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

Source

public Source: String (write-only)
This property may be used to set the XML source ( XML-object or XML-file ).

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.


Constructor Documentation

BJCDropMenu

function BJCDropMenu()
Constructor


Method Documentation

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(index): Void
This method may be used to open a submenu of the menu component.

Usage:
myBJCMenu.open( 5 );

Parameters:
index
The index number of the submenu to be opened.
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.

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

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

setSource

public function setSource(src: XML): Void
This method may be used to set the XML-source of the component.

Usage:
myBJCMenu.setSource( xmlObject );

Parameters:
src
The XML-object that will be set as source of the menu.
Returns:
Nothing.