# Centering SWF in Browser

**URL:** https://forum.kirupa.com/t/centering-swf-in-browser/115421
**Category:** Uncategorized
**Created:** [July 8, 2004, 3:02pm UTC](https://forum.kirupa.com/t/centering-swf-in-browser/115421 "2004-07-08T15:02:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wyclef](https://avatars.discourse-cdn.com/v4/letter/w/65b543/32.png) [@wyclef](https://forum.kirupa.com/u/wyclef)
#### Post date: [July 8, 2004, 3:02pm UTC](https://forum.kirupa.com/t/centering-swf-in-browser/115421/1 "2004-07-08T15:02:39Z")

</div>

Hello,

I’m trying to center an swf in a browser without using table width and height 100% and the most promising way i’ve found so far is to set

Stage.scaleMode = “noscale”;

in the first frame and then set the width and height of the object tag in the html to 100%. However, i’m having trouble getting this to work with the doctype in some newer browsers. What am I doing wrong?

\<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”  
“[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)”\>  
\<html xmlns=“[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)”\>  
\<head\>  
\<title\>Test\</title\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” /\>  
\<meta http-equiv=“Content-Language” content=“en-us” /\>

\</head\>  
\<body bgcolor="#FFFFFF"\>  
\<object type=“application/x-shockwave-flash” data=“test.swf” width=“100%” height=“100%”\>  
\<param name=“MOVIE” value=“test.swf” /\>  
\<param name=“PLAY” value=“true” /\>  
\</object\>  
\</body\>  
\</html\>
