Full Screen mode – AS3 Flash Player 9

29 01 2008

[UPDATED] sample site that I used the fullscreen mode: http://my-magic-circle.com.

[UPDATED] sample code added. See below.

Just came across the full-screen issue in AS3. It turned out to be pretty easy to deal with. I am stoked Flash Player 9 has this feature. Developers need to do both of the following 2 things to make this happen.

[Step One] Actionscript


	import flash.display.StageDisplayState;
	import flash.display.Sprite;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;

	public class Main extends Sprite{
		public var _fullScreen_btn:MovieClip;

		protected function handleMouseUp(me:MouseEvent):void
			if (stage.displayState == StageDisplayState.NORMAL) {
				catch (e:SecurityError){
					//if you don't complete STEP TWO below, you will get this SecurityError
					trace("an error has occured. please modify the html file to allow fullscreen mode")
		public function Main(){

[Step Two] html script (the code which embeds the .swf file in the page)

In short, you need to update the value of the param “allowFullScreen” to be “true”.

If the html script was published by Flash IDE, you need to
update two instances of “allowFullScreen” , both from “false” to “true”.

If the html script was published by Flex IDE, you need to add the param
“allowFullScreen” with the value “true” at four places.

My references:


Thanks to my friend Will Carpenter‘s help.




8 responses

24 08 2008

stupid, put some code

28 11 2008


22 05 2009

Is there a way to show only one movie clip in full screen instead of all stage?

28 05 2009

@nauris. You can define a Rectangle as the boundary of the scale. Refer to the 2nd reference link I posted. Code snippet looks like:
var scalingRect:Rectangle = new Rectangle(video.x, video.y, video.width, video.height);
stage[“fullScreenSourceRect”] = scalingRect;

21 06 2009

gratE ;).

30 11 2009

I’m a WP newb and need flash to go fullscreen on my blog http://www.lyvido.com. I’m getting “This site prohibits fullscreen activation”. Yours is the closest solution but I’m a bit confused(newb). Where exactly do I get the above codes in WP. Do I need AS(I’m assuming its a tool/language) on my computer to be able to change the WP code? I would be very grateful If you gave me a simpler step by step approach as this will be very important for my visitors. Thanks

8 08 2010
14 01 2011

I find Full Screen Button at http://www.as3tutorial.com it’s free, and jsut copy the mc your project, it’s works!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: