与stage.displayState问题(这是空,即使分配)。全屏AS3 [英] Problems with stage.displayState (it's null even after assignments). Fullscreen AS3

查看:806
本文介绍了与stage.displayState问题(这是空,即使分配)。全屏AS3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关的东西:

  1. 在我之前,我做了Flash Player中的安全更新全屏code工作。
  2. 尽管如此,我仍然可以全屏的Youtube现在
  3. 在我做全屏激活响应用户点击(因此没有安全阻止它据我所知)
  4. stage.displayState为空的时候,在主时间轴甚至在下面的任务。

相关code:

1)将主时间轴上:

 在Stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.align = StageAlign.RIGHT;
 

2)设置,当用户点击全屏按钮:

 进口flash.display使用*。
进口flash.events *。

/ * ... * /

this.addEventListener(MouseEvent.CLICK,modoFullScreen);

/ * ... * /

私有函数modoFullScreen(E:的MouseEvent):无效{
 尝试 {
  stage.displayState = StageDisplayState.FULL_SCREEN以;
 }
 赶上(五:引发SecurityError){
  跟踪(e.toString());
 }
}
 

3)设置当用户点击正常屏幕按钮:

  / *类似于上面,但后来我设置* /
stage.displayState = StageDisplayState.NORMAL
 

解决方案

你有没有启用全屏嵌入时?

  

要启用全屏模式,开发人员必须在一个新的变量参数的allowFullScreen,增加他们的HTML。此参数默认为false,或不允许全屏。为了让全屏幕,开发者必须设置的allowFullScreen在他们/标签真实。

http://www.adobe.com/devnet/flashplayer/articles/ full_screen_mode.html

Relevant things:

  1. I had fullscreen code working before I did a security update on the flash player.
  2. Nevertheless, I still can fullscreen Youtube right now
  3. I'm doing the fullscreen activation in response to user clicks (therefore no security is blocking it AFAIK)
  4. stage.displayState is null all the time, in the main timeline and even after assignments below.

Relevant code:

1) Set on the main timeline:

stage.scaleMode = StageScaleMode.SHOW_ALL; 
stage.align = StageAlign.RIGHT;

2) Set when a user clicks the fullscreen button:

import flash.display.*;
import flash.events.*;

/* ... */

this.addEventListener(MouseEvent.CLICK,modoFullScreen);

/* ... */

private function modoFullScreen(e:MouseEvent): void {
 try {
  stage.displayState = StageDisplayState.FULL_SCREEN;
 }
 catch (e:SecurityError) {
  trace(e.toString());  
 }
}

3) Set when a user clicks the normal screen button:

/* Similar as above, but then I set */
stage.displayState = StageDisplayState.NORMAL

解决方案

Did you enable fullscreen when embedding?

To enable full-screen mode, developers must add a new and tag parameter, allowFullScreen, to their HTML. This parameter defaults to false, or not allowing full screen. To allow full-screen, developers must set allowFullScreen to true in their / tags.

http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode.html

这篇关于与stage.displayState问题(这是空,即使分配)。全屏AS3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