Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Document.write and Flash

Reply
Thread Tools

Document.write and Flash

 
 
Pureintent@gmail.com
Guest
Posts: n/a
 
      12-18-2007
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="clsid27CDB6E-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
 
Reply With Quote
 
 
 
 
David Mark
Guest
Posts: n/a
 
      12-18-2007
On Dec 18, 7:37 am, (E-Mail Removed) wrote:
> 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="clsid27CDB6E-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.

> <embed


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="clsid27CDB6E-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.
 
Reply With Quote
 
 
 
 
Pureintent@gmail.com
Guest
Posts: n/a
 
      12-18-2007
sorted, I finally found a working example:


<script type="text/javascript">
document.write ("<object classid='clsid27CDB6E-
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>
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      12-18-2007


(E-Mail Removed) wrote:
> sorted, I finally found a working example:
>
>
> <script type="text/javascript">
> document.write ("<object classid='clsid27CDB6E-
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Canon D60, 28-135IS, 420EX flash, BG-ED3 grip, 1GB Microdrive, some filters and flash diffuser Joe Wilson Digital Photography 2 10-18-2004 05:17 AM
flash problem, session id not consistent when using flash with query stirng parameters Bernie ASP .Net 0 09-05-2004 05:28 AM
Canon Powershot G3 and flash speedlite 420EX : overexpose in fill-flash Charles Bueche Digital Photography 2 06-07-2004 01:08 PM
Is Flash Flash? Targa Cisco 1 11-25-2003 03:34 PM
Re: With More Flash More Lumix: using an external flash unit with the FZ1 and other digicams Hans-Georg Michna Digital Photography 4 08-24-2003 06:05 PM



Advertisments