My account
Shopping cart
Knowledge base

Using event listeners

1. Open o new file in Adobe Flash CS3 (File>New Document). Drag an accordion menu on the stage from the Components palette and set up the menu in the Component inspector. It is very important to set the instance name of your menu to accordionMenu.

2. If you canít find the accordion component, please see the How to install a MXP file tutorial. If you have trouble configuring your accordion menu please see the How to find Help for Jumpeye components.

3. Before you continue with this tutorial please read the Create a Simple Accordion menu tutorial.

4. You will need an xml file for this component to work. You can create your own xml file or you can use this file that Iíve used.

5. Create a new layer and name it actions. Write the following code :

import com.jumpeye.Events.AccordionMenuEvents;

accordionMenu.addEventListener(AccordionMenuEvents.ITEM_RELEASE, itemReleaseHandler);
function itemReleaseHandler(evt:AccordionMenuEvents):void {
     trace("onRelease event on item: " + evt.item.title);

6. Next hit Ctrl+Enter (Command+Enter on Mac) to test your movie. On every click the output window should display the itemís title. Below is the image of the Output window after Iíve pressed the item labeled ďHomeĒ.

Other event listeners are available on the event help page.

7. Comment out the trace statement and try to load a movieclip using this listener.