Actionscript 2 Events

Events are called whenever the gridNavigation performs the specified action. When publishing for Actionscript 2 the gridNavigation includes the following events:

onOpen
Executed when an item is opened. Event is dispatched to the component.

onOpenComplete
Executed when an item finnished to open. Event is dispatched to the component.

onClose
Executed when an item is closed. Event is dispatched to the component.

onCloseComplete

Executed when the item finishes closing. Event is dispatched to the component.


onItemOpenComplete

Executed when the item finishes opening. Event is dispatched to the grid item.

onItemOpen

Executed when the item is to opened. Event is dispatched to the grid item.


onItemCloseComplete

Executed when the item finishes closing. Event is dispatched to the grid item.

onItemClose

Executed when the item is to closed. Event is dispatched to the grid item.

In order to use an event, you need to add a listener, which listens for the event's occurance. The following example shows how the onOpen event is called when the gridNavigation opens an item:

import mx.utils.Delegate;
import mx.events.EventDispatcher; var listener={}; listener.onOpen = function (evt) {
trace ("gridNavigation item open"); // type event action here.
} gridNavigation.addEventListener ("onOpen", listener);

The lis object now listens to the initialization event of the gridNavigation and performs the specified action.

An event object contains information that can be used. The following event objects have the same data structure:

onOpenComplete
onClose
onCloseComplete

onItemOpen
onItemOpenComplete
onItemClose

onItemCloseComplete

 

Actionscript 3 Events

Events are called whenever the gridNavigation performs the specified action. When publishing for Actionscript 3 the gridNavigation includes the following events:

onClose
Executed when an item is closed. Event is dispatched to the component.

onCloseComplete

Executed when the item finishes closing. Event is dispatched to the component.


onItemOpenComplete

Executed when the item finishes opening. Event is dispatched to the grid item.

onItemClose

Executed when the item finishes closing. Event is dispatched to the item.


onItemOpenComplete

Executed when the item finishes opening. Event is dispatched to the grid item.

onItemClose

Executed when the item finishes closing. Event is dispatched to the item.

 

Using events in Actionscript 3 is simpler than in Actionscript 2. The following example shows how the onOpen event is called when the gridNavigation opens a thumbnail:

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

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