I want to make the browser in full screen via my flex website

I have a website that is built entirely in flex.

I want to make a button by clicking which the browser becomes full-screen. I'm not talking about flexible full-screen mode, which I mean " Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;". I do not want to use this.

The reason I do not want to use this, this flash does not support the keyboard in flexible full screen mode. But if I can make the browser in full screen mode, it will solve my goal.

I also hope that the same method will be useful for all browsers on PC and Mac.

+3
source share
2 answers

ExternalInterface javascript . , , 100%, .

//In ActionScript
public function fullScreen():void
{
  if (ExternalInterface.available) 
  {
    ExternalInterface.call("fullScreen");
  } 
  else
  {
    //Error
  }
}
//In JavaScript
function fullScreen()
{
  if (parseInt(navigator.appVersion)>3) {
    moveTo(0,0);
    resizeTo(screen.availWidth,screen.availHeight);
  }
  //on older browsers just leave it alone
}
+4

, thw-, "", , , ma case

:

<mx:Button id="fullscreen" styleName="fullscreen" click="toggleFullScreen();"/>

, : -

private function toggleFullScreen():void
{
    if(Application.application.stage.displayState == StageDisplayState.NORMAL)
    Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;
    else if(Application.application.stage.displayState == StageDisplayState.FULL_SCREEN)
     Application.application.stage.displayState = StageDisplayState.NORMAL;
}

, html-: -

, ankursharma85@in.com, u

, , "esc", , , , .

,

tc hav a gr8 time

-1

Source: https://habr.com/ru/post/1748937/


All Articles