Disabling the Flash Player default context menu in OpenLaszlo applications

爷,独闯天下 提交于 2020-02-29 03:04:56

问题


When an OpenLaszlo application is deployed using the SWF10/11 runtime, is it possible to completely disable the Flash Player context menu on desktop computers?


回答1:


That's only possible starting with Flash Player 11.2. I have done a test run with a modified version of OpenLaszlo based on the flex4.6 branch, adding Flash 11.2+ support to the OpenLaszlo compiler. With the following LZX code I managed to remove the default Flash Player context menu completely:

<canvas width="100%" height="800" proxied="false">

    <passthrough when="$as3">
        import flash.events.MouseEvent;
    </passthrough>

    <handler name="oninit">
        if ($as3) {
            Debug.info(MouseEvent.RIGHT_CLICK);
            var sprite = this.getDisplayObject();
            sprite.addEventListener(MouseEvent.RIGHT_CLICK, doSomething);
        }
    </handler>

    <method name="doSomething" args="p">
        Debug.inspect(p);
    </method>

</canvas>

At the moment I'm not willing to contribute any more code to OpenLaszlo, due to the fact that Laszlo and Critical Path have been disrespecting the community in the past 2 years. I might create a private branch of OpenLaszlo where I'll add new features and bug fixes, and maybe this can be turned into a version maintained by the community.

Therefore there is no way to use this example code with a released version or a nighly build of OpenLaszlo.



来源:https://stackoverflow.com/questions/12518938/disabling-the-flash-player-default-context-menu-in-openlaszlo-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!