this is probably an easy problem. I'm using swfobject to play a swf flash file on a landing page. I know the flash player will open it's own window to present the content. I thought if I specified 'wmode', 'opaque' the file would be "forced" into the flow of the web page and I could gain control of it's positioning. I used this wmode setting and yet the file keeps "doing it's own thing" and not appearing inside the div where I want to position it.
The following is a stripped down version of my problem; the swf and swf object files are in the same directory; the swf file plays just fine, it just doesn't want to go into my div id="target_img":
of course edit as per your exact src path. This will allow you to see the content of the div without Flash being involved. This is a good practice with swfobject anyway... get your alt content working first and only after that, do you turn on the Flash.
Give #target_img the exact same dimensions as the .swf and give it a background color so you can see where it's being positioned. Now get all the positioning so that it works. You may be thrown off by the positioning "Parent Rule".
From an old post:
the actual display of #flash will very depending on whether or not it's parent container (<div>) also has a declared position.
That is, if it's parent container DOES NOT also have a declared position, the child <div> will do 1 of 2 things.
If position:relative, it will position as desired but space will be left as though that element was still in the natural flow. So you may move the 500 X 100 element down and over, but a 500 X 100 space will be left, as though it was still there.
If position:absolute, child is positioned relative to browser window and that position does not change even if window contracts or expands.
So be sure to give a declared position to both the parent and the child <div>.
Once you get the positioning correct then change the file name of swfobject up in the head. If you are using swfobject 1.5 (which it looks like you are) all the script as well as the alt content will go INSIDE #target_img.
Piece of cake!
Here's a sample page using swfobject, alt content as well as a declared position to place one .swf on top of another: http://www.worldbarefootcenter.com/index.html
The video player is placed on top of a different .swf.
View the source code for more details.
Eye for Video www.cidigitalmedia.com
'Eye-for-video' thanks for your response; you are always generous with your time for these postings.
I found the problem; while trying to implement your comments I kept puzzling over the reference to the div id 'target_img' in the object statement:
var so = new SWFObject('images/land.swf','target_img','300','240','9');
this whole stretch of code is sitting in a div with id='target_img'; this could be the duplication I was seeing. Sure enough when I changed the object param of 'target_img' to something like 'my_img' (a div that didn't even exist) bingo, no duplication and the flash element played in the position I needed it.