My account
Shopping cart
Knowledge base

Knowledge Base

Important! All new questions are usually answered within the next business day.

Drop Down (Tree) Menu V3

(views: 29656)

Drop Down Menu V3 and Drop Down Tree Menu V3 are xml flash accordion menus featuring customized states, customized transitions and tweens. Here are all known issues for Drop Down Menu V3 and Drop Down Tree Menu V3, they should be similar, since basically it is the same component. If you have any questions that you think we should discuss here please let us know.

Load movies on item select

(2008-09-11 - views: 12100)
Q: How can I use the drop-down tree menu to load movies into a content box for a flash website?
A: Each menu item is created using the <item> node from the setup xml file. That node can contain different attributes with different values. You can use listeners to get the selected menu item (either ITEM_PRESS or ITEM_RELEASE) and then read the item's properties.

For example, you could add an extra attribute to each menu item to store the path and file name of the content you want to load:
            <item title="File">
                <item title="Load First Flash Movie" path="First.swf"/>
                <item title="Load Second Flash Movie" path="Second.swf"/>

When a menu item has been pressed, you can detect that event and find out the value of the path attribute:

import com.jumpeye.Events.DropDownMenuEvents;

// Create the loader object and add it inside the container_mc
// movie clip. This is not necessary, it could be placed directly
// on the root.
var contentLoader:Loader = new Loader();

// Listen for the "onRelease" event, to know when a menu item
// has been selected.
myMenu.addEventListener(DropDownMenuEvents.ITEM_RELEASE, releaseHandler);

function releaseHandler(evtObj:DropDownMenuEvents):void {
    // evt.item represents the selected menu item Each menu item
    // has extra properties that are the actual xml node attributes.
    if (evtObj.item.path != undefined) {
        var request:URLRequest = new URLRequest(evtObj.item.path);
        // If the menu item has an extra property called "path",
        // then load the content found at that location.

For the example to work, place a DropDownTreeMenuAS3 instance on the stage, name it "myMenu" and set the xmlPath property to a .xml file. Then, select the frame on which the menu is placed, bring up the Actions panel and paste the above code into it.