ActionScript Reference - 3DMenu-AS3

Properties

blur
easingSpeed
maskMenu
preloaderBorder
preloaderColor
preloaderHeight
preloaderWidth
renderHandler
showPreloader
xmlURL

 

Methods

addItem
addItems
getItemData
getItemXML
loadXML
removeAll
removeItem
setSize
startTrack
stopTrack
trackTo

 

Events

COMPLETE_IMAGE
INIT
INIT_IMAGE
ITEM_CHANGE_ADD
ITEM_CHANGE_REMOVE
MOUSE_DOWN_ITEM
MOUSE_OUT_ITEM
MOUSE_OVER_ITEM
MOUSE_UP_ITEM
OPEN_IMAGE
PROGRESS_IMAGE

 

 

 

Properties

 

 

blur

Availability

Flash Player 9

Usage

my3DMenu.blur

Description

Property, the amount of blur.

Example

my3DMenu.blur = 20;

 

 

easingSpeed

Availability

Flash Player 9

Usage

my3DMenu.easingSpeed;

Description

Property, the easing speed of items in motion.

Example

my3DMenu.easingSpeed = 5;

 

 

maskMenu

Availability

Flash Player 9

Usage

my3DMenu.maskMenu

Description

Property, determines whether to mask the menu (true) or not (false).

Example

my3DMenu.maskMenu = false;

 

 

preloaderBorder

Availability

Flash Player 9

Usage

my3DMenu.preloaderBorder

Description

Property, the preloader border color.

Example

my3DMenu.preloaderBorder = 0x654321;

 

 

preloaderColor

Availability

Flash Player 9

Usage

my3DMenu.preloaderColor

Description

Property, the color of the preloader.

Example

my3DMenu.preloaderColor = 0x123456;

 

 

preloaderHeight

Availability

Flash Player 9

Usage

my3DMenu.preloaderHeight

Description

Property, the height of the preloader.

Example

my3DMenu.preloaderHeight = 20;

 

 

preloaderWidth

Availability

Flash Player 9

Usage

my3DMenu.preloaderWidth

Description

Property, the width of the preloader.

Example

my3DMenu.preloaderWidth = 100;

 

 

renderHandler

Availability

Flash Player 9

Usage

my3DMenu.renderHandler

Description

Property, the name of the function to be applied to items when rendering.

Example

import flash.filters.BlurFilter;

var _filter:BlurFilter=new BlurFilter();
var blur:Number=10;

function render(_mc:Sprite, info:Object){
_mc.alpha = info.depthScale2;
_filter.blurX = _filter.blurY = info.depthScale * blur;
_mc.filters = [_filter];
}

my3DMenu.renderHandler=render;

 

 

showPreloader

Availability

Flash Player 9

Usage

my3DMenu.showPreloader

Description

Property, determines whether to display the preloader (true) or not (false).

Example

my3DMenu.showPreloader = true;

 

 

xmlURL

Availability

Flash Player 9

Usage

my3DMenu.xmlURL

Description

Property, the url of the xml file used to define the menu items.

Example

trace(my3DMenu.xmlURL);

 

 

 

 

METHODS

 

 

addItem

Availability

Flash Player 9

Usage

my3DMenu.addItem(item);

Parameters

item:Object

Description

Method, adds the specified item to the component.

Example

var myItem:Object = {className:"Item", id:"item1", x:-100, y:100, z:0};
my3DMenu.addItem(myItem);

 

 

addItems

Availability

Flash Player 9

Usage

my3DMenu.addItems(items);

Parameters

items:Array

Description

Method, adds multiple items to the component.

Example

var myItems:Array = [{className:"Item", id:"item1", x:-100, y:100, z:0}, {className:"Item", id:"item2", x:-50, y:50, z:0}];
my3DMenu.addItems(myItems);

 

 

getItemData

Availability

Flash Player 9

Usage

my3DMenu.getItemData(item);

Parameters

item:String

Description

Method, if the item is initialized with actionscript this method returns the object used to initialize the specified item.

Example

var o:Object = my3DMenu.getItemData("item1");
trace(o.link);

 

 

getItemXML

Availability

Flash Player 9

Usage

my3DMenu.getItemXML(item);

Parameters

item:String

Description

Method, if the items are defined with xml, retrieves the specified node.

Example

var x:XML = my3DMenu.getItemXML("item1");
trace(x.link);

 

 

loadXML

Availability

Flash Player 9

Usage

my3DMenu.loadXML(src);

Parameters

src:String

Description

Method, loads the specified xml file.

Example

my3DMenu.loadXML("myFile.xml");

 

 

removeAll

Availability

Flash Player 9

Usage

my3DMenu.removeAll();

Description

Method, removes all items from component.

Example

my3DMenu.removeAll();

 

 

removeItem

Availability

Flash Player 9

Usage

my3DMenu.removeItem(item);

Parameters

item:String

Description

Method, removes the specified item.

Example

my3DMenu.removeItem("item1");

 

 

setSize

Availability

Flash Player 9

Usage

my3DMenu.setSize(width, height);

Parameters

width:Number, height:Number

Description

Method, sets the size of the component

Example

my3DMenu.setSize(500, 500);

 

 

startTrack

Availability

Flash Player 9

Usage

my3DMenu.startTrack(mc);

Parameters

mc:Sprite (optional)

Description

Method, moves the menu according to the position of the Mouse or Sprite.

Example

my3DMenu.startTrack(); // track to mouse position

Example

