I want to assign an event handler to “File” but I can’t see a way of doing it. On menuItem’s you assign them an instance name so that’s easy but you can’t do that to the root Menu… any ideas?
Glad it’s not just me. did some poking around on the Macromedia website and found this…
This was from a post partly to do with our issue, they also had the menuBar gettings it’s menu from XML so I’m ignoring that… anyway the bit I noticed was this…
var menu = evt.menu;
var item = evt.menuItem;
I haven’t yet tried writing this into the code for my listener, perhaps you could it a whirl?
var myMenuData:XML = xmlData.childNodes[0];
mc_MainMenu.dataProvider = myMenuData;
var menuListener = new Object();
menuListener.__owner = this;
menuListener.change = function(evt) {
var menu = evt.menu;
var item = evt.menuItem;
if (item != undefined) {
var selItem:String = item.attributes.instanceName;
var o = this.__owner;
}
};
mc_MainMenu.addEventListener(“change”, menuListener);
// There is no change event on menuBar.
// The change listener must be set on the differents menus.
menuListener.focusIn = function(evt) {
if (this.initChange == undefined) {
this.initChange = true;
var menuObj = evt.target;
var length = menuObj.dataProvider.childNodes.length;
// no access function
for (var i = 0; i<length; i++) {
menuObj.getMenuAt(i).addEventListener(“change”, this);
}
}
}; var menu = evt.menu;
i created a menu bar the other night, now i really don’t think you can do what you originally asked, thts why i didn’t post, but it looks like you need some answers
edit: i said shrink your footer to that person with the rude comment btw not you
so jobbie78…
i think we really have a problem… i all ready had my code like you posted… so it’s not that…
and as Digitalosophy says i’m starting to think that this is impossible, and that it is one more “merda mal feita” (i say it in portuguese so i don´t ofend no one…) in FlashMX2004…
Still if i get something you will know it!..