My account
Shopping cart
Knowledge base
Support


Using event listeners



1. Open o new file in Adobe Flash CS3 (File>New Document). Drag a drop down tree 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 dropDownTreeMenu.



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

3. Before you continue with this tutorial please read the Create a Simple Drop Down Tree 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 (called menu_easy.xml).

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

import com.jumpeye.Events.DropDownMenuEvents;

dropDownTreeMenu.addEventListener(DropDownMenuEvents.ITEM_RELEASE, itemReleaseHandler);
function itemReleaseHandler(evt:DropDownMenuEvents):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/Subtitle 1”.



Other event listeners are available on the xml help page.

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