Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

crimsonkid

macrumors member
Original poster
Apr 4, 2008
45
0
Hey everyone,

I need to insert a flash menu which is a .swf file into my html homepage.
It is inside a CSS div tag, but I cannot manage to get it to even appear.

If it helps the flash menu is called flash_menu.swf

Please any help is greatly appreciated.

Thanks
 
oh sorry, I meant I created a box for it in CSS, but the actually .swf was being placed in the HTML document.

I have tried the object tag, but need a specific classid or something as well?
 
I find this to be the simplest and most elegant way of adding swfs to my web pages

Okay....download this file (right-click + save as on Windows, option-click + save linked file on OS X)

http://www.tequilatown.co.uk/flashobject.js

it needs to go into the root directory.

--HTML--

Add this

Code:
<script type="text/javascript" src="flashobject.js"></script>

Into the header in the html page

Add this

Code:
  <div id="[B]menu[/B]">
   
Update your Flash player to see this file!
</div>
      <script type="text/javascript">
   var fo = new FlashObject("file_name.swf", "[B]menu[/B]", "950", "50", "8", "#000000");
   fo.addParam("quality", "high", "winmode", "transparent");
   fo.write("[B]menu[/B]");
  
</script>

where you want to see the swf file. The words in bold all relate to the DIV tag and must match!

--CSS---

Add

Code:
#menu {height:50px; width:950px; clear:both; position:inherit;}

into your CSS (you might need to change the sizes etc for all this to work for your file...but you should know that).
 
You're welcome!

As a quick side note....between you can change the text "Update your Flash player to see this file!" to anything you want. GoogleBot etc will keep this information when they search your site. I tend to just add a few words that are relevant for me site, whereas others will insert a large chunk of text relevant to the swf itself.

Happy Flashing!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.