Document.write and Flash

Discussion in 'Javascript' started by Pureintent@gmail.com, Dec 18, 2007.

  1. Guest

    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
    , Dec 18, 2007
    #1
    1. Advertising

  2. David Mark Guest

    On Dec 18, 7:37 am, 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="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.

    > <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="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.
    David Mark, Dec 18, 2007
    #2
    1. Advertising

  3. Guest

    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>
    , Dec 18, 2007
    #3
  4. David Mark Guest

    wrote:
    > 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.
    David Mark, Dec 18, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernie
    Replies:
    0
    Views:
    532
    Bernie
    Sep 5, 2004
  2. Jim Higson
    Replies:
    1
    Views:
    501
    Jim Higson
    Sep 21, 2004
  3. Chuck
    Replies:
    0
    Views:
    87
    Chuck
    Nov 27, 2003
  4. Charles

    Flash and document.write()

    Charles, Apr 28, 2007, in forum: Javascript
    Replies:
    11
    Views:
    175
    Charles
    May 3, 2007
  5. Frank Peterson
    Replies:
    9
    Views:
    220
    David Mark
    Jun 28, 2009
Loading...

Share This Page