Work with RotationMenu Event (AS2)

Author: Last Update: 08/04/2008

Event summary for the RTMenuLite class

The following table show the event for the rotationMENU component.

 

Event

Description

onItemPress()

Broadcast when mouse clicked on the item.

onItemRollOver() Broadcast when mouse over on the item.
onItemRollOut() Broadcast when mouse move outside the item after mouse over.
onItemSelected Broadcast when the item moved to the center (i.e. move to center mean selected).

 

Example:

The following example show how to use with the events.

 //Define Event Listener Object  
var menuListener = new Object();
//Event for item clicked
menuListener .onItemPress= function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
trace(eventObj.selectedItem.url);//Ouput the url of the item url array
trace(eventObj.selectedItem.target);//Ouput the target of the item target array
}

//Event for roll over an item
menuListener .onItemRollOver = function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
}

//Event for roll out an item
menuListener .onItemRollOut = function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
}

//Event when item selected (i.e. goto center)
menuListener .onItemSelected = function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
}

//Add Event Listener
RTMenu_mc.addEventListener("onItemPress",menuListener );
RTMenu_mc.addEventListener("onItemRollOver",menuListener );
RTMenu_mc.addEventListener("onItemRollOut",menuListener );
RTMenu_mc.addEventListener("onItemSelected",menuListener );