How to create true fullscreen movies with Flash
Flash Player 9.0.28 is the first version that supports true full screen playback for Flash movies. Unfortunately this awesome feature won't be fully supported by the Flash Authoring Environment until version 9 comes out later this year, but with a small modification to your Flash 8 installation, you can already create flash movies that make use of this feature today. Here's a simple tutorial to make your flash movie run in full screen:
Before continuing with this tutorial, make sure that you are using at least Flash Player version 9.0.28. Prior versions of Flash Player 9 (9,0,16,0 and 9,0,20,0) don't support this feature yet. You'll need to upgrade to 9,0,28,0, which happens to be the first version to also work with Vista.
The key to the new feature is a new attribute to the Stage object in ActionScript, 'displayState'. This attribute takes two inputs:
- 'fullScreen': Sets the stage to display full-screen
- 'normal': Default setting
Before you can go and set this attribute, you'll need to make a modification to your Flash 8 installation. Pull up the following file in your Flash installation folder:
Flash 8\en\First Run\Classes\FP8\Stage.as
Add the line "static var displayState:String;" to the file so it looks like this:
{
static var displayState:String;
static var align:String;
static var height:Number;
static var scaleMode:String;
static var showMenu:Boolean;
static var width:Number;
static function addListener(listener:Object):Void;
static function removeListener(listener:Object):Boolean;
}
Now you can set the displayState attribute in your flash movie. For security purposes Flash only allows the displayState to be set to fullscreen on user interaction, which means you cannot have a movie open in fullscreen mode by default. You'll need to add a button that captures the user's interaction in order to switch to full screen. In my example I simply created a toggle button:
toggle_btn.onRelease = function(){
if(Stage.displayState == "fullScreen"){
Stage.displayState = "normal";
}
else{
Stage.displayState = "fullScreen"
}
}
If you want to detect that fullscreen mode has been entered or exited, you can use a new event listener function, onFullScreen:
EventListener = new Object;
EventListener.onFullScreen = function( bFull:Boolean ){
// change to fullscreen mode has been detected
if(bFull){
v_mc.vtxt = "You are in Full Screen Mode";
}
else{
v_mc.vtxt = "Everything is back to normal";
}
}
Stage.addListener( EventListener );There's one more trick to this. Another security restriction requires a new attribute to be added to the EMBED tag, 'allowFullScreen'. You need to manually set this attribute to 'true':
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="320" height="240" id="fullscreen_flash" align="middle"><param name="movie" value="fullscreen_flash.swf" /> <param name="quality" value="high" />
<param name="allowFullScreen" value="true" /> <param name="bgcolor" value="#ffffff" />
<embed src="fullscreen_flash.swf" allowfullscreen="true" quality="high" bgcolor="#ffffff" width="320" height="240" name="fullscreen_flash" align="middle"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>
Unfortunately it seems like neither SWFObject or UFO support this new attribute, so you'll have to rely on the plain old embed tag for now.
Update: UFO does support the new attribute in version 3.21. Be sure to use the set the lowercase variable allowfullscreen:"true". SWFObject also supports it via so.addParam("allowFullScreen", "true").
And that's all you need to know to start building fullscreen flash movies. You can download the demo FLA here.
Adobe announces Flash CS5!
Thanks.
:\Documents and Settings\your name\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Classes\FP8\
Stage.as
I'm having a flashmovie that has a stage size of 600x400. in the _root i have a videoplayer called vidPlayerMc
(_root.vidPlayerMc). Now when i toggle the fullscreen button I only want the vidPlayerMc to go fullscreen, not the stage!
thanx in advance
Your wmode parameter in the object/embed tags cannot be set to transparent if you'd like to see this behavior in action! If you just cannot get your movie to go fullScreen using the example above - be sure to check your wmode!
Does this code/tutorial work with flash MX professional? I attempted the tutorial and it did not seem to work.
Fullscreen-Mode+++ - OK
Fullscreen with Fullscreen 'Button' - NOT OK :S
Any idea how to remove the button once on Full screen?
Kindest Regards
i added this after i got a publishing error, and that fixed my problem:
import flash.display.Stage;
import flash.display.StageDisplayState;
however, when i use the toggle to go back to normal mode it resizes and then the screen goes blank - any thoughts?
i've tested in safari and firefox, same results, with fp mac 9.0.80.120 and using flash cs3 w/ as 2
thank you! :o)
I've been looking for something like this for hours. Thank you very much on this article, the only thing that I am trying to accomplish now is to center the movie. I guess that is just minor details now. Keep up the good work.
JD
Rocking a 23in, 1920x1200, cinematic display.
Wondering if the picture source simply is not large enough
or
If the fullscreen aspect only works for non cinematic displays?
(tutorial source file produces large white stripe on side of pic)
###############################################################
**Error** Scene=Scene 1, layer=AS, frame=1:Line 26: There is no property with the name 'displayState'.
if(Stage.displayState == "fullScreen"){
**Error** Scene=Scene 1, layer=AS, frame=1:Line 27: There is no property with the name 'displayState'.
Stage.displayState = "normal";
**Error** Scene=Scene 1, layer=AS, frame=1:Line 30: There is no property with the name 'displayState'.
Stage.displayState = "fullScreen"
#############################################################
Any idea why this is doing this?
Thanks
Read the tutorial carefully -- you need to modify one of Flash's class files (State.as) or the code won't compile.
<param name="allowFullScreen" value="true" />
this is true ... but they never said anything about
<param name="wmode" value="transparent" />
with wmode transparent .. it doesen't work ,,, wmode .. must be defined as 'window' or empty ... i hate Adobe ...
anyone knows the code to show hide the panel or a movieclip on fullscreen and on escape show the movieclip
vk
Stage["displayState"]="fullScreen"
Want it to work?
Export the movie to the disc as an swf-file. Double-click on that swf-file and the actual FlashPlayer starts it up and all works fine, or put the swf-file into a html page and run it trough your browser.
I have no clue - what "player" Flash is running on the "Test movie" function, but hello - it aint the FlashPlayer run as a standalone app.
While working under the hood of flash also do some work in the:
__________________________________________________________________________________
AsColorSyntax.xml
Flash 8\en\First Run\ActionsPanel\AsColorSyntax.xml
....
<identifier text="CustomActions.uninstall"/>
<identifier text="Stage.showMenu"/>
<identifier text="Stage.displayState"/> <- Add this
<identifier text="Stage.scaleMode"/>
....
__________________________________________________________________________________
ActionPanel.xml
Flash 8\en\First Run\ActionsPanel\ActionScript_1_2\ActionsPanel.xml
....
<folder name="Properties" id="Properties" tiptext="Properties of the Stage object" helpid="x20B38" version="6">
<string name="displayState" tiptext="Flash movie display state: normal, fullScreen"
helpid="" text="Stage.displayState" version="9" object="Stage"/>
....
__________________________________________________________________________________
And the html files (default,Flash_With_SCORM_2004,etc.)
...
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
$PO
<embed $PEwidth="$WI" height="$HE" name="$TI" align="$HA" allowScriptAccess="sameDomain" allowFullScreen="true"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
...
__________________________________________________________________________________
Notes
1) DON'T BACKUP YOUR XML FILES. Apparently Flash is a rather intuitive program that
will search your harddrive and find every copy of the XML files... and load them twice.
2) As mentioned by Mihai Iorga and microbot - Don't use fullScreen if your page requires
wmode transparent or keystroke dependent elements like input
- they either don't work or are disabled :(
3) Good pratice - Don't display fullscreen buttons if the player is below 9.0.28.0
ie. myFullScreenButton._visible=(Stage.displayState!=undefined)
Did I forget something?
Best to you all,
Jakob E
"**Error** Scene=Scene 1, layer=AS, frame=1:Line 26: There is no property with the name 'displayState'."
In the "Control" select "Delete ASO files" and the error went away!!
This tutorial works fine..
But my actionscript doesn't work in Fulscreen mode...
I was tryin to make a Mac OS X interface, but the dock doesn't work in Fullscreen mode..
Greetz Stephen
what is the reason?
It's probably a bit late to say this, but you can still access this property via Stage["displayState"] =
[Quote]
"Very nice tutorial. Although I can't seem to get this to work. I updated the stage.as file like you have it. I downloaded your sample file and published it. But nothing. I get an error saying "There is no property with the name 'displayState'.""
I tried this tutorial and I also got the same errors:
###############################################################
**Error** Scene=Scene 1, layer=AS, frame=1:Line 26: There is no property with the name 'displayState'.
if(Stage.displayState == "fullScreen"){
**Error** Scene=Scene 1, layer=AS, frame=1:Line 27: There is no property with the name 'displayState'.
Stage.displayState = "normal";
**Error** Scene=Scene 1, layer=AS, frame=1:Line 30: There is no property with the name 'displayState'.
Stage.displayState = "fullScreen"
#############################################################
I added the line of code to the stage.as file and and added the code to mt html file, but I still can't get it to work. Where have I gone wrong?
...and it works well also with Flash MX 2004, the path of "Stage.as" file is slightly different (First Run\Classes\Stage.as instead of First Run\Classes\FP8\Stage.as) but it works!
Question: If my video is on a larger .SWF stage (not filling the stage already), how can i just have the video go fullscreen, instead of the swf it is a part of?
Thanks in advance
Justin
Also for this to behave properly in firefox on Mac,
make sure to have
'wmode' anything but 'transparent' like some guys have mentioned above.
Otherwise on Mac when trying to exit fullscreen mode, the browser will be blank until you click in the address bar or double click somewhere else.
thank goodness for the comments in this post, helped me tons!
*Error** Scene=Scene 1, layer=Actions, frame=1:Line 5: There is no property with the name 'displayState'.
if(Stage.displayState == "fullScreen"){
**Error** Scene=Scene 1, layer=Actions, frame=1:Line 6: There is no property with the name 'displayState'.
Stage.displayState = "normal";
**Error** Scene=Scene 1, layer=Actions, frame=1:Line 9: There is no property with the name 'displayState'.
Stage.displayState = "fullScreen"
Total ActionScript Errors: 3 Reported Errors: 3
I I try to add the fullscreen action command to this button, it don't works. So, because I need this passage - from first fixed frame to followings - I have done another test: I put on first frame a black mc, that cover all the stage, with the toggle_fullscreen button in the middle; the button have a second action, inside its onRelease event, that hide the black mc, showing the first frame of movie.
But - and this is the strange trouble... - when I test it in the browser this is what occur:
the first time I click the button, the movie go to fullscreen but the blach mc don't disappear. If I click again the button, going back to 'normal', and then click again going to fullscreen, this time all works fine: the movie go to fullscreen and the black mc is hide.
How can I solve this?
Which is the reason why?
I'll appreciate very much any help by you...
and comlpiments for your tut!
Great tutorial! I am a newbie and I managed to get it
to work! Is there a way to do this for a standalone
.exe player file? I wanted to put something on a CD
it do the exact same thing upon auto run? Any ideas?
Also, do you have to have the button what if I just
wanted it full screen without clicking on the button!
You guys are the best!
<pre><font color="blue">**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: There is no property with the name 'displayState'.
if(Stage.displayState == "fullScreen"){
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: There is no property with the name 'displayState'.
Stage.displayState = "normal";
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 6: There is no property with the name 'displayState'.
Stage.displayState = "fullScreen"
Total ActionScript Errors: 3 Reported Errors:3</font><pre>
I am playing with fullscreen in flash, and id does not seem to work if I try to switch to fullscreen mode without a user event (click on a button, for instance)
I also tried to do this from javascript (setvariable), with no luck so far...
Any ideas?
Thanks,
remio
It has that same error that everyone seems to have, although i have edited the file u told me to. Also i uploaded it to see if it worked just in case and it doesn't, neither does the example i downloaded from you. Thanks
After i Click the Full screen....
All i can see is a two diagonal Color of BLue and Brown..
But when I try it on XP, Its Working FINE..
After i make my Own full screen SWF ITs Working in Xp, But in Vista just like this commment happen.
_________________________________________________________
thanks for the tutorial, julian
i added this after i got a publishing error, and that fixed my problem:
import flash.display.Stage;
import flash.display.StageDisplayState;
however, when i use the toggle to go back to normal mode it resizes and then the screen goes blank - any thoughts?
i've tested in safari and firefox, same results, with fp mac 9.0.80.120 and using flash cs3 w/ as 2
thank you! :o)
# Posted By jodi Wigmore | 7/9/07 1:40 PM
_____________________________________________________________
And i also followed its rules and still not working on VIsta..
And Suggestions??
The flash i think is not working.. But i can see the Flash Movie
its just that when i click the full screen button.. it does nothing
but in Firefox it working without any problems...
works fine even out of flash7.
tested on mac osx 10.3/10.4: firefox / safari / opera.
movie? Where exactly does the code go?
movie? Where exactly does the code go?"..
create a movieclip called toggle_btn, then on frame 1 of the main movie, assign the event handler for toggle_btn,
toggle_btn.onRelease = function()
{
if(Stage.displayState == "fullScreen")
{
Stage.displayState = "normal";
}
else
{
Stage.displayState = "fullScreen"
}
}
movie? Where exactly does the code go?"..
create a movieclip called toggle_btn, then on frame 1 of the main movie, assign the event handler for toggle_btn,
toggle_btn.onRelease = function()
{
if(Stage.displayState == "fullScreen")
{
Stage.displayState = "normal";
}
else
{
Stage.displayState = "fullScreen"
}
}
THIS WORK. Thank you!
How can I center the movie in FullScreen view?
If I hit the escape key, it goes back to the regular movie size and plays on. Any thoughts?
and thanks also to all those who wrote their little fixes, which really got me going.
one thing i needed in order for this to work which was not mentioned:
for firefox, i the embed code, you should also add:
allowFullScreen="true"
within the embed tag. that did the trick for me!
Please guide.
A great tutorial I must say.
Thx
Thanks!
wanted for my website. Works PERFECTLY!
Please check this out, especially if you're bored!
Not only full screen, but check out the controls on
the towercrane (lower left of screen). Move the
bucket in/out/up/down. Kind of fun.
Also, I put "Open full window" and "Close this
window" in the upper right corner of the stage. I
think it's kind of cool but you're comments are
welcome, especially if you agree;-)
Thanks for the help.
But I still cannot get this thing to work.
I did download the SWF that is on this page and it works fine.
So I know that is a compile problem the one that I am having.
The error reads:
Scene = Scene 1, layer=SA, Frame= 1, line 26 There is no property with the name ‘displayStage’.
Like I say I already updated the Stage.as file and restarted my PC. What else can I try?
fscommand("fullscreen", "true");
and then to exit fullscreen you use:
fscommand("fullscreen", "false");
To quit the desktop app then you can use:
fscommand("quit");
i'd really like to know how to make a movieclip on the stage fullscreen rather than making the whole stage fullscreeen with a button. i'm working with as2.0 and i have a FLV file in a movie clip, i want to make a fullscreen button which would make this movieclip fullscreen when it is clicked and i don't want the other content on the stage be visible on fullscreen mode, i just want the mc to be seen on fullscreen mode.. hope i'm clear and any help would be appreciated a lot.
i desperately need a code in AS2.0 for a fullscreen button which would fullscreen only the mc on the stage and not the whole stage. I'm using Flash CS3. I already found several solutions for making the stage fullscreen on a browser but couldn't find a way to make just the movieclip fullscreen with the fullscreen button.. any help would be appreciated..
Or if somehow this can be making new versions of CS3 or CS4 ¡¡
This tool is very important
Thank you!
http://www.juliusdesign.net/ottimizzare-un-sito-fl...
sadly it is in italian, but there are sample files that can be easily undestood, hope it helps!.
rgds + great tutorial.
MARK
This tutorial was all i needed.
Short, sweet, and straight to the point!!
Thank you!
One thing I'd like to know:
Is there any way to scale the image to fill any users' resolution? At 1600 x 1200, we cover large monitors. But at 800 x 600, all that the users can see is the top corner of the image. If the monitor is a 24" or larger, we begin to see a white border filling in the extra space. Can we fix this?
Hope this helps
Thanks
This tutorial, though it seems that a few of these flash developers have got it working, does not work for me. Updated stage.as in both locations i.e docAndSettings\myname\en.... and the one in the programme files, downloaded your fla .. nothing happens when clicked on the toggle btn.. If possible pls guide me.
I've found several true full screen tutorials. The coding is different but they all have the same bug. On retuning to normal screen, a double click is necessary. Additionally, it's not just the full screen function that is disabled until a double click: all buttons in the flash file are temporarily disabled.
I didnt have to edit the class file coz am on CS3.
Thanks man, big ups.
I was trying to do it for last couple of days.
Finally, i find it.
best wishes from admec multimedia institute team, new delhi, india
for the ppl ending up with error
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: There is no property with the name 'displayState'.
go to publish settings
in the flash tab
where it says " actionscript version"
you should have ActionScript 2.0
then click the button next to it " settings"
a small window will popup
click on the button with target sign "browse to path"
select path
"C:\Program Files\Adobe\Adobe Flash CS3\en\First Run\Classes\FP8"
now publish your movie, it should work now.
one more thing the script will work if your running the swf file or if u have embedded it to the html page as in the tutorial.
best of luck
Thanks
Rebekah at http://www.webunlimited.com/