SwfObject has helped me profusely. With that being said, here is my new dilemma.
I've been searching around online trying to find a nice clean way to make it so my flash movie logo centers vertically as well as horizontally. So if the window is extremely small, you can see the logo. And when the window tab is pulled, it centers accordingly.
I've been substituting object embed in dreamweaver with SWFObject and it totally rocks. The thing is, I've been putting the swf in a table and it has limitations.
I have tried a method a few people suggested to create a 100% table and then nest the swf inside of it, but I think I'm missing something in regards to make it work with the SWFObject.
REGARDLESS, I would like to avoid using tables and simply make it "freefloating" using CSS.
If anyone can share some light on this, I'd appreciate it. OR if you have another method.
This is an example of a centered page with CSS that a kind programmer in England pointed me to. I really think this is an important detail.
This was posted by the user named duncanhall on the kirupa.com forum.That's another great forum. He is the one responsible for pointing me to the dead center solution and the one who brought this solution to the table.. If you don't know, now you know......
Quote:
"Try something along these lines:
(assuming you have swfObject set up ok)
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> <title>Dead Centre</title> <script type="text/javascript" src="SWFObject.js"></script> <style type="text/css" media="screen"><!-- body { color: white; background-color: #FFFFFF; margin: 0px }
<body> <div id="horizon"> <div id="content"> <script language="JavaScript" type="text/javascript"> var so = new SWFObject("HWV7.swf", "HWV7", "800", "600", "6"); so.write("content"); </script> </div> </div>
</body> </html>
Notice the inline script in the "content" div. The last line is the write method of the swfObject, and the parameter it takes refers to the id of the page element you want to write the swf to. So here, we are telling swfObject to write the swf to the 'content' div (which is the div that the script itself is in).
Also notice how I've changed some of the CSS properties of the content div. The width and height have been changed to reflect the width and height of the swf, and the vertical and horizontal margins have also been modified accordingly. It's worth noting that at the moment, you seem to be working with a swf 800px wide. I'd advise dropping this down to around 750px, meaning your site will display nicely from resolutions of 800 x 600 upwards.
Finally, the link I gave to the CSS dead center example, was not my own work at all. It's just a useful example I've come across in my CSS adventures.
For some reason, it doesn't work consistently. Like, if the movie isn't cached already from viewing the actual site, it doesn't work. When I refresh Safari/Firefox, and then preview the page, it doesn't load. I'm not sure why, but my guess is that with the original SWFobject.as file can't reply to the function? But then why would it work after the swf itself is cashed from the website? This is terribly confusing. I still have some testing to do. I have to figure this out.....
Hi Geoff, Thanks for replying. I switched the uppercase to lowercase like you suggested. I have run into occasions where it seems to auto switch it to the uppercase on the server.. Is that possible? Anyways, I just tried it and now it won't even load on my local machine.
Also, I hate to admit it, but I am a little fuzzy on which part of the script you mean and where to put it. It's true I don't completely get it yet, but I'm starting to understand a bit better.