Create Context Menu with MDM Zinc

443 views Asked by At

I have the following in the main function of my Flash application but when I publish this with MDM Zinc, I still get the default Flash right-click context menu.

var openFileMenuItem:String = "Open";
var closeFileMenUItem:String = "Close File";
var exitMenuItem:String = "Quit MyApplication";

mdm.Menu.Context.onContextMenuClick = onContextMenuClickHandler;
mdm.Menu.Context.enable();
mdm.Menu.Context.insertItem(openFileMenuItem);
mdm.Menu.Context.insertItem(closeFileMenUItem);
mdm.Menu.Context.insertDivider();
mdm.Menu.Context.insertItem(exitMenuItem);


function onContextMenuClickHandler(event:mdm.Event):void
{
    switch(event.data.name)
    {
        case openFileMenuItem:
            mdm.Dialogs.prompt("open");
        break;
        case closeFileMenUItem:
            mdm.Dialogs.prompt("close");
        break;
        case exitMenuItem:
            mdm.Dialogs.prompt("exit");
        break;
    };
}

The above should work as it is pretty well taken from the online documentation for MDM Zinc, but I just get the default Flash context menu. Is there anything else I have to do?

1

There are 1 answers

0
Andy On BEST ANSWER

There is a property in MDM Zinc called "Allow Right Click". This needs to be set to "False" for the custom context menu to be displayed!