ActionScript Reference

com.bjc.ui1

class BJCDnD

mx.core.UIComponent
  |
  +--com.bjc.ui1.BJCDnD


class BJCDnD
extends UIComponent

 

Usage:
for( var i=0; i<5; i++ )
{
	myBJCDnD.addElement( "clip" + i ); // Adds 5 elements to the component
}


Author:
Flashloaded - www.flashloaded.com

Version:
1.8.0


Field Summary

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

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

Property Summary

public
BarsVisible: Boolean (write-only)
This property may be used to set the top and bottom bar visibility.

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

public
BbHeight: Number (write-only)
This property may be used to set the height of the bottom bar.

public
DArrow: String (write-only)
This property may be used to set the default arrow symbol.

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

public
DDragIcon: String (write-only)
This property may be used to set the default element dragging symbol.

public
DIcon: String (write-only)
This property may be used to set the default element icon.

public
DownColor: Number (write-only)
This property may be used to set the color of component items on press.

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

public
EdCallback: String (write-only)
This property may be used to set the function to be called when the element has been dragged and dropped.

public
EdefFont: String (write-only)
This property may be used to set the default element font.

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

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

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

public
ESymbol: String (write-only)
This property may be used to set the default element symbol.

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

public
ETMode: String (write-only)
This property may be used to set the element transfer mode.

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

public
GVisibility: Number (write-only)
This property may be used to set the transperacy of the component gradient.

public
ListColor: Number (write-only)
This property may be used to set the background color of component items.

public
RoOnOff: String (write-only)
This property may be used to enable or disable rollover actions.

public
SEColor: Number (write-only)
This property may be used to set the background color of the selected element.

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

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

public
TbHeight: Number (write-only)
This property may be used to set the height of the top bar.

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

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

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

public
UpColor: Number (write-only)
This property may be used to set the rollover color of component items.

Constructor


BJCDnD ( )
Constructor

Method Summary

public
addElement ( title: String ): Number
This method may be used to add an element to the component.

public
addElementCustom ( title: String, font: String, fontColor: Number, bgColor: Number, bgUpColor: Number, bgDownColor: Number, icon: String, dragIcon: String ): Number
This method may be used to add a customized element to the component.

public
addElementIcon ( title: String, icon: String ): Number
This method may be used to add an element with a specified icon to the component.

public
getElementAt ( index: Number ): MovieClip
This method may be used to get the element at a specified index.

public
getElementsTotal ( ): Number
This method may be used to get the number of elements in the component.

public
getObjectName ( index: Number ): String
This method may be used to get the element object name.

public
getProperty ( index: Number, property: String ): String
This method may be used to get values of properties of an element object.

public
removeAll ( ): Void
This method may be used to remove all elements.

public
removeElement ( index: Number ): Void
This method may be used to remove an element at a specified index.

public
setClickCallback ( cb: String ): Void
This method may be used to set the click callback function of the component.

public
setDropCallback ( cb: String ): Void
This method may be used to set the drop callback function of the component.

public
setElementIcon ( index: Number, ico: String ): Void
This method may be used to set the icon symbol of a specified element.

public
setElementMode ( mod: String ): Void
This method may be used to set the element mode of the component.

public
setElementSymbol ( id: String ): Void
This method may be used to set the default element symbol of the component.

public
setElementTransferMode ( mod: String ): Void
This method may be used to set the element transfer mode of the component.

public
setObjectName ( index: Number, name: String ): Void
This method may be used to set the element object name.

public
setProperty ( index: Number, property: String, value: String ): Void
This method may be used to add properties to the data object of an element.

public
setScrollArrowIcon ( id: String ): Void
This method may be used to set the scroll arrow icon of the component.



Field Documentation

onMouseOut

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

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

onMouseOver

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

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


Property Documentation

BarsVisible

public BarsVisible : Boolean (write-only)
This property may be used to set the top and bottom bar visibility.

BbColor

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

BbHeight

public BbHeight : Number (write-only)
This property may be used to set the height of the bottom bar.

DArrow

public DArrow : String (write-only)
This property may be used to set the default arrow symbol.

DbColor

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

DDragIcon

public DDragIcon : String (write-only)
This property may be used to set the default element dragging symbol.

DIcon

public DIcon : String (write-only)
This property may be used to set the default element icon.

DownColor

public DownColor : Number (write-only)
This property may be used to set the color of component items on press.

EcCallback

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

EdCallback

public EdCallback : String (write-only)
This property may be used to set the function to be called when the element has been dragged and dropped.

