Web Development Blog

24K Design Studio :: Blog :: A simple full screen toggle button in Flash AS3
Author:
Password:
A simple full screen toggle button in Flash AS3
23:00, 11 Apr, 2011
by James

Create a button and name it btn_fullsc on stage. Using the following code in action frame.

import flash.display.StageDisplayState;

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

btn_fullsc.buttonMode = true;
btn_fullsc.addEventListener(MouseEvent.CLICK, buttonOnClick)

function buttonOnClick(event:MouseEvent):void
{
toggleFullScreen();
}

Compile and run the flash.

One more thing, make sure <param name="allowfullscreen" value="true" /> is added to the html page.

import flash.display.StageDisplayState;

function goFullScreen():void
{
    if (stage.displayState == StageDisplayState.NORMAL) {
        stage.displayState=StageDisplayState.FULL_SCREEN;
    } else {
        stage.displayState=StageDisplayState.NORMAL;
    }
}

btn_fullsc.addEventListener(MouseEvent.CLICK, _handleClick)

function _handleClick(event:MouseEvent):void
{
    goFullScreen();
}
Tags: AS3
Reply:
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 =

Reply
#1
vinod
17:19, 21 Apr, 2011
 
thanks friend that works to me and i also able to change the directions of arrows in the movieclip.
Reply
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 =

Reply
#1
yahnkekt
05:03, 25 Nov, 2015
 
1
Reply
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 =

Reply
#2
Kev
04:12, 29 Dec, 2012
 
This only issue is that any objects you have on top of the video will be behind the video and will not bubble.
Reply
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 =

Reply
#1
mbvnuhii
05:03, 25 Nov, 2015
 
1
Reply
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 =

Reply
#3
M. AL
01:21, 27 Nov, 2013
 
Very simple, *****
Reply
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 =

Reply
#1
1:1 quality high fashion womens tiger graphic short sleeve tee in light blue online wholesale
10:13, 12 Oct, 2014
 
If Men and nfl jersey crash
1:1 quality high fashion womens tiger graphic short sleeve tee in light blue online wholesale http://www.jonsolmos.com/ed-hardy-bottega-veneta-outlet-usa/high-fashion-womens-tiger-graphic-short-sleeve-tee-in-light-blue-online-p-9343.html
Reply
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 =

Reply
#2
qsvcuysv
05:03, 25 Nov, 2015
 
1
Reply
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 =

Reply
#4
dcvobmil
05:03, 25 Nov, 2015
 
1
Reply
Your name:
Only visible to the author.

Tell us you are not a robot. What is captcha1captchaOcaptcha2 =

Reply
View the latest 5 entries.