so in the above code I want to an instance name to be attached to “News”. As above you can do it with menu items but can you do it with the actual menu?
In this code the listener responds only for menuItems. But I also want it to respond to Menu buttons…
ie…
In the MenuBar component I have a Menu called News with no MenuItems. I also have another Menu called Multimedia with two menuItems, Music and Video.
How do you get an event response by just clicking on News if it has no instance name?
Hope this makes sense.
var homeMenuListener = new Object();
homeMenuListener.change = function(eventData) {
var clickedMenu = eventData.menu;
var clickedMenuItem = eventData.menuItem;
switch (clickedMenuItem) {
case clickedMenu.mnuMusic :
tickertar.loadMovie(“ticker.swf”);
break;
case clickedMenu.mnuVideo :
trace (“You clicked on the video menu”);
break;
}
}
multiMediaMenu.addEventListener(“change”, homeMenuListener);
newsMenu.addEventListener(“change”, homeMenuListener);