Tuesday, July 22, 2008

Customize right click menu in Flash





Step1: Open New document in flash (Ctrl + N)

Step2: Select first frame, right-click and paste the below code in first frame


//text
Mytext.text = "Right Click";
//INITIALIZATION
var contextM = new ContextMenu();
contextM.hideBuiltInItems();
// set Site link
var MyWebSite = new ContextMenuItem("Visite us!", goMyWebSite);
contextM.customItems.push(MyWebSite);
function goMyWebSite() {
getURL("http://www.yourweblink.com", _self);
}
//Mail
var MyForum = new ContextMenuItem("Our Forum!", goToMyForm);
contextM.customItems.push(MyForum);
function goToMyForm() {
getURL("http://www.yourweblink.com/form");
}
//contextMight
var Mycopyvar = new ContextMenuItem("contextMight © yourWebSite.com", goMycopyvar);
contextM.customItems.push(Mycopyvar);
function goMycopyvar() {
}
this.menu = contextM;


Step3: Create a secound layer & create a dynamic text field on stage , give the intence name of text feild Mytext.


Download Source : Click here

No comments: