RSS
email

Fullscreen browser in Flash



Here is a nice trick to make flash full screen from browser
Code here is for flash8, soon you can expect for AS3

1) Create New document save it some where in local drive

2) Create button in flash and be sure the button is selected and hit F9
Paste the below code

on (press) {
if (Stage["displayState"] == "normal") {
Stage["displayState"] = "fullScreen";
}else
Stage["displayState"] = "normal"
}


3) Press Shift + F12 (or) file->publish
This will create swf and html file

4) Edit html file usinh notepad; find param tags add the param tag below to the params in html and save
<param name="allowFullScreen" value="true"/>

5) Run the html


Code Explanation:
Stage["displayState"] this holds the fullsceen or normal value of the flash player
And we simply toggling these values


Note:
This will work only if flash player 9, no problem if u have flash8 software

Install flash9_player

Bookmark and Share

9 comments:

Saravanan said...

Hi,

Nope we cannot edit that..

~sara~

jdclements said...

Thanks. This worked great.

Anonymous said...

hey cool it works great....:):)

Ilias Sounas said...

It works perfect!
Thank you very much:)

Krista said...

Having some difficulties with doing something this simple could this be because im trying to do this with Adobe Flash CS4?

Sanapala said...

Hi All,

I am facing an issues with the screen resolution. I used this code. When a browser become full screen from flash, it is showing in screen resolutions - 1280 x 720. I want to view it in 1024 x 768 resolutions.

Please help me out.

jonadenathan said...

Great tip Sara, thanks a lot indeed.

But, due that in AS3 you cannot add code directly to an element it instead should go into an actions frame, I took the freedom to adapt it ^^

And here it is in case someone else need it:

[code]
import flash.events.MouseEvent;

buttonName.addEventListener(MouseEvent.CLICK, fullScreen);

function fullScreen(event:MouseEvent):void {
if(stage["displayState"]=="normal"){
stage["displayState"]="fullScreen";
}else{
stage["displayState"]="normal";
}
}
[/code]

Thanks again.

 

Recent Posts

Recent Visitors

Donate Me

About Me

My photo
Chennai, Tamil nadu, India
Nothing more to say about me.. Just a Action Script programmer / Flex developer having 4.5 years of experience.