my3DMenu.startTrack(mc); // track to 'mc'

 

 

stopTrack

Availability

Flash Player 9

Usage

my3DMenu.stopTrack()

Description

Method, stops the tracking started by startTrack.

Example

my3DMenu.stopTrack();

 

 

trackTo

Availability

Flash Player 9

Usage

my3DMenu.trackTo(item);

Parameters

item:String

Description

Method, moves the specified item to the front.

Example

my3DMenu.trackTo("item1");

 

 

 

 

EVENTS

 

 

COMPLETE_IMAGE

Availability

Flash Player 9

Usage

my3DMenu.COMPLETE_IMAGE;

Description

Event, broadcast when loading is completed.

Example

import com.flashloaded.as3.Menu3DEvent;

function completeImage(evt:Menu3DEvent):void{
trace("image complete: " + evt.id);
}

my3DMenu.addEventListener(Menu3DEvent.COMPLETE_IMAGE, completeImage);

 

 

INIT

Availability

Flash Player 9

Usage

my3DMenu.INIT;

Description

Event, broadcast when the menu is initialized.

Example

import com.flashloaded.as3.Menu3DEvent;

function initMethod(evt:Menu3DEvent):void{
trace("initialization");
}

my3DMenu.addEventListener(Menu3DEvent.INIT, initMethod);

 

 

INIT_IMAGE

Availability

Flash Player 9

Usage

my3DMenu.INIT_IMAGE;

Description

Event, broadcast when an image initializes.

Example

import com.flashloaded.as3.Menu3DEvent;

function initImage(evt:Menu3DEvent):void{
trace("image initialize: " + evt.id);
}

menu.addEventListener(Menu3DEvent.INIT_IMAGE,initImage);

 

 

ITEM_CHANGE_ADD

Availability

Flash Player 9

Usage

my3DMenu.ITEM_CHANGE_ADD;

Description

Event, broadcast when items are added to the component.

Example

import com.flashloaded.as3.Menu3DEvent;

function itemAdded(evt:Menu3DEvent):void{
trace("items added: "+evt.id);
}

my3DMenu.addEventListener(Menu3DEvent.ITEM_CHANGE_ADD, itemAdded);

 

 

ITEM_CHANGE_REMOVE

Availability

Flash Player 9

Usage

my3DMenu.ITEM_CHANGE_REMOVE;

Description

Event, broadcast when items are removed from component.

Example

import com.flashloaded.as3.Menu3DEvent;

function itemRemoved(evt:Menu3DEvent):void{
trace("items removed: " + evt.id);
}

my3DMenu.addEventListener(Menu3DEvent.ITEM_CHANGE_REMOVE, itemRemoved);

 

 

MOUSE_DOWN_ITEM

Availability

Flash Player 9

Usage

my3DMenu.MOUSE_DOWN_ITEM;

Description

Event, broadcast when the mouse is pressed over an item.

Example

import com.flashloaded.as3.Menu3DEvent;

function downItem(evt:Menu3DEvent):void{
trace("mouse down: " + evt.id);
}

my3DMenu.addEventListener(Menu3DEvent.MOUSE_DOWN_ITEM, downItem);

 

 

MOUSE_OUT_ITEM

Availability

Flash Player 9

Usage

my3DMenu.MOUSE_OUT_ITEM;

Description

Event, broadcast when the mouse rolls off an item.

Example

import com.flashloaded.as3.Menu3DEvent;

function outItem(evt:Menu3DEvent):void{
trace("mouse out: "+evt.id);
}

my3DMenu.addEventListener(Menu3DEvent.MOUSE_OUT_ITEM, outItem);

 

 

MOUSE_OVER_ITEM

Availability

Flash Player 9

Usage

my3DMenu.MOUSE_OVER_ITEM;

Description

Event, broadcast when the mouse rolls over an item.

Example

import com.flashloaded.as3.Menu3DEvent;

function overItem(evt:Menu3DEvent):void{
trace("mouse over: "+evt.id);
}

my3DMenu.addEventListener(Menu3DEvent.MOUSE_OVER_ITEM, overItem);

 

 

MOUSE_UP_ITEM

Availability

Flash Player 9

Usage

my3DMenu.MOUSE_UP_ITEM;

Description

Event, broadcast when the mouse is released over an item.

Example

import com.flashloaded.as3.Menu3DEvent;

function upItem(evt:Menu3DEvent):void{
trace("mouse up: " + evt.id);
}

my3DMenu.addEventListener(Menu3DEvent.MOUSE_UP_ITEM, upItem);

 

 

OPEN_IMAGE

Availability

Flash Player 9

Usage

my3DMenu.OPEN_IMAGE;

Description

Property (read only), event broadcast when image loader open and start to load image.

Example

import com.flashloaded.as3.Menu3DEvent;

function openImage(evt:Menu3DEvent):void{
trace("image opened: "+evt.id);
}

my3DMenu.addEventListener(Menu3DEvent.OPEN_IMAGE, openImage);

 

 

PROGRESS_IMAGE

Availability

Flash Player 9

Usage

my3DMenu.PROGRESS_IMAGE;

Description

Property (read only), event broadcast when image load is in progress.

Example

import com.flashloaded.as3.Menu3DEvent;

function progressImage(evt:Menu3DEvent):void{
trace("progress image:"+evt.id);
trace("loaded:"+evt.bytesLoaded);
trace("total:"+evt.bytesTotal);
}

my3DMenu.addEventListener(Menu3DEvent.PROGRESS_IMAGE, progressImage);