SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Miami
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript to flash

    I got most of what I needed from other posts including the below code which appears to be working fine.
    Code:
    <script type="text/javascript">
    //<![CDATA[
            var fStr = "";
            fStr += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
            + ' codebase="http://download.macromedia.com/pub/shockwave/cabs/'
            + 'flash/swflash.cab#version=6,0,0,0"'
            + 'width="'+flashWidth+'" height="'+flashHeight+'" id="pept" align="">'
            + '<param name=movie value="pept.swf"> '
            + '<param name="WMode" value="Transparent">'
            + '<param name="quality" value="high">'
            + '<param name="bgcolor" value="#ffffff">'
            + '<embed src="pept.swf" quality="high" bgcolor="#ffffff" '
            + ' width="'+flashWidth+'" height="'+flashHeight+'" name="pept" align="" '
            + 'type="application/x-shockwave-flash" '
            + 'pluginspace="http://www.macromedia.com/go/getflashplayer">'
            + '</embed></object>';
    document.write(fStr);
    //]]>
    
    </script>
    I want to pass the same vars into the flash movie. In php I would do something like this where $myvar would be width=xxx&height=xxx
    Code:
    <param name=movie value="pept.swf?<?php echo $myvar; ?>">
    How can I do the equivilant in javascript? Thanks!

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    ..............
           + '<param name=movie value="pept.swf?width=' + flashWidth + '&height=' + flashHeight + '">'
    ..............
    ..............
            + '<embed src="pept.swf?width=' + flashWidth + '&height=' + flashHeight + '" quality="high" bgcolor="#ffffff" '
    ..............
    ::: certified wild guess :::

  3. #3
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Miami
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, that will do it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •