• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

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
0
weikelbob
Asked:
weikelbob
  • 6
  • 4
1 Solution
 
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
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
 
weikelbobAuthor Commented:
Thank you
0
 
CoolATIGuyCommented:
yep...have another great day. ;-)


CoolATIGuy
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now