Link to home
Start Free TrialLog in
Avatar of socross
socrossFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Flash Swfobject 2.1 keep swf centered

Hi

I am having some real issues getting this swf to do what i want.

The Swf is 1980 by 660 and i need to keep it centered at all times whatever the screen size, especially when screen width is less than the swf width.

I cant work out if it is a css thing or a param/attribute thing.

Any suggestions would be much appreciated.

Many thanks

--s--
<!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" lang="en" xml:lang="en">
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        
		<style type="text/css"> 
        <!--
        body {
        background:#87ADAE url(images/bg.gif) repeat-x;
		margin:0;
        }
         
        #alternativeContent {
		
        }
		
        #flashContent{
		
        }
		
        --> 
        </style> 
        
        
        
		<script type="text/javascript" src="js/swfobject.js"></script>
		<script type="text/javascript">
			var flashvars = {};
			
			var params = {};
			params.quality = "high";
			params.scale = "noscale";
			params.salign = "t";
			params.allowscriptaccess = "always";
			params.allowfullscreen = "false";
			
			var attributes = {};
			attributes.id = "flashContent";
			attributes.styleclass = "flashContent";	
			attributes.align = "center";
					
			swfobject.embedSWF("media/dv_v4.swf", "alternativeContent", "1980", "660", "9.0.0", false, flashvars, params, attributes);
		</script>
        
        
        
        
	</head>
	<body>
        
		<div id="alternativeContent">
			    <img src="images/no-flash.jpg" width="1033" height="600" border="0" usemap="#Map"/>
			    
			    <map name="Map" id="Map">
			        <area shape="rect" coords="854,60,1013,99" href="http://www.adobe.com/go/getflashplayer" target="_blank" alt="Get Adobe Flash Player" />
			        <area shape="rect" coords="30,555,223,570" href="mailto:daphne@link.com" />
			        <area shape="rect" coords="33,121,1008,539" href="http://www.link.com/" alt="Go to the my flash site" />
			    </map>
		</div>
        
	</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of crooksy88
crooksy88
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of socross

ASKER

Perfect, I missed the width 100% added it to my code and job done.

Thanks alot.

--s--
swfobject.embedSWF("media/dv_v4.swf", "alternativeContent", "100%", "660", "9.0.0", false, flashvars, params, attributes);
                

Open in new window