# Width/Height Auto-detection

**URL:** https://forum.kirupa.com/t/width-height-auto-detection/166103
**Category:** flash
**Created:** [October 17, 2005, 3:45am UTC](https://forum.kirupa.com/t/width-height-auto-detection/166103 "2005-10-17T03:45:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![o2pb](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@o2pb](https://forum.kirupa.com/u/o2pb)
#### Post date: [October 17, 2005, 3:45am UTC](https://forum.kirupa.com/t/width-height-auto-detection/166103/1 "2005-10-17T03:45:54Z")

</div>

Here is my problem. As you know, flash files don’t behave the same what when you ignore width/height parameters as images. Images simply show their true dimensions, while flash files show… god knows what.

Im building up a flash game database, and each one has different dimensions. Im using a custom script to manage my database, and the dimensions were hard-coded into the page that displays the flash file, like so:

```auto
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="600" height="400" align="center">
 	  <PARAM NAME=movie VALUE="http://www.omfgmedia.com/games/<? echo $filename; ?>">
 	  <PARAM NAME=quality VALUE=high>
 	 <EMBED src="http://www.omfgmedia.com/games/<? echo $filename; ?>" width="600" height="400" quality=high TYPE="application/x-shockwave-flash"
 PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"> </EMBED>
 	</OBJECT>

```

This raises problems, since not all flash files are that size, or have that width to height ratio, so some games have horizontal or vertical bars which shouldn’t be there. I could code width/height variables into each database entry for the game, but that would mean I would have to measure each game to find its true dimensions, which is a very painstaking process.

Is there a way to have javascript or whatever plugin auto-detect the true width/height and substitute the width/height variables with proper values so the game displays properly?
