Right Click Context Menu - Important Notes:
Posted by : PhilS on Aug 02, 2008
- This will only work if the Flash movie is on a web page.
- You will need to have Flash Player 7 installed.
In the Publish settings you will need to select:
- Go to: File - Publish Settings - Flash Tab
- Select: Version - Flash Player 7
- Select: ActionScript version - ActionScript 2
- Click: OK

Publish Settings.
Here there is a problem with the context menu in-between the letters.
Click off the webwasp and you get a normal context menu. If you right click on the word webwasp you get the custom menu.
Note: Beware if you click in-between the letters you will get the standard context menu! This is because the movie clip does not have a background. Unlike a button there is no invisible hit area. You need to make a background. Of course a background could be the same colour as the movie background.
This has two items listed in the context menu.
In the movie above there are two movie clips on stage named web and wasp. You can control either one or the other move depending on which item you select from the context menu.
The actionscript in frame 1 is as follows:
var myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
//my first menu item
var webspin = new ContextMenuItem("Web Spin Spin!!!", myWebSpin);
myContextMenu.customItems.push(webspin);
function myWebSpin() {
web.gotoAndPlay(2);
}
web.menu = myContextMenu;
//my second menu item
var waspTwist = new ContextMenuItem("Wasp Twist!!!", myWaspTwist);
myContextMenu.customItems.push(waspTwist);
function myWaspTwist() {
wasp.gotoAndPlay(2);
}
wasp.menu = myContextMenu;
This last example has a different context menu depending on which word you click on. There are two movie clips on stage and each has its own context menu independent of the other. The ActionScript in frame 1 on the main stage is as follows:
//Controls 'web' menu
var myWebContextMenu = new ContextMenu();
myWebContextMenu.hideBuiltInItems();
var webspin = new ContextMenuItem("Web Spin Spin!!!", myWebSpin);
myWebContextMenu.customItems.push(webspin);
function myWebSpin() {
web.gotoAndPlay(2);
}
web.menu = myWebContextMenu;
//Controls 'wasp' menu
var myWaspContextMenu = new ContextMenu();
myWaspContextMenu.hideBuiltInItems();
var waspTwist = new ContextMenuItem("Wasp Twist!!!", myWaspTwist);
myWaspContextMenu.customItems.push(waspTwist);
function myWaspTwist() {
wasp.gotoAndPlay(2);
}
wasp.menu = myWaspContextMenu;
Note: all the variables in the first section must be different to those in the second part.
Source: http://www.webwasp.co.uk/tutorials/b16-right-click/context-menu-tute.php

no comment
Add comment