Menus

Right-Click Menu

mProjector replaces the standard Flash right-click (cntl-click on a Mac using a one button mouse) menu with it's own customizable popup menu.This menu appears when the user right-mouse-clicks any visible part of the application.

By default, mProjector's right-click menu includes: 3 items effecting the application's z-order, an "About" item and a "Close" or "Quit" item.

The right-click menu can be modified or completely removed using mProjector's mMenu ActionScript class. mProjector enables you to include a event handler to respond to custom menu item selections.

The following sample creates a custom right-click menu and an event handler.

/* Custom Right Click Menu (CNTL-CLICK on one button Mac) */

// build menu
mMenu.removeAllItems();
mMenu.addItem("Minimize");
mMenu.addItem("Restore");
mMenu.addSeparator();
mMenu.addItem("Online Documentation");
mMenu.addItem("Contact Tech Support");
mMenu.addItem("Forum");
mMenu.addItem("Check for Updates");
mMenu.addSeparator();
mMenu.addItem("Visit ScreenTime Media");

// handle user selections
mMenu.onCommand = function (menuName, itemName)
{
    switch (itemName)
    {
        case "Minimize":
            mWindow.minimize();
            break;
        case "Restore":
            mWindow.restore();
            break;
        case "Online Documentation":
            mSystem.openDocument("http://www.screentime.com/software/mprojector/docs/");
            break;        
        case "Contact Tech Support":
            mSystem.openDocument("mailto:support@screentime.com");
            break;        
        case "Forum":
            getURL("http://forum.screentime.com");
            break;
        case "Check for Updates":
            mSystem.openDocument("http://www.screentime.com/mprojector/updates/");
            break;
        case "Visit ScreenTime Media":
            mSystem.openDocument("http://www.screentime.com/");
            break;	    
    }
} 

Windows System Tray Click Menu

mProjector enables customization of the Windows system tray menu. The system tray menu appears when the user right-clicks on the system tray icon.

The following sample creates a custom Windows system tray menu.

/* Custom Windows System Tray Menu */
// build menu 
mMenu.removeAllItems("System Tray Menu");
mMenu.addItem("Online Documentation", "System Tray Menu");
mMenu.addItem("Contact Tech Support", "System Tray Menu");
mMenu.addItem("Forum", "System Tray Menu");
mMenu.addItem("Check for Updates", "System Tray Menu");
mMenu.addSeparator();
mMenu.addItem("Visit ScreenTime Media", "System Tray Menu");

Mac Application Menu Bar Menus

On Macintosh, mProjector enables you to add menus to the application's menu bar. The main menu bar is shown at the top of the screen when your application is active. When adding a new menu use mMenu.createMenu() to create it and mMenu.addMenuToMenuBar() to make it visible.

The following sample adds a Help menu to the Mac application's menu bar.

/* Mac Application Menu Bar Help Menu */

// build menu
mMenu.createMenu("Help");
mMenu.addItem("Online Documentation", "Help");
mMenu.addItem("Contact Tech Support", "Help");
mMenu.addItem("Forum", "Help");
mMenu.addSeparator("Help");
mMenu.addItem("Register", "Help");
mMenu.addItem("Check for Updates", "Help");
mMenu.addItem("Visit ScreenTime", "Help");
mMenu.addMenuToMenuBar("Help");


// handle user selections
mMenu.onCommand = function (menuName, itemName)
{
	if ((itemSelected[0]=="Help") && (itemSelected[1]=="Register")) {
		//register user
	} else {
		switch (itemName)
		{
			case "Minimize":
				mWindow.minimize();
				break;
			case "Restore":
				mWindow.restore();
				break;
			case "Online Documentation":
				mSystem.openDocument("http://www.screentime.com/software/mprojector/docs/");
				break;        
			case "Contact Tech Support":
				mSystem.openDocument("mailto:support@screentime.com");
				break;        
			case "Forum":
				getURL("http://forum.screentime.com");
				break;
			case "Check for Updates":
				mSystem.openDocument("http://www.screentime.com/mprojector/updates/");
				break;
			case "Visit ScreenTime Media":
				mSystem.openDocument("http://www.screentime.com/");
				break;	    
		}
}

If you are building an application for Mac and Windows users use mSystem.isMac() and mSystem.isWindows() to implement a cross-platform menu strategy.

Implementing Cross Platform Menus

The following sample code implements a cross-platform menus.

function buildMenus() {
	/* Custom Right Click Menu (CNTL-CLICK on one button Mac) */
	mMenu.removeAllItems();
	mMenu.addItem("Minimize");
	mMenu.addItem("Restore");
	mMenu.addSeparator();
	mMenu.addItem("Online Documentation");
	mMenu.addItem("Contact Tech Support");
	mMenu.addItem("Forum");
	mMenu.addItem("Check for Updates");
	mMenu.addSeparator();
	mMenu.addItem("Visit ScreenTime Media");
	
	if (mSystem.isWindows()) {
		/* Custom Windows System Tray Menu */
		mMenu.removeAllItems("System Tray Menu");
		mMenu.addItem("Online Documentation", "System Tray Menu");
		mMenu.addItem("Contact Tech Support", "System Tray Menu");
		mMenu.addItem("Forum", "System Tray Menu");
		mMenu.addItem("Check for Updates", "System Tray Menu");
		mMenu.addSeparator();
		mMenu.addItem("Visit ScreenTime Media", "System Tray Menu");
	} else if (mSystem.isMac()) {
		/* Mac Application Menu Bar Help Menu */
		mMenu.createMenu("Help");
		mMenu.addItem("Online Documentation", "Help");
		mMenu.addItem("Contact Tech Support", "Help");
		mMenu.addItem("Forum", "Help");
		mMenu.addSeparator("Help");
		mMenu.addItem("Register", "Help");
		mMenu.addItem("Check for Updates", "Help");
		mMenu.addItem("Visit ScreenTime", "Help");
		mMenu.addMenuToMenuBar("Help");
	}
}

// handle user selections
mMenu.onCommand = function (menuName, itemName)
{
	if ((itemSelected[0]=="Help") && (itemSelected[1]=="Register")) {
		//register user
	} else {
		switch (itemName)
		{
			case "Minimize":
				mWindow.minimize();
				break;
			case "Restore":
				mWindow.restore();
				break;
			case "Online Documentation":
				mSystem.openDocument("http://www.screentime.com/software/mprojector/docs/");
				break;        
			case "Contact Tech Support":
				mSystem.openDocument("mailto:support@screentime.com");
				break;        
			case "Forum":
				getURL("http://forum.screentime.com");
				break;
			case "Check for Updates":
				mSystem.openDocument("http://www.screentime.com/mprojector/updates/");
				break;
			case "Visit ScreenTime Media":
				mSystem.openDocument("http://www.screentime.com/");
				break;	    
		}
}