PDA

View Full Version : GoToFullScreen Automaticly



ruiganga
May 7th, 2009, 09:25 PM
Hi

I have a code that makes the flash site go to fullscreen. I am trying to do is go to fullscreen without press a button. I have a timer to do that but I am having an error. How can I do this?

full.buttonMode = true; //optional - makes hand-cursor appear when you roll over movie clip
full.addEventListener(MouseEvent.CLICK, toggleFullscreen);

function toggleFullscreen(event:MouseEvent):void
{
trace("click");
goFull();

}

function goFull():void{
if (stage.displayState == StageDisplayState.NORMAL)
{
stage.displayState = StageDisplayState.FULL_SCREEN;
//event.target is the display object being animated, it is the target of the event - in this case is it toggle_btn
}
else
{
stage.displayState = StageDisplayState.NORMAL;
}
}

var jumpTimer:Timer = new Timer(500, 1);

jumpTimer.addEventListener(TimerEvent.TIMER, jump);

function jump(event:TimerEvent):void
{
goFull();
trace("past");
}

jumpTimer.start();

Thanks

.ral:cr
May 8th, 2009, 01:19 AM
you can't.

bonnieraymond
May 8th, 2009, 05:17 AM
due to a security issue, it is not possible to go to fullscreen automatically. There must have a user interaction (KeyPress, MouseClick) to do this.

glosrfc
May 8th, 2009, 05:33 AM
http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode.html

ruiganga
May 8th, 2009, 06:18 AM
OK

What I did was, after the preloader ends I show a button to ENTER THE SITE and in that button goToFullScreen :)

Thanks. Now I know that I can't do this :)

dail
May 9th, 2009, 07:28 AM
combining a enter site button with a fullscreen button is pretty poor dev practice if you ask me. You should explicitly ask for permission to go fullscreen, rather than simply assume it.

ruiganga
May 9th, 2009, 08:38 AM
Hi

I understand your comment. I explain it, as my opinion to my client, but he want it to be that way.

Anyway thanks for the opinion. :)

senocular
May 9th, 2009, 09:29 AM
Sounds like a client thing.

I've never stayed at a site forcing me to see it in full screen.

ruiganga
May 9th, 2009, 01:02 PM
It will not be that dramatic. The site will jump to fullscrren, but one exit full it will keep rolling normally :)