views:

1547

answers:

6

I have a generated HTML page with flash content in it. I am trying to reposition the flash content and make it "absolute". I have tried to wrap the object tags with a div tag, but to no avail. Can anyone tell me how to do this? Removing the generated positioning attributes does not work.

See relevant code below (it is not very neat, but this is how it is generated. I have removed most irrelevant code):

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>* welcome *</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#000000">
<script language="javascript">
if (AC_FL_RunContent == 0) {
 alert("This page requires AC_RunActiveContent.js.");
} else {
 AC_FL_RunContent(
  'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
  'width', '430',
  'height', '200',
  'src', 'bar',
  'quality', 'high',
  'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
  'align', 'right',
  'play', 'true',
  'loop', 'true',
  'scale', 'showall',
  'wmode', 'transparent',
  'devicefont', 'false',
  'id', 'bar',
  'bgcolor', '#000000',
  'name', 'bar',
  'menu', 'true',
  'allowFullScreen', 'false',
  'allowScriptAccess','sameDomain',
  'movie', 'bar',
  'salign', ''
  ); //end AC code
}
</script>
<noscript>
<div style = "position: absolute">
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"          codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="430" height="200" id="bar" align="right">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="bar.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#000000" />
    </object>
</div>
</noscript>

Thanks in advance!

+3  A: 

Since your div is wrapped in noscript it will only be shown if javascript is turned off, are you sure that is the behaviour you want?

Fuzzy76
Hey thanks. At least I now know what a noscript tag does! ;)
pypmannetjies
+3  A: 

you should place the JS script that actually creates you object inside your div not before it.

epeleg
*face palm* of course! Thanks!
pypmannetjies
+1  A: 

@Fuzzy76 & @epeleg.blogspot.com is right

@pypmanetjies -> Your code must be like this (shortened):

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>* welcome *</title>
    <script language="javascript">AC_FL_RunContent = 0;</script>
    <script src="AC_RunActiveContent.js" language="javascript"></script>
    </head>
    <body bgcolor="#000000">
<div style = "position: absolute">
    <script language="javascript">
    if (AC_FL_RunContent == 0) {
            alert("This page requires AC_RunActiveContent.js.");
    } else {
            AC_FL_RunContent(
...
); //end AC code
    }
    </script>
    <noscript>
          <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"          codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="430" height="200" id="bar" align="right">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="movie" value="bar.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#000000" />
        </object>

    </noscript> 
</div>
Hasan Tayyar BEŞİK
+1  A: 

You might have to set a width and height on your as well.

Ian Oxley
A: 

I'm having the same problem. The DIV itself is perfectly positioned (text and images show up in the correct place) but any Flash content placed using AC_FL_runcontent is offset further by the top and left of the parent DIV.

Any ideas?

A: 

Thank you, i see where i was going wrong :)