Actionscript 3 reference

 

Events

onOpen
onOpenComplete
onClose
onCloseComplete
onItemOpenComplete
onItemClose
onItemOpenComplete
onItemClose

 

Methods

setThumbnailDimension
setImageDimension
addItem
loadFromXML
loadItems
setEasing
setZoomSpeed
clearItems
getItems
openItem
closeItem


Properties

zoom_speed
layout_style
component_rows
component_columns
navigation_mode

 

Events

onOpen

Availability

Flash Player 9

Description

Event; called when an item is opened. Event is dispatched to the component.

Example

function onOpen(e:Object) {
   trace('item clicked '+e.item.name)
}
gridNavigation.addEventListener("onOpen", onOpen);

 

 

onOpenComplete

Availability

Flash Player 9

Description

Event; called when an item finnished to open. Event is dispatched to the component.

Example

var listener = new Object();
listener.onOpenComplete = function(){
	trace ("gridNavigation item open complete"); // type event action  here.
}

gridNavigation.addEventListener("onOpenComplete", listener.onOpenComplete);

 

 

onClose

Availability

Flash Player 9

Description

Event; called when an item is closed. Event is dispatched to the component.

Example

var listener = new Object();
listener.onClose = function(){
	trace ("gridNavigation item close"); // type event action  here.
}

gridNavigation.addEventListener("onClose", listener.onClose);

 

 

onCloseComplete

Availability

Flash Player 9

Description

Event; called when an item finnished to close. Event is dispatched to the component.

Example

var listener = new Object();
listener.onCloseComplete = function(){
	trace ("gridNavigation item close complete"); // type event action  here.
}

gridNavigation.addEventListener("onCloseComplete", listener.onCloseComplete);


onItemOpenComplete

Availability

Flash Player 9

Description

Event; called when the item finnished to close. Event is dispatched to the grid item.

Example

var listener = new Object();
listener.onItemOpenComplete = function(){
clip_mc.play(); trace ("gridNavigation item open complete"); // type event action here. } this.parent.addEventListener("onItemOpenComplete", listener.onItemOpenComplete);

 

onItemClose

Availability

Flash Player 9

Description

Event; called when the item is about to close. Event is dispatched to the grid item.

Example

var listener = new Object();
listener.onItemClose = function(){
clip_mc.play(); trace ("gridNavigation item close complete"); // type event action here. } this.parent.addEventListener("onItemClose", listener.onItemClose);

 

onItemOpenComplete

Availability

Flash Player 9

Description

Event; called when an item finnished to opem. Event is dispatched to the grid item.

Example

var listener = new Object();
listener.onItemOpenComplete = function(){
clip_mc.gotoAndStop(1); trace ("gridNavigation item close complete"); // type event action here. } this.parent.addEventListener("onItemOpenComplete", listener.onItemOpenComplete);

 

onItemClose

Availability

Flash Player 9

Description

Event; called when an item is about to close. Event is dispatched to the grid item.

Example

var listener = new Object();
listener.onItemClose = function(){
clip_mc.gotoAndStop(1); trace ("gridNavigation item close complete"); // type event action here. } this.parent.addEventListener("onItemClose", listener.onItemClose);

 

 

Methods

setThumbnailDimension

Availability

Flash Player 9

Description

Method; set the thumbnail image dimension. If the thumbnail image size is different, the image will be resized.

Example

gridNavigation.setThumbnailDimension(100, 50);

 

 

setImageDimension

Availability

Flash Player 9

Description

Method; set the big image dimension. If the image size is different, the image will be resized.

Example

gridNavigation.setImageDimension(300, 200);

 

 

addItem

Availability

Flash Player 9

Description

Method; add a photo item to the component. First variable is thumbnail, the second variable is the big image.

Example

gridNavigation.addItem("data/images/thm/1.jpg", "data/images/img/1.jpg");
gridNavigation.addItem("data/images/thm/2.jpg", "data/images/img/2.jpg");

 

 

loadFromXML

Availability

Flash Player 9

Description

Method; loads an XML file which contains all component the variables and initialize the component. The variables in the component inspector will be ignored.

Example

gridNavigation.loadFromXML("data/gridNavigation.xml");

 

 

loadItems

Availability

Flash Player 9

Description

Method; initialize the component. Image items can be set using addItem method.

Example

gridNavigation.loadItems();


setZoomSpeed

Availability

Flash Player 9

Description

Method; change the component zoom speed. The value is in miliseconds. The parameter is a positive integer.

Example

gridNavigation.setZoomSpeed(5000);

setEasing

Availability

Flash Player 9

Description

Method; changes the easing equation. Possible values are

easenone,linear,easeinquad,easeoutquad,easeinoutquad,easeoutinquad,easeincubic,easeoutcubic,
easeinoutcubic,easeoutincubic,easeinquart,easeoutquart,easeinoutquart,easeoutinquart,easeinquint,
easeoutquint,easeinoutquint,easeoutinquint,easeinsine,easeoutsine,easeinoutsine,easeoutinsine,
easeincirc,easeoutcirc,easeinoutcirc,easeoutincirc,easeinexpo,easeoutexpo,easeinoutexpo,easeoutinexpo,
easeinelastic,easeoutelastic,easeinoutelastic,easeoutinelastic,easeinback,easeoutback,easeinoutback,
easeoutinback,easeinbounce,easeoutbounce,easeinoutbounce,easeoutinbounce

Example

gridNavigation.setEasing('linear');

 

clearItems

Availability

Flash Player 9

Description

Method; removes all the items from the component.

Example

gridNavigation.clearItems();




getItems

Availability

Flash Player 8

Description

Method; gets the array of all items

Example

gridNavigation.addEventListener("onComponentInit", init);

function init(){
   var items_mc = gridNavigation.getItems();
   items_mc[1].openItem();
}


openItem

Availability

Flash Player 8

Description

Method; opens a specific item, after the array of items has been obtained using getItems

Example

gridNavigation.addEventListener("onComponentInit", init);

function init(){
   var items_mc = gridNavigation.getItems();    
}

button1.onRelease = function(){
   items_mc[1].openItem();  
}


closeItem

Availability

Flash Player 8

Description

Method; closes the currently open item

Example

closeButton.onRelease = function(){
   gridNavigation.closeItem();
}

Inside a movie clip you would use:

close_btn.onRelease = function(){
this._parent._parent.closeItem();
}

 

Properties

zoom_speed

Availability

Flash Player 9

Description

Property; controls the animation speed when items are opened and closed. The value is in miliseconds.

The default value is 500.

Example

gridNavigation.zoom_speed = 300;

 

 

layout_style

Availability

Flash Player 9

Description

Property; controls how the items are arranged on the stage. Possible values are Top Right, Top Left, Bottom Right, Bottom Left.

Example

gridNavigation.layout_style = "Top Right";

 

component_rows

Availability

Flash Player 9

Description

Property; specifies the number of rows. If the value is 0, the component will automatically choose the number or rows.

Example

gridNavigation.component_rows = 3;

 

component_columns

Availability

Flash Player 9

Description

Property; specifies the number of columns. If the value is 0, the component will automatically choose the number or columns.

Example

gridNavigation.component_columns = 4;

 

navigation_mode

Availability

Flash Player 9

Description

Property; controls the navigation mode. Possible values are Pyramid, Grid.

Example

gridNavigation.navigation_mode = "Pyramid";