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

Henry Minsky hminsky at laszlosystems.com
Tue Nov 11 21:30:24 PST 2008


Maybe if I make the bgcolor swatch be a child sprite instead of
drawing it on the main sprite, then
setting mouseEnabled won't cause views with bgcolors to eat mouse
clicks. According to the docs,
the 'mouseEnabled' flag only affects the mouse sensitivity of a
sprite, not it's children, and "mouseChildren"
is what controls the mouse sensitivity of the child sprites. I think
setting mouseChildren=false has already
solve the problem of turning off mouse events from child sprites which
hold assets.





On Tue, Nov 11, 2008 at 7:46 PM, Max Carlson <max at openlaszlo.org> wrote:
> This approach feels risky to me - any resources in the parent chain will send false mouse events again...  Why not take the dhtml approach so we can control the parents and not add risk?
>
> -----Original Message-----
> From: Henry Minsky <hminsky at laszlosystems.com>
> Sent: Monday, November 10, 2008 04:20 PM
> To: André Bargull <a.bargull at intensis.de>; Max Carlson <max at openlaszlo.org>; Laszlo-dev bug reporting <laszlo-dev at openlaszlo.org>
> Subject: proposed workaround for swf9 context menu bug
>
> 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
>
>



-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com



More information about the Laszlo-dev mailing list