homepage Welcome to WebmasterWorld Guest from 54.196.225.45
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Make SWF fullscreen or stretch to fill window
SWF fullscreen
jeffshead




msg:4385454
 2:26 am on Nov 10, 2011 (gmt 0)

I have searched and tried many things but I can't figure out how to make my SWF's full screen or even stretch to fill the window.

I am putting together a Flash arcade site for my daughter. There are thousands of SWF game files so variables are used to load them on the page. Many of the files do not contain a fullscreen button so I'm trying to figure out how I can give the option of stretching the SWF to full screen.

Is there such a thing as a SWF wrapper that can give fullscreen capabilities to any SWF without having to edit the action script of all of those game files?

I've even tried adding a "Full Screen" button to the page that opens the SWF in a new window but none of the examples I've come across scale or stretch the SWF to full screen.

The code below only stretches the SWF in width, not height:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("MySwf.swf", "swf_container", "100%", "100%", "10.0.0");
</script>
</head>

<body>
<div id="swf_container">
</div>
</body>
</html>


Anyone able to help me? I'm totally stumped.

The SWF must be embeded on a page because the page contains code that submits the score when it's done playing. So using a link to the SWF instead of a page will not work.

The best solution would be for me to use a wrapper if such a thing exists. However, another issue is that the site uses Smarty so I a wrapper will need to andle Smarty variables for the file name.

 

rocknbil




msg:4385589
 4:43 pm on Nov 10, 2011 (gmt 0)

You first have to allow full screen via a parameter from the page, like

your_video_object.addParam("allowFullScreen", "true");

The from within your SWF, code the full screen button to set the stage to full screen.

function fullScreen()
{
Stage.displayState = "fullScreen";
}

jeffshead




msg:4385594
 5:01 pm on Nov 10, 2011 (gmt 0)

rocknbil,

When you say "from within your SWF" are you saying edit the SWF itself?

If so, that would mean editing thousands of files.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved