Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-15-2009, 01:23 PM   PM User | #1
CaptainB
Regular Coder

 
Join Date: Jun 2007
Posts: 805
Thanks: 123
Thanked 23 Times in 23 Posts
CaptainB is an unknown quantity at this point
Swfobject 2 - center flash content problem

Hi guys,

Until resently I used SWFObject 1.5 to display my flash. It worked good, but I decided to try to upgrade to 2.0. But now my flash banner is not centered within the div as it used to be but floats to the left. The banner is rendered to the div "header":

Code:
<script type="text/javascript" src="javascript/simplemarquee.js"></script>
		<script type="text/javascript">
			var params = {};
			params.wmode = "transparent";
			swfobject.embedSWF("flash/headermov.swf", "header", "900", "200", "9.0.0", "flash/expressinstall.swf", params);
		</script>
CSS:
Code:
#header {		margin:0px auto;
				width:900px;
				height:200px;
				text-align:center;
				line-height:200px;
				}
I tried to add the 'align' param, but that didn't seem to have any effect. Does anybody know how to solve this?
CaptainB is offline   Reply With Quote
Old 03-15-2009, 02:57 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Does anybody know how to solve this?
Can we have a link?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 03-15-2009, 03:35 PM   PM User | #3
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Code:
<script type="text/javascript">
			var params = {};
			params.wmode = "transparent";
var attributes = {};
attributes.style = 'display:block;margin:auto;';
			swfobject.embedSWF("flash/headermov.swf", "header", "900", "200", "9.0.0", "flash/expressinstall.swf", params);
		</script>
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-15-2009, 03:57 PM   PM User | #4
CaptainB
Regular Coder

 
Join Date: Jun 2007
Posts: 805
Thanks: 123
Thanked 23 Times in 23 Posts
CaptainB is an unknown quantity at this point
Aero,
It does not work. Even if I add an 'attributes':
Code:
<script type="text/javascript">
			var params = {};
			params.wmode = "transparent";
var attributes = {};
attributes.style = 'display:block;margin:auto;';
			swfobject.embedSWF("flash/headermov.swf", "header", "900", "200", "9.0.0", "flash/expressinstall.swf", params, attributes);
		</script>
Abdura,
It's still on localhost, but here's a screen so you can see what I mean. The banner is slightly pushed to the left instead of being centered:
Attached Thumbnails
Click image for larger version

Name:	Untitled-1.jpg
Views:	103
Size:	34.1 KB
ID:	7232  
CaptainB is offline   Reply With Quote
Old 03-15-2009, 06:36 PM   PM User | #5
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
What exactly are you trying to center? Your #header CSS has a width of 900px and a height of 200px. Your flash has the same dimensions. Post the rest of your code as its likely you have more of it.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Users who have thanked _Aerospace_Eng_ for this post:
CaptainB (03-16-2009)
Old 03-16-2009, 08:07 AM   PM User | #6
CaptainB
Regular Coder

 
Join Date: Jun 2007
Posts: 805
Thanks: 123
Thanked 23 Times in 23 Posts
CaptainB is an unknown quantity at this point
Doh. I had messed up the divs so that the header div was outside the main container. Fixed now, thanks!
CaptainB is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:08 AM.


Advertisement
Log in to turn off these ads.