[Laszlo-dev] proposed workaround for swf9 context menu bug

Henry Minsky hminsky at laszlosystems.com
Mon Nov 10 15:20:26 PST 2008


regarding LPP-6980, the bug with context menu in swf9, I was thinking
about the following patch to swf9 LzSprite.setContextMenu

      function setContextMenu ( lzmenu ){
          if (lzmenu == null) {
              this.__contextmenu = null;
          } else {
              this.__contextmenu = lzmenu;
              var cmenu:ContextMenu = lzmenu.kernel.__LZcontextMenu();

              // TODO [hqm 2008-11] This is an attempted workaround
              // for LPP-6980. To get the context menu to work, we have
              // to set mouseEnabled=true on all parents up to the
              // root sprite
              var par = this;
              while(par is Sprite) {
                  par.mouseEnabled = true;
                  par = par.parent;
              }



So setting a contextmenu on a view would set the mouseEnabled=true on
all the chain of parent sprites up to the canvas.

It seems like this would work in many cases, and I don't know of any
other simple way to deal with this.

In DHTML, Max implemented a whole parallel hierarchy of transparent
divs to catch mouse clicks in the
same way as swf does, but maybe we can get away without
doing  something like that for this case, because context-menus are
not usually used on many views.



-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com


More information about the Laszlo-dev mailing list