Get ready for BLACK FRIDAY shopping starting in

3D ImageFlow Gallery Reference

Dazzle your viewers with 3D photo navigation. Create an amazing gallery with cool  perspective effects in seconds and give your photos stunning 3d and camera effects.  The component is fully ActionScript 2 compatible.
 

Make sure to take a look at the online documentation as well.

Gallery.change

Usage

Usage 1:

var listenerObject:Object = new Object();
listenerObject.change = function(eventObject:Object) {
    // Your code here
};

Usage 2:

on (change) {
    // Your code here
}

Description

Event; broadcast to all registered listeners when the selected index of the gallery changes as a result of user interaction.

The first usage example uses a dispatcher/listener event model. A component instance dispatches an event (in this case, change) and the event is handled by a function, also called a handler, on a listener object (listenerObject) that you create. You define a method with the same name as the event on the listener object; the method is called when the event is triggered. When the event is triggered, it automatically passes an event object (eventObject) to the listener object method. Each event object has properties that contain information about the event. You can use these properties to write code that handles the event. For more information, see EventDispatcher class (API).

Finally, you call the addEventListener() method on the component instance that broadcasts the event to register the listener with the instance. When the instance dispatches the event, the listener is called.

The second usage example uses an on() handler and must be attached directly to a Gallery instance. The keyword this, used inside an on() handler attached to a component, refers to the component instance.

Example

The following example displays the description of the selected item whenever the selection changes. To try this example, drag a Gallery component to the Stage and give it the instance name my_gallery. Add the following code to Frame 1 in the timeline:

var my_gallery:com.flzone.imageflow.Gallery;
my_gallery.addItem({url:"me.jpg", description:"This is me"});
my_gallery.addItem({url:"colleagues.jpg", description:"My colleagues"});
my_gallery.addItem({url:"office.jpg", description:"The office"});
var galleryListener:Object = new Object();
galleryListener.change = function(evt_obj:Object) {
    trace(evt_obj.target.selectedItem.description);
};
My_gallery.addEventListener("change", galleryListener);


Comments

Be the first to write a comment

You must me logged in to write a comment.