Document.write and Flash

P

Pureintent

Hi guys, I could really do some some help & support!

I need to do a document.write for flash, I've tried all sorts of
combinations but at the end of the day, I'm just crap! I'm using this
method as my banner is going to change depending on time of day

I'm happy to be pointed in the right direction, or if someone can give
me examples (or even do the conversion for me) it will definately be
appreiated!


This is my code:

<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=6,0,79,0"
id="preloader_good_afternoon"
width="600" height="150"<param name="movie" value="preloader_good_afternoon.swf">
<param name="bgcolor" value="#FFFFFF">
<param name="quality" value="high">
<param name="allowscriptaccess" value="samedomain">
<embed
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
name="preloader_good_afternoon"
width="600" height="150"
src="preloader_good_afternoon.swf"
bgcolor="#FFFFFF"
quality="high"
swliveconnect="true"
allowscriptaccess="samedomain"<noembed>
</noembed>
</embed>
</object>


Thanks

Daz
 
D

David Mark

Hi guys, I could really do some some help & support!

I need to do a document.write for flash, I've tried all sorts of
combinations but at the end of the day, I'm just crap! I'm using this
method as my banner is going to change depending on time of day

I'm happy to be pointed in the right direction, or if someone can give
me examples (or even do the conversion for me) it will definately be
appreiated!

This is my code:

I don't see any code. I assume that this movie doesn't need to
interact with JavaScript and doesn't require a specific version of
Flash. In which case, you don't need script at all.
<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=6,0,79,0"
id="preloader_good_afternoon"
width="600" height="150"

<param name="movie" value="preloader_good_afternoon.swf">
<param name="bgcolor" value="#FFFFFF">

Set the background color in the movie.
<param name="quality" value="high">

Skip this.
<param name="allowscriptaccess" value="samedomain">

And this.

The embed element is non-standard.
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
name="preloader_good_afternoon"
width="600" height="150"
src="preloader_good_afternoon.swf"
bgcolor="#FFFFFF"
quality="high"
swliveconnect="true"
allowscriptaccess="samedomain"
<noembed>
</noembed>

The noembed element is worthless.
</embed>
</object>

Here is an example that uses only object elements. It should work in
virtually everything, including the older Safari browsers that ignore
param elements (there are no param elements inside the inner object.)

The fallback is a static image. Add a link to download Flash if you
are so inclined.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="300" height="120" codebase="http://fpdownload.macromedia.com/
pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" title="Movie">
<param name="movie" value="flash/movie.swf">
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="flash/movie.swf"
width="300" height="120" title="Movie">
<!--<![endif]-->
<img src="images/animation.gif" width="300" height="120">
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>

Script-assisted Flash, involving version detection and DOM
manipulation (not document.write), is complicated and there aren't any
decent examples out there (Adobe couldn't even get it right.) There
will be such a script added to the Code Worth Recommending project
soon.
 
P

Pureintent

sorted, I finally found a working example:


<script type="text/javascript">
document.write ("<object classid='clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000");
document.write ("codebase='http://download.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=6,0,79,0' width='600'
height='150'>");
document.write ("<param name='movie'
value='preloader_good_afternoon.swf'>");
document.write ("<param name='quality' value='high'>");
document.write ("<param name='wmode' value='transparent'>");
document.write ("<embed src='preloader_good_afternoon.swf' width='600'
height='150' quality='high' pluginspage='http://www.macromedia.com/go/
getflashplayer' type='application/x-shockwave-flash'
wmode='transparent'>");
document.write ("</embed></object>");
</script>
 
D

David Mark

sorted, I finally found a working example:


<script type="text/javascript">
document.write ("<object classid='clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000");
document.write ("codebase='http://download.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=6,0,79,0' width='600'
height='150'>");
document.write ("<param name='movie'
value='preloader_good_afternoon.swf'>");
document.write ("<param name='quality' value='high'>");
document.write ("<param name='wmode' value='transparent'>");
document.write ("<embed src='preloader_good_afternoon.swf' width='600'
height='150' quality='high' pluginspage='http://www.macromedia.com/go/
getflashplayer' type='application/x-shockwave-flash'
wmode='transparent'>");
document.write ("</embed></object>");
</script>

It isn't a very good example. Particularly the last line.

Why do you want to document.write this anyway? To hide the embed from
validators? You aren't checking for the plugin or version and other
than wmode, your parameters are redundant. You don't want to use
wmode="transparent" anyway (IIRC, it causes problems in some
browsers), so lose that and you can go with standard nested objects.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top