Custom Right Click Menu
Description: Change flash's default right-click menu using actionscript.
Author: John Bezanis
Added: January 21st 2007
Version: Flash 8
Total Views: 6205
Views in the Past 7 Days: 118
Changing the right click menu is simple and takes only a few lines of code.

Place the following code in the Actions tab on the main stage:
- var linkURL="http://www.bezzmedia.com";
- var linkText="Link Text";
- //Defines a new right-click menu
- var myMenu = new ContextMenu();
- //goToThisURL is a function that gets run whenever the link is clicked
- function goToThisURL(){
- //_blank opens the link in a new window
- getURL(linkURL, "_blank");
- }
- //Create a new item for the new menu.
- var copyright = new ContextMenuItem(linkText, goToThisURL);
- //Add the item to the new menu
- myMenu.customItems.push(copyright);
- //Hide flash's built in items (zoom in, zoom out, etc)
- myMenu.hideBuiltInItems();
- //Apply the new menu
- _root.menu = myMenu;
- function someFunctionName(){
- //_self opens the link in the same window
- getURL(linkURL, "_self");
- }
- var menuItem = new ContextMenuItem("Some More Link Text", someFunctionName);
- //Add the item to the menu
- myMenu.customItems.push(menuItem);
Download Source File
Questions and Suggestions
I wants add Change size option in Right click menu of Flv Player. And in this option i wants add 680x540, 480x360, 320x240 options. How can i do this.
December 12th 2007 01:12AM - James
I'm no pro but i believe _global would hold the document's dimmentions. If you want to change the size of the player that is playing the video, that would be javascript DOM
March 22nd 2008 22:03PM - guy
yep, to change the size of your flash you need to create a javascript function that resizes your flash movie, and call that function inside the flash movie.
google it, you'll might find something related
April 10th 2008 12:04PM - JJ
Could you not just create 3 webpages with different sized movies and open them up via the right click menu?
April 24th 2008 07:04AM - mark
Add a Question or Suggestion






