# Detect resolution and load respective .swf

**URL:** <https://forum.kirupa.com/t/detect-resolution-and-load-respective-swf/204109>\
**Category:** Uncategorized\
**Created:** [October 17, 2006, 6:15am UTC](https://forum.kirupa.com/t/detect-resolution-and-load-respective-swf/204109 "2006-10-17T06:15:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kerwint](https://avatars.discourse-cdn.com/v4/letter/k/7ab992/32.png) [@kerwint](https://forum.kirupa.com/u/kerwint)\
**Post date:** [October 17, 2006, 6:15am UTC](https://forum.kirupa.com/t/detect-resolution-and-load-respective-swf/204109/1 "2006-10-17T06:15:42Z")

</div>

hi,

is there any way to get e browser to detect the resolution and then get .html to auto load the respective .swf (eg. flash800.swf for 800 x 600, flash1024.swf for 1024 x 768, etc) inside that parent .html (eg. it’s flash800.swf tt is embedded inside, when a user with 1024x768 resolution visits the page, the browser will automatically replace the flash800.swf w the flash1024.swf file)?

tried something (script below) but it affects my actionscript.

[LEFT]

```auto
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function loadFlash()
{ if(screen.width > 800)
    {
        document.getElementById('flashhold').innerHTML = '<object type="application/x-shockwave-flash" data="1005x768flash" width="1005" height="768">'
        +'<param name="movie" value="1024x768flash.swf">'
        +'<\/object>';
    }
    else if(screen.width <= 800)
    {
        document.getElementById('flashhold').innerHTML = '<object type="application/x-shockwave-flash" data="780x600.swf" width="780" height="600">'
        +'<param name="movie" value="780x600flash.swf">'
        +'<\/object>';
    }
}
window.onload = loadFlash;
</script>
</head>
<body>
<div id="flashhold">
    <noscript>
        <object type="application/x-shockwave-flash" data="780x600.swf" width="780" height="600">
            <param name="movie" value="780x600flash.swf">
        </object>
    </noscript>
</div>
</body>
</html>
 

```

anybody pls help…thanks![/LEFT]
