与stage.displayState问题(这是空,即使分配)。全屏AS3 [英] Problems with stage.displayState (it's null even after assignments). Fullscreen AS3
问题描述
有关的东西:
- 在我之前,我做了Flash Player中的安全更新全屏code工作。
- 尽管如此,我仍然可以全屏的Youtube现在
- 在我做全屏激活响应用户点击(因此没有安全阻止它据我所知)
- 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:
- I had fullscreen code working before I did a security update on the flash player.
- Nevertheless, I still can fullscreen Youtube right now
- I'm doing the fullscreen activation in response to user clicks (therefore no security is blocking it AFAIK)
- 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屋!