How to disable people from forward-ing in flash movies

var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();

Turns out that thing that pops up when you right click a movie is called a ContextMenu. So an easy way to disable it is to hide them by using hideBuiltInItems();

An item in the ContextMenu is called a ContextMenuItem.

var useless:ContextMenuItem = new ContextMenuItem(“Useless Me”, deadClick);

The 1st parameter is the label of that item. The 2nd is what function it calls if the item was clicked.

function deadClick () {

}

We just create an empty function for it. If we want to make the menu item more useful make it call a function that does something cool.

function gotoMySite () {

getURL(“http://codeanginamo.blogspot.com/”, “_top”);

}

You can add items into a menu by pushing it into the customItems stack of the ContextMenu.

myMenu.customItems.push(mySiteLink, copyrightNotice);

Then we attach it into the main timeline:

_root.menu = myMenu;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s