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
9 comments:
hi there
Yes luis
Hi,
Nope we cannot edit that..
~sara~
Thanks. This worked great.
hey cool it works great....:):)
It works perfect!
Thank you very much:)
Having some difficulties with doing something this simple could this be because im trying to do this with Adobe Flash CS4?
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.
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.
Post a Comment