My account
Shopping cart
Knowledge base

Using event listeners

1. Open o new file in Macromedia Flash (File>New Document). Drag an accordion panel 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 accordionPanel.

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

3. Before you continue with this tutorial please read the Create a Simple Accordion Panel 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 :

myEventListener = new Object();
myEventListener.onRelease= function(evtObject){
     trace("onRelease event on item: " + evtObject.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 "Chocolate".

Other event listeners are available on the events help page file.

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

Download the source files for this tutorial