1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
|
////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////FUNCTION FOR RIGHT CLICK MENU//////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
///////////// An empty fuction like this one does nothing and we're going to attach ////////////////
///////////// it to a button on right-click menu so if you click - nothing happens ////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
function noclick() {
}
//////////////////////////// DEFINING WHAT HAPPENS ON LOAD /////////////////////////////////////////
onSelfEvent (Load) {
{
//////////////////////THIS IS THE CODE FOR YOUR RIGHT CLICK MENU////////////////////////////////////
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var button1:ContextMenuItem = new ContextMenuItem("Main Menu:", noclick, false, false, true);
var button2:ContextMenuItem = new ContextMenuItem("News", noclick);
var button3:ContextMenuItem = new ContextMenuItem("Something else", noclick);
var button4:ContextMenuItem = new ContextMenuItem("Site Design By:", noclick, true, false, true);
var button5:ContextMenuItem = new ContextMenuItem("© 2007 Someone", noclick);
////////////// EXPLAINING "true, true, true" AND OTHER VARIATIONS //////////////////////////////////
//////////////////////////// IMAGINE THEM AS "a, b, c" /////////////////////////////////////////////
///// "a" - true means that there is a line above it, false means there is no line /////////////////
///// "b" - true means that it's selectible (not gray), false means it's not selectable (gray) /////
///// "c" - true means it's visible, false means it's not visible on right click ///////////////////
///// when there is no "a, b, c" the default shows: "false, true, true" ////////////////////////////
///////////////The following lines tell the movie to show the buttons on right click////////////////
myMenu.customItems.push(button1, button2, button3, button4, button5);
myMenu.onSelect = menuHandler;
_root.menu = myMenu;
};
} |