Need to remove right click menu if it doesnt have a parent

I have a web site built in flash and an admin panel built in flash that you access via right click. It loads admin.swf.

Basically I want to remove the right click menu if a user goes directly to http://blah.com/admin.swf

If I do stage.showDefaultContextMenu = false;

the second I load the admin panel, it removes my context menu that I built in my parent movie. Can anyone think of a solution?

EDIT::

I have this on the first frame of my admin.swf:


function controlMenu():void
{
	if (MovieClip(parent.parent.parent) == null)
	{
		stage.showDefaultContextMenu = false;
	}
}
controlMenu();

basically if the parent evaluates to null (meaning it doesnt have a parent) remove the context menu, but when I compile I get this error:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at admin_fla::MainTimeline/controlMenu()[admin_fla.MainTimeline::frame1:5]
	at admin_fla::MainTimeline/admin_fla::frame1()[admin_fla.MainTimeline::frame1:10]

which is really no surprise…I dont know how to do this :frowning: