ThemeForest

Fullscreen and aligning

4335 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Community Moderator
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Grew a moustache for the Envato Movember competition
  • Has been a member for 4-5 years
+6 more
Reaper-Media moderator says

wow, it’s amazing how many posts there have been about fullscreen not working, in preview, on html page etc. It’s not easy to find out how to get it to work using flashden forums. But hopefully if someone reads this thread and they have had this problem before, it will no longer be a problem.

ACTIONSCRIPT :

You can either scale your stage, or align it to a certain part of the area. I normally go with no scale and aligning the stage to top left. but the choice is yours.

Scaling:

you put this on the root

Stage.scaleMode = “noScale”; or Stage.scaleMode = “Scale”;

Aligning:

Stage.align = “LT”; i normally stick with LT (top-left) and don’t know the other variations, if you know them, please post them.

The Magic Fullscreen Function

this little code is a function you can run by:

yourBtn.onPress = toggleFullScreen

here’s the code:

click here to see code!

separated, to turn on full screen: Stage[“displayState”]=”fullScreen” to turn off full screen: Stage[“displayState”]=”normal”

If you want to detect when the screen is resized:

stageListener = new Object(); Stage.addListener(stageListener);

function alignObjects() { YOUR ACTIONS HERE }

stageListener.onResize = function() { alignObjects(); };

this works in any mc.

HTML : More often then not, the fullscreen will not work in an html page in most browsers unless you add something specific which forces the browser to allow it.

Now i use object and embed so it works accross the board on all browsers, i have tested this on windows: i explorer 6 & 7, firefox and safari, works fine. mac osx: safari, fine again. so if you just use this code, you shouldn’t have any problems.

click here to see code

the reason a lot of information is entered in twice is because different browsers look in different places. wmode and transparent makes the movieclip transparent which i find quite useful when i say, have a patterned page background. You can easily get rid of this part if you wish, (make sure you do this for bote param and embed).

If this code doesn’t work for you, or you have alternatives, feel free to post.

3867 posts
  • Author had a Free File of the Month
  • Beta Tester
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 6-7 years
+4 more
flashjunkie says

Great post, nice little tutorial for authors not sure about full screen :)

905 posts
  • Bought between 100 and 499 items
  • Has been a member for 6-7 years
  • United States
unchartedrealms says

i yall is this just for making previews on flashden or fullscrean in general?

I have never been able to find tutorials on making liquid fullscreen files. Thanks for the post Reaper

4335 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Community Moderator
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Grew a moustache for the Envato Movember competition
  • Has been a member for 4-5 years
+6 more
Reaper-Media moderator says

this is for fullscreen in general, but you can use it on flashden

by
by
by
by
by