PDA

View Full Version : Help needed to Making a custom Context Menu plug-in


360VT.co.uk
08-04-2009, 08:13 AM
Hi

I’d really like a nice Context Menu plug-in.

I know that Patrick made one,

http://flashpanos.com/plugins/patrick/context-menu-plugin-flash-panorama-player

But it seem to have a lot off options that you just do not want and can not seem to hide with his plug-in, like Zoom In, Zoom Out, Show All, Quality and Print.

All I’d like is to add my link above the FPP, setting and about Adobe Flash player links

I have the Flash scripts for a custom Context Menu, but I need help to turn it in to a plug-in

Script in AS2
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();

var mySiteLink:ContextMenuItem = new ContextMenuItem("www.SeeLincolnshire.co.uk", gotoseelincolnshire);
function gotoseelincolnshire () {
getURL("http://www.seelincolnshire.co.uk", "_top");
}
var copyrightNotice:ContextMenuItem = new ContextMenuItem("© 360VT.co.uk", goto360vt);
function goto360vt () {
getURL("http://www.360vt.co.uk", "_top");
}
var FPP_Notice:ContextMenuItem = new ContextMenuItem("About Flash Panorama Player", gotoFPP);
function gotoFPP () {
getURL("http://flashpanoramas.com/player", "_top");
}

FPP_Notice.separatorBefore = true;

myMenu.customItems.push(mySiteLink, copyrightNotice, FPP_Notice);

_root.menu = myMenu;

Script in AS3
var my_cMenu:ContextMenu = new ContextMenu();
my_cMenu.hideBuiltInItems();

var my_seelinc = new ContextMenuItem("www.SeeLincolnshire.co.uk");
var my_copyright = new ContextMenuItem("© 360VT.co.uk");
var my_FPP = new ContextMenuItem("About Flash Panorama Player");
my_cMenu.customItems.push(my_seelinc,my_copyright, my_FPP);

my_seelinc.addEventListener(ContextMenuEvent.MENU_ ITEM_SELECT, openLink1);
function openLink1(event:ContextMenuEvent){
navigateToURL(new URLRequest("http://www.seelincolnshire.co.uk"));
}

my_copyright.addEventListener(ContextMenuEvent.MEN U_ITEM_SELECT, openLink2);
function openLink2(event:ContextMenuEvent){
navigateToURL(new URLRequest("http://www.360vt.co.uk"));
}

my_FPP.addEventListener(ContextMenuEvent.MENU_ITEM _SELECT, openFPPlink);
function openFPPlink(event:ContextMenuEvent){
navigateToURL(new URLRequest("http://flashpanoramas.com/player"));
}

my_FPP.separatorBefore = true;

contextMenu = my_cMenu;

Can any one help with this

Thx Harry

PauloGGPX
08-04-2009, 05:24 PM
here you go :)

Hope it helps :)

360VT.co.uk
08-04-2009, 05:40 PM
Wow

thanks Paulo

That was quick, I new it could not be hard to do.
I’ve been trying for a week now, any chance you’re going to tell me how to do it myself.

Thanks again

Harry

PauloGGPX
08-04-2009, 06:09 PM
That's a secret ;)

really everything you need is available in the forum ;)

Just one thing, in your site you removed the About FPP context menu option... do you have a domain rebrand license from Denis?

I'll post the code as soon as I clean it :) I'm a messy programmer ;)

360VT.co.uk
08-04-2009, 06:19 PM
Just one thing, in your site you removed the About FPP context menu option... do you have a domain rebrand license from Denis?

Oops sorry Denis

that was just me playing with Patrick's plug-in


That's a secret ;)

really everything you need is available in the forum ;)

I'll post the code in as soon as I clean it :) I'm a messy programmer ;)

You know I've look all over the form and even tryed pulling some of Tommys plug-ins apart, but I could not get any think to work.

thanks again

Harry

PauloGGPX
08-04-2009, 06:23 PM
That's what I'm afraid :(

I won't make the code public because it's too easy for someone to remove the About FPP line (intentionaly or not).

I'm not saying this is the case, please don't take me wrong :)

I'll try to contact Patrick to see if we can reach a compromise, maybe his plugin could add FPP about automatically? I don't know....

PS: check your PM's ;)

360VT.co.uk
08-04-2009, 06:44 PM
Thanks again

I nearly had it too, just another month or so and I’d have worked it out myself;)