Problems with stage.displayState (it's null even after assignments). Fullscreen AS3

家住魔仙堡 提交于 2019-12-23 05:28:08

问题


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

回答1:


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



来源:https://stackoverflow.com/questions/1997155/problems-with-stage-displaystate-its-null-even-after-assignments-fullscreen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!