Hey,
I've created two MovieClips on the stage and they are overlapped. I've added some ActionScript (included below) to both MovieClips. This ActionScript changes the right-click menu by removing the built in items and adding a custom item. This works fine when I right-click on either MovieClip, what I want to achieve though, is for both MovieClips to add their custom item to the menu.
I'm not sure of the best way to do this, but I would have thought it could be done.
Here is the code that I currently have on each MovieClip:
Code:
onClipEvent (load) {
var localMenu = new ContextMenu();
localMenu.hideBuiltInItems();
var localMenuItemOne = new ContextMenuItem("Item One", doSomething);
localMenuItemOne.separatorBefore = true;
localMenu.customItems.push(localMenuItemOne);
this.menu = localMenu;
function doSomething () {
trace("MC1: It Worked!"); // trace("MC2: It Worked!"); for the second MC.
}
}
Any help will be greatly appreciated,
Kind Regards,
ninjakannon.