That turns out to get done in this function:
LzCanvas.prototype.init = function (){
// set up right click menu on canvas
this.setDefaultContextMenu (this.__LZDefaultCanvasMenu);
// listen to stage resize events
this.__LZinstallStageListener();
}
which calls this method which then sets the menu on MovieClip.
LzCanvas.prototype.setDefaultContextMenu = function (cmenu){
this.setContextMenu(cmenu);
// For back compatibility, we accept either LzContextMenu or (Flash primitive) ContextMenu
if (! (cmenu instanceof ContextMenu)) {
cmenu = cmenu.__LZcontextMenu();
} else {
Debug.write("Passing a Flash ContextMenu to LzCanvas.setDefaultContextMenu is deprecated, use LzContextMenu instead");
}
MovieClip.prototype.menu = cmenu;
}
On 5/13/06, Philip Romanik <[EMAIL PROTECTED]> wrote:
Hi,
I'm removing warnings and errors from the code (on lps-legals) and found a
potential issue with LzCanvas.buildDefaultMenu. I think it's just a simple
mistake, but I want to make sure I'm not missing anything. Here's the
entire function, although the issue is on the last line of code:
LzCanvas.prototype.buildDefaultMenu = function () {
var cproto = LzCanvas.prototype;
cproto.__LZDefaultCanvasMenu = new LzContextMenu();
cproto.__LZdefaultMenuItem = new LzContextMenuItem("About OpenLaszlo...",
new
LzDelegate(cproto, '__LZdefaultMenuItemHandler'));
cproto.__LZviewSourceMenuItem = new LzContextMenuItem("View Source",
new
LzDelegate(cproto, '__LZviewSourceMenuItemHandler'));
cproto.__LZDefaultCanvasMenu.hideBuiltInItems();
cproto.__LZDefaultCanvasMenu.addItem(cproto.__LZdefaultMenuItem);
cproto.__LZDefaultCanvasMenu.addItem(cproto.__LZviewSourceMenuItem);
// Install the default menu onto MovieClip, so it shows up everywhere
by default
MovieClip.prototype.menu = __LZDefaultCanvasMenu.__LZcontextMenu();
}
The reference to __LZDefaultCanvasMenu on the final line doesn't include
cproto and an error is being generated. Before I just make the line,
MovieClip.prototype.menu = cproto.__LZDefaultCanvasMenu.__LZcontextMenu();
I figured I'd ask.
Thanks!
Phil
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
--
Henry Minsky
Software Architect
[EMAIL PROTECTED]
_______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