EdefFont

public EdefFont : String (write-only)
This property may be used to set the default element font.

ElHeight

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

EMode

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

EPadding

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

ESymbol

public ESymbol : String (write-only)
This property may be used to set the default element symbol.

EtColor

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

ETMode

public ETMode : String (write-only)
This property may be used to set the element transfer mode.

GradColor

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

GVisibility

public GVisibility : Number (write-only)
This property may be used to set the transperacy of the component gradient.

ListColor

public ListColor : Number (write-only)
This property may be used to set the background color of component items.

RoOnOff

public RoOnOff : String (write-only)
This property may be used to enable or disable rollover actions.

SEColor

public SEColor : Number (write-only)
This property may be used to set the background color of the selected element.

SETxtColor

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

Speed

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

TbHeight

public TbHeight : Number (write-only)
This property may be used to set the height of the top bar.

Title

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

TitleColor

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

TitleFont

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

UpColor

public UpColor : Number (write-only)
This property may be used to set the rollover color of component items.


Constructor Documentation

BJCDnD

function BJCDnD ()
Constructor


Method Documentation

addElement

public function addElement (title: String): Number
This method may be used to add an element to the component.

This method may be used to add an element to the component. The element will be added to the end of the element list. The visuality of the element will be defined from the component parameters if the default element symbol is used. We recommend using the default element symbol for quick and easy use. You can also customize the element symbol as you like directly from the library. If you want to use your own element symbol make sure it has the same instances as the default symbol to make sure it'll work properly. By using the returned element id you can easily add properties to the data object.

Usage:
myVar = myBJCDnD.addElement( "Title1" );

Parameters:
title
The title of the element.
Returns:
The index number of the element.

addElementCustom

public function addElementCustom (title: String,
  font: String,
  fontColor: Number,
  bgColor: Number,
  bgUpColor: Number,
  bgDownColor: Number,
  icon: String,
  dragIcon: String): Number
This method may be used to add a customized element to the component.

This method may be used to add a customized element to the component. This method is practical only when the default element symbol is used. The default element symbol (BJCDnDButton) has the following instances: bg, brightBorder, darkBorder, icon and titleTF. To inherit the all the element properties, add these instances to your element clip. By using the returned element id you can easily add properties to the data object.

Usage:
myVar = myBJCDnD.addElementCustom( "Title1", "Verdana", 0xff0000, 0xffffff, 0x000000, 0xcccccc, "icon1", "icon2" );

Parameters:
title
The title of the element.
font
The title font of the element.
fontColor
The title font color.
bgColor
The background color of the element.
bgUpColor
The background color when mouse is on the element.
bgDownColor
The background color when pressed on the element.
icon
The linkage id of the element icon.
dragIcon
The linkage id of the element dragging icon.
Returns:
The index number of the element.

addElementIcon

public function addElementIcon (title: String,
  icon: String): Number
This method may be used to add an element with a specified icon to the component.

This method may be used to add an element with a specified icon to the component. The element will be added to the end of the element list. The visuality of the element will be defined from the component parameters if the default element symbol is used. We recommend using the default element symbol for quick and easy use. You can also customize the element symbol as you like directly from the library. If you want to use your own element symbol make sure it has the same instances as the default symbol to make sure it'll work properly. By using the returned element id you can easily add properties to the data object.

Usage:
myVar = myBJCDnD.addElementIcon( "Title1", "icon1" );

Parameters:
title
The title of the element.
icon
The linkage id of the element icon.
Returns:
The index number of the element.

getElementAt

public function getElementAt (index: Number): MovieClip
This method may be used to get the element at a specified index.

Usage:
myVar = myBJCDnD.getElementAt( 10 );

Parameters:
index
The index number of the element.
Returns:
The element at a specified index.

getElementsTotal

public function getElementsTotal (): Number
This method may be used to get the number of elements in the component.

Usage:
myVar = myBJCDnD.getElementsTotal();

Returns:
The number of elements in the component.

getObjectName

public function getObjectName (index: Number): String
This method may be used to get the element object name.

Usage:
myVar = myBJCDnD.getObjectName( 10 );

Parameters:
index
The index number of the element.
Returns:
The object name of a specified element.

getProperty

public function getProperty (index: Number,
  property: String): String
This method may be used to get values of properties of an element object.

Usage:
myVar = myBJCDnD.setProperty( 10, "prop1", "value1" );

Parameters:
index
The index number of the element.
property
The property of which value will be returned.
Returns:
The value of a specified object property of an element.

