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
Availability
Flash Player 9
Usage
my3DMenu.blur
Description
Property, the amount of blur.
Example
my3DMenu.blur = 20;
Availability
Flash Player 9
Usage
my3DMenu.easingSpeed;
Description
Property, the easing speed of items in motion.
Example
my3DMenu.easingSpeed = 5;
Availability
Flash Player 9
Usage
my3DMenu.maskMenu
Description
Property, determines whether to mask the menu (true) or not (false).
Example
my3DMenu.maskMenu = false;
Availability
Flash Player 9
Usage
my3DMenu.preloaderBorder
Description
Property, the preloader border color.
Example
my3DMenu.preloaderBorder = 0x654321;
Availability
Flash Player 9
Usage
my3DMenu.preloaderColor
Description
Property, the color of the preloader.
Example
my3DMenu.preloaderColor = 0x123456;
Availability
Flash Player 9
Usage
my3DMenu.preloaderHeight
Description
Property, the height of the preloader.
Example
my3DMenu.preloaderHeight = 20;
Availability
Flash Player 9
Usage
my3DMenu.preloaderWidth
Description
Property, the width of the preloader.
Example
my3DMenu.preloaderWidth = 100;
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;
Availability
Flash Player 9
Usage
my3DMenu.showPreloader
Description
Property, determines whether to display the preloader (true) or not (false).
Example
my3DMenu.showPreloader = true;
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
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);
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);
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);
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);
Availability
Flash Player 9
Usage
my3DMenu.loadXML(src);
Parameters
src:String
Description
Method, loads the specified xml file.
Example
my3DMenu.loadXML("myFile.xml");
Availability
Flash Player 9
Usage
my3DMenu.removeAll();
Description
Method, removes all items from component.
Example
my3DMenu.removeAll();
Availability
Flash Player 9
Usage
my3DMenu.removeItem(item);
Parameters
item:String
Description
Method, removes the specified item.
Example
my3DMenu.removeItem("item1");
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);
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'
Availability
Flash Player 9
Usage
my3DMenu.stopTrack()
Description
Method, stops the tracking started by startTrack.
Example
my3DMenu.stopTrack();
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
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);