alignment of swf object

Hello,

In dreamweaver, I have a full page that is for flash. My swf file aligns center fine horizontally, but I cannot get it to align center vertically.

How do I do this?

Bob
LVL 7
weikelbobAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CoolATIGuyCommented:
Try this:

<table width="100%" height="100%">
      <tr>
            <td align="center" valign="middle">
                  Blah Blah Blah...Flash <object> tags and stuff
            </td>
      </tr>
</table>


CoolATIGuy
0
weikelbobAuthor Commented:
That still doesn't align the flash movie vertically. Horizontal centering is fine.

Bob
0
CoolATIGuyCommented:
Really?  Seemed to work fine for me...can you post all the code you have on that page, and a link to the page, please?


CoolATIGuy
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

weikelbobAuthor Commented:
Sure,

Here's the link:

http://b-transfers.com/chunbiao/index.html


Here's the code:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>

<table width="95%" height="95%">
     <tr>
          <td align="center" valign="middle">
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="600" height="400" align="middle">
            <param name="movie" value="flash/movie.swf">
            <param name="quality" value="high">
            <embed src="flash/movie.swf" width="600" height="400" align="middle" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
            </object>
         
          </td>
     </tr>
</table>




</body>
</html>
0
CoolATIGuyCommented:
That's the same as I have, except for two things:

1. Take out both - align="middle" - in the <object> and <embed> tags.
2. Why is <table width="95%" height="95%"> 95% instead of 100%?


CoolATIGuy
0
CoolATIGuyCommented:
...although it should work the way it was...


CoolATIGuy
0
weikelbobAuthor Commented:
Please take a look at this again. The movie moves to stay centered horizontally, but when I move the screen vertically, the flash movie does not move to center itself.

The link:

http://b-transfers.com/chunbiao/index.html

The code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>

<table width="100%" height="100%">
     <tr>
          <td align="center" valign="middle">
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="600" height="400">
            <param name="movie" value="flash/movie.swf">
            <param name="quality" value="high">
            <embed src="flash/movie.swf" width="600" height="400" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
            </object>
         
          </td>
     </tr>
</table>




</body>
</html>

0
CoolATIGuyCommented:
AHA!  I did some detective work, and I think I figured out the prob...

I wasn't figuring out why it wasn't working for you, and then saw that Dreamweaver was centering it fine, but when I uploaded a similar thing to our server, in ie it did the same as you were saying.  Then I remembered that I recently was working with an animation, and I think I ran into the exact same problem of centering vertically...

So I found this site: http://forums.beyondunreal.com/archive/index.php/t-113528.html


I took some of the code they said worked, stripped it down to the basics, and it worked!  I then compared it to what I had given you, and couldn't tell a difference....except for the extra stuff in here:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>


I put that stuff in, and ivoila! - problem came back.


So it appears to be that it's checking for compatibility with the Transitional DTD, and something in there doesn't fit it, so it's not displaying correctly.

So, for the fix!  Either:

1. Take out this line: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

or

2. Research a more compatible way to center.


If you go with route #2, I'd suggest trying to center it with css...


Cheers!



CoolATIGuy
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
weikelbobAuthor Commented:
Thank you
0
CoolATIGuyCommented:
yep...have another great day. ;-)


CoolATIGuy
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.