removeAll

public function removeAll (): Void
This method may be used to remove all elements.

Usage:
myBJCDnD.removeAll();

Returns:
Nothing.

removeElement

public function removeElement (index: Number): Void
This method may be used to remove an element at a specified index.

Usage:
myBJCDnD.removeElement( 10 );

Parameters:
index
The index number of the element to be removed.
Returns:
Nothing.

setClickCallback

public function setClickCallback (cb: String): Void
This method may be used to set the click callback function of the component.

This method may be used to set the click callback function of the component. The function is called by elements when they are clicked. The function will not be called when elements are dragged and dropped elsewhere. The function will be called with the data object and index of the caller element as a parameters.

Usage:
myBJCDnD.setClickCallback( "_root.cbFuncClick" );
function cbFuncClick( obj, index ) {
_element = index;
_oname = obj.getObjectName();
_var1 = obj.getProperty( "var1" );
_var2 = obj.getProperty( "var2" );
}

Parameters:
cb
The callback function that will be called by elements when clicked.
Returns:
Nothing.

setDropCallback

public function setDropCallback (cb: String): Void
This method may be used to set the drop callback function of the component.

This method may be used to set the drop callback function of the component. The function is called by elements when they are dragged and dropped on a target movieclip. The function will not be called when elements are clicked. The function will be called with the data object and index of the caller element as a parameters.

Usage:
myBJCDnD.setDropCallback( "_root.cbFuncDrop" );
function cbFuncDrop( obj, index ) {
_element = index;
_oname = obj.getObjectName();
_var1 = obj.getProperty( "var1" );
_var2 = obj.getProperty( "var2" );
}

Parameters:
cb
The callback function in the target movieclip that will be called by elements when drag and drop action occures.
Returns:
Nothing.

setElementIcon

public function setElementIcon (index: Number,
  ico: String): Void
This method may be used to set the icon symbol of a specified element.

Usage:
myBJCDnD.setElementIcon( 10, "icon1" );

Parameters:
index
The index number of the element.
ico
The linkage id of the icon to be set.
Returns:
Nothing.

setElementMode

public function setElementMode (mod: String): Void
This method may be used to set the element mode of the component.

This method may be used to set the element mode of the component. The 'Button' mode disables the drag and drop behavior of the component. The 'Drop item' mode disables the click behavior of the component. The 'Both' mode enables both clicking and drag and drop behaviors.

Usage:
myBJCDnD.setElementMode( "Button" );

Parameters:
mod
The mode of the component elements. The mode can be 'Button', 'Drag item' or 'Both'.
Returns:
Nothing.

setElementSymbol

public function setElementSymbol (id: String): Void
This method may be used to set the default element symbol of the component.

Usage:
myBJCDnD.setElementSymbol( "Symbol1" );

Parameters:
id
The linkage id of the element symbol to be set.
Returns:
Nothing.

setElementTransferMode

public function setElementTransferMode (mod: String): Void
This method may be used to set the element transfer mode of the component.

This method may be used to set the element transfer mode of the component. The 'Copy' mode copies an element when dragged on another BJC DnD component. The 'Move' mode copies the element to the other BJC DnD component and then removes it from the first component.

Usage:
myBJCDnD.setElementTransferMode( "Move" );

Parameters:
mod
The transfer mode of the component elements. The mode can be either 'Copy' or 'Move'.
Returns:
Nothing.

setObjectName

public function setObjectName (index: Number,
  name: String): Void
This method may be used to set the element object name.

Usage:
myBJCDnD.setObjectName( 10, "ObjectName5" );

Parameters:
index
The index number of the element.
name
The object name of the element to be set.
Returns:
Nothing.

setProperty

public function setProperty (index: Number,
  property: String,
  value: String): Void
This method may be used to add properties to the data object of an element.

Usage:
myBJCDnD.setProperty( 10, "prop1", "value1" );

Parameters:
index
The index number of the element.
property
The property to be added to the data object of the element.
value
The property value.
Returns:
Nothing.

setScrollArrowIcon

public function setScrollArrowIcon (id: String): Void
This method may be used to set the scroll arrow icon of the component.

This method may be used to set the scroll arrow symbol of the component. The arrow symbol appears in the top and bottom bars when scrolling is permitted. The same symbol will be used in both bars. The symbol in the top bar will be rotated upside down.

Usage:
myBJCDnD.setScrollArrowIcon( "Symbol1" );

Parameters:
id
The linkage id of the arrow icon to be set.
Returns:
Nothing.