本文介绍了在OpenLaszlo应用程序中禁用Flash Player的默认上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用SWF10 / 11运行时部署OpenLaszlo应用程序时,是否可以在桌面计算机上完全禁用Flash Player上下文菜单?

/ div>

这只能从Flash Player 11.2开始。我已经使用基于flex4.6分支的OpenLaszlo修改版进行了测试运行,向OpenLaszlo编译器添加了Flash 11.2 +支持。使用下面的LZX代码,我完全删除了默认的Flash Player上下文菜单:

 < canvas width =100% height =800proxied =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 =doSomethingargs =p>
Debug.inspect(p);
< / method>

< / canvas>

目前我不愿意再向OpenLaszlo提供更多的代码,拉斯洛和关键路线在过去两年一直不尊重社区。我可能会创建一个OpenLaszlo的私人分支,我将添加新的功能和bug修复,也许这可以转化为社区维护的版本。



因此,是没有办法使用这个示例代码与发布的版本或OpenLaszlo构建。


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?

解决方案

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.

这篇关于在OpenLaszlo应用程序中禁用Flash Player的默认上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 06:19