swfObject 2.2 allowedFullScreen 不起作用

发布于 2024-10-11 16:17:50 字数 1064 浏览 5 评论 0原文

开发一个带有 Flash Intro 的 ASP MVC 站点,遇到一个奇怪的行为:无法进入全屏(在任何浏览器中)。 Flex应用程序有这个脚本进入全屏(AS3):

private function FullScreenOn(event:Event):void {
    this.stage.displayState = StageDisplayState.FULL_SCREEN;
}

并且加载swfObject(2.2)的HTML页面有(除其他外)这个代码:

<script type="text/javascript">
           var flashvars = {};
            flashvars.foo = "bar";
            var params = {};
            params.allowfullscreen = "true";
            var attributes = {}; 

            swfobject.embedSWF(   "<%=Url.Content("~/Assets/PlayAround.swf")%>", 
                                  "Intro", 
                                  "100%", 
                                  "100%", 
                                  "9.0.28", 
                                  flashvars, 
                                  params,
                                  attributes
                               );

        </script>

AFAIK这应该可以工作!但我收到一条错误消息,指出

SecurityError: Error #2152: 不允许全屏模式。

我缺少什么?

Developing an ASP MVC site which has a Flash Intro and encountered a strange behavior: it is impossible to go into full screen (in any browser).
Flex application has this script to go in full screen (AS3):

private function FullScreenOn(event:Event):void {
    this.stage.displayState = StageDisplayState.FULL_SCREEN;
}

and the HTML page which loads swfObject (2.2) has (amongst others) this code:

<script type="text/javascript">
           var flashvars = {};
            flashvars.foo = "bar";
            var params = {};
            params.allowfullscreen = "true";
            var attributes = {}; 

            swfobject.embedSWF(   "<%=Url.Content("~/Assets/PlayAround.swf")%>", 
                                  "Intro", 
                                  "100%", 
                                  "100%", 
                                  "9.0.28", 
                                  flashvars, 
                                  params,
                                  attributes
                               );

        </script>

AFAIK this should work! but i'm getting an error stating

SecurityError: Error #2152: Full screen mode is not allowed.

What am i missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七禾 2024-10-18 16:17:50

在我看来,您缺少 embedSWF 的参数之一(expressinstall url)

swfobject.embedSWF( swfUrl, 
                    id,
                    width,
                    height,
                    version,
                    expressInstallSwfurl,
                    flashvars,
                    params,
                    attributes, 
                    callbackFn
);

It looks to me like you are missing one of the arguments to embedSWF (the expressinstall url)

swfobject.embedSWF( swfUrl, 
                    id,
                    width,
                    height,
                    version,
                    expressInstallSwfurl,
                    flashvars,
                    params,
                    attributes, 
                    callbackFn
);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文