Disabling the Flash Player default context menu in

2019-06-08 05: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条回答
该账号已被封号
2楼-- · 2019-06-08 06:54

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.

查看更多
登录 后发表回答