Center a Swf Help??

This is a discussion on "Center a Swf Help??" within the Web Page Design section. This forum, and the thread "Center a Swf Help?? are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 5th, 2007, 23:01
Junior Member
Join Date: Feb 2007
Location: London
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Center a Swf Help??

Hi

I,ve built a site in flash and want to put a swf in dreamweaver, then upload it. I just want to center the swf in the middle of the window all the time. I don't know WHAT code to put in or WHERE to put it.

It seems a simple thing but I've looked at the source for various websites and threads but can't seem to replicate what they say.

This is the code i got out of my Dreamweaver doc. I'm afraid the validator gave me 13 errors but I didn't know how to put them right, not sure wether they'd effect centering a swf, though.

Code: Select all
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html;  charset=ISO-8859-1">
<TITLE>NakedTortoise</TITLE>
</HEAD>
<BODY bgcolor="#4B0B30">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<!--
--><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
 WIDTH="800" HEIGHT="600" id="NakedTortoise" ALIGN="">
 <PARAM NAME=movie VALUE="NakedTortoise.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#4B0B30> <EMBED src="NakedTortoise.swf" quality=high bgcolor=#4B0B30  WIDTH="800" HEIGHT="600" NAME="NakedTortoise" ALIGN=""
 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</BODY>
</HTML>
Sorry this is so vague, can anyone help. Thanks in advance...

Regards
Reply With Quote

  #2 (permalink)  
Old Apr 5th, 2007, 23:35
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

add: align="center" to your code. See in red below.
Code: Select all
<PARAM NAME=movie VALUE="NakedTortoise.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#4B0B30> <EMBED src="NakedTortoise.swf" quality=high bgcolor=#4B0B30  WIDTH="800" HEIGHT="600" NAME="NakedTortoise" ALIGN="center"
 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
Reply With Quote
  #3 (permalink)  
Old Apr 6th, 2007, 12:29
Junior Member
Join Date: Feb 2007
Location: London
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

Afraid that still doesn't work! Here's the web address:

www.nakedtortoise.co.uk

This is the site with the code you gave me. But i can't see any problems with it. Thanks for looking into it Lchad.

Any othr suggestions would be much interested.

Happy Easter!!

Last edited by nutbolt; Apr 6th, 2007 at 12:41.
Reply With Quote
  #4 (permalink)  
Old Apr 6th, 2007, 14:48
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

Happy Easter Nutbolt...
Well you have bigger problems right now then centering..
Your flash isn't working at all...
Get that working and then let us know ok!
Reply With Quote
  #5 (permalink)  
Old Apr 6th, 2007, 15:08
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: Center a Swf Help??

Here is the problem with the flash not loading. It seems you have linked the swf file incorrectly. Is it centered...YES! Here is the problem I came up with. In your code you stated the link to the swf file as "NakedTortoise.swf".

There is a 404 Page not found error happing on that page. Find where you put that file, and link it in the code to it. Then let us know if you have any other problems
Reply With Quote
  #6 (permalink)  
Old Apr 7th, 2007, 10:06
Junior Member
Join Date: Feb 2007
Location: London
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

OK, thanks Lchad and JacobHaug. I think I sorted the loading problem
by changing the upper-case to lower.

Unfortunately, the original alignment problem still isn't sorted out. I can't see why????

Regards
Reply With Quote
  #7 (permalink)  
Old Apr 7th, 2007, 10:21
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

Code: Select all
<div style="text-align: center;">
    <object... >
</div>
Reply With Quote
  #8 (permalink)  
Old Apr 7th, 2007, 11:29
Junior Member
Join Date: Feb 2007
Location: London
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

Excellent, Thanks Ryan.

Does anyone know how to center it vertically?

Something to do with
valign: vcenter;, I think
But again I don't know where to put it.

thanks again
Regards
Reply With Quote
  #9 (permalink)  
Old Apr 7th, 2007, 11:40
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

Well, since you're HTML code is disgusting already, why not just make it a pinch worse and use a table?
Reply With Quote
  #10 (permalink)  
Old Apr 7th, 2007, 19:34
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: Center a Swf Help??

hahaha...just what I was thinking Ryan...lol
Reply With Quote
  #11 (permalink)  
Old Apr 8th, 2007, 07:36
Reputable Member
Join Date: Dec 2005
Location: Texas
Age: 19
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to daygon Send a message via MSN to daygon Send a message via Yahoo to daygon
Re: Center a Swf Help??

... why dont you just tell him to put <div align="center"></div> jeasus problem solved. Making things so complicated. just surround your code with that and everything will be centered. and if you have to put a margin around it for the top. GOD think easy. I hate tables. Pain in the buttox
Reply With Quote
  #12 (permalink)  
Old Apr 8th, 2007, 08:19
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

Um. Maybe because that wont work... align="center" won't vertically center anything. And a margin for the top? How is that supposed to work for different browser sizes?
Reply With Quote
  #13 (permalink)  
Old Apr 8th, 2007, 09:01
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

It's a shame auto margins don't work for the top and bottom really. This sort of stuff would be so much simpler.

Pete.
Reply With Quote
  #14 (permalink)  
Old Apr 8th, 2007, 13:33
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

Yes it would

Not only that, it would make sense. If auto works for horizontal positioning, why doesn't/shouldn't it work for vertical?
Reply With Quote
  #15 (permalink)  
Old Apr 8th, 2007, 18:31
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

Yet another css quirk sent to annoy us and make our lives more difficult. To be honest though even if it did exist, half of todays browsers wouldn't render it properly anyway. And even if most of them did, ie wouldn't.

Pete.
Reply With Quote
  #16 (permalink)  
Old Apr 8th, 2007, 18:45
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

IE6 is at least nice about the auto margin. Even IE5.5 does it with a little shove in the right direction. If only they would've nailed the box model down.
Reply With Quote
  #17 (permalink)  
Old Apr 8th, 2007, 18:49
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

But did you really expect them to. I mean as much as we all love microsoft we don't quite expect the same from them as we do from others. For example, people raved about ie7 despite the fact that it's rubbish! Well not rubbish but it could have (should have) been better.

Pete.
Reply With Quote
  #18 (permalink)  
Old Apr 8th, 2007, 20:21
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

Indeed. I'm so annoyed IE7 doesn't support more pseudo elements. The input[type="text"] one in particular.
Reply With Quote
  #19 (permalink)  
Old Apr 8th, 2007, 20:35
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

It's a real pain. It seems the more you know about css, the more you wish you didn't in a way. You have to restrain yourself from just not supporting ie. It's not really an option to do that but I wish it was sometimes. I'm partcularly annoyed at the lack of support for the child and attribute selectors. And what's worse is at the minute, if it don't work in ie6 then it's near enough pointless using it really.

One day though, we'll have pure css and html. No hacks, no filters. It will be beautiful to behold.

Pete.
Reply With Quote
  #20 (permalink)  
Old Apr 9th, 2007, 01:54
Reputable Member
Join Date: Dec 2005
Location: scotland
Age: 27
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Center a Swf Help??

to center it vertically can't you add % margins to the top and bottom?
Reply With Quote
Reply

Tags
center, swf

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Div bg images..will not center? jahphill Web Page Design 5 Jun 2nd, 2008 09:03
how can i center this? djcritch Web Page Design 6 Feb 25th, 2008 07:06
center alexgeek Web Page Design 1 Aug 2nd, 2007 03:30
Why Cant i center Innes Web Page Design 7 Jun 20th, 2007 20:37
just want to center this ragingmon Web Page Design 9 Dec 29th, 2006 18:07


All times are GMT. The time now is 17:48.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43