# What am I doing wrong in embedding SWFObject?

**URL:** https://forum.kirupa.com/t/what-am-i-doing-wrong-in-embedding-swfobject/265551
**Category:** programming
**Created:** [July 10, 2008, 4:55am UTC](https://forum.kirupa.com/t/what-am-i-doing-wrong-in-embedding-swfobject/265551 "2008-07-10T04:55:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mikerz](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mikerz](https://forum.kirupa.com/u/mikerz)
#### Post date: [July 10, 2008, 4:55am UTC](https://forum.kirupa.com/t/what-am-i-doing-wrong-in-embedding-swfobject/265551/1 "2008-07-10T04:55:05Z")

</div>

```auto
ï»¿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="en"><head><title>Mikerz.com</title>
    

<head>        
(some meta stuff im not showing, here)
<script type="text/javascript" src="./swfobject/swfobject.js"></script>
        <script type="text/javascript" src="./swfaddress/swfaddress.js"></script>

        

        <style type="text/css" media="screen">
          html, body, #myContent { height:100%; }
          body { margin:0; padding:0; overflow:hidden; }
        </style></head>

<body>
        <div id="myContent">Flash Goes Here</div>
<script type="text/javascript">
   var so = new SWFObject('slider.swf', "mymovie", "100%", "100%", "9", "#000000");
   so.write('myContent');
</script>

```

any ideas? Ive been trying to figure it out, but im a bit of a noob at js…

---

<div class="post-metadata">

### Author: ![brianmanden](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@brianmanden](https://forum.kirupa.com/u/brianmanden)
#### Post date: [July 10, 2008, 9:56am UTC](https://forum.kirupa.com/t/what-am-i-doing-wrong-in-embedding-swfobject/265551/2 "2008-07-10T09:56:18Z")

</div>

Hi and welcome to the forums ! 😉

I tested your script here …there is nothing wrong with your code but you may want to tidy it up a bit. IE you got 2 starting tags for the head section (also - no ending tags for body and html and some weird characters before your doctype) ?! Indent your blocks of code - it really helps to get a better overview of the code !

Take a look at your reference to src="./swfobject/swfobject.js" - is it correct ?

---

<div class="post-metadata">

### Author: ![mikerz](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mikerz](https://forum.kirupa.com/u/mikerz)
#### Post date: [July 10, 2008, 5:19pm UTC](https://forum.kirupa.com/t/what-am-i-doing-wrong-in-embedding-swfobject/265551/3 "2008-07-10T17:19:36Z")

</div>

hey thanks for the reply, the code I posted was pretty messy because I cut and pasted from the full html… it actually did have the proper tags.

Note: I had a working HTML when I began, but IE totally screwed up loading my SWF so I tried to start over again ( it would load a part of my preloader, and then say swfobject is undefined… ).

I ended up going through the SWFObject docs, and used the code generator for a static embed. That still didn’t work, so I changed the swfobject path to an absolute one. I ran the flash player uninstaller, and ran the installer. Still no fix.

I checked it in safari and FF, and it worked- except that the alignment was fugly ( fullbrowser & fullscreen options ), so I fixed THAT with a CSS Style;

[SIZE=5]LONG STORY SHORT:[SIZE=3] [/SIZE][/SIZE][SIZE=3]( also kinda-sorta cliffs )  
[/SIZE]  
I found out my IE was using flash player 7.0 inexplicably.

:sigh:

ran the IE installer directly from IE rather than adobe’s executable, and it worked fine.
