• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

writing URL variables into flash embed script

Hi, I have the following two scripts.  The first retrieves a url variable, the second is the flash embed script.  I need to retrieve the "id" value from the URL string and place that in the flash embed script in two locations.  Any ideas?

<SCRIPT type=text/javascript>
function get(name) {
      var q = unescape(location.search.substring(1)).split(/[=&]/);
      for (var j=0; j<q.length; j+=2) {
            if (q[j] == name) {
                  return q[j+1];
            }
      }
      return "";
}
</SCRIPT>


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="500" height="300">
  <!--slideshow-->
  <param name="movie" value="/content/images/slideshow/slideshow.swf">
  <param name="quality" value="high">
  <param name="wmode" value="window">
  <param name="flashvars" value="xml=/content/images/slideshow/[id from url string goes here].xml">
  <embed src="/content/images/slideshow/slideshow.swf" width="500" height="300" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="window" flashvars="xml=/content/images/slideshow/[id from url string goes here].xml"></embed>
</object>
0
seamusseamus
Asked:
seamusseamus
  • 2
1 Solution
 
ZvonkoSystems architectCommented:
Does this work for you:

<html>
<head>
<title>Zvonko &#42;</title>
<SCRIPT type=text/javascript>
function get(name) {
     var q = ("&"+location.search.substr(1)).split("&"+name+"=");
     if(q.length>1){
       return (q[1]+"&").split("&")[0];
     } else return "";
}
</SCRIPT>
</head>
<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="500" height="300">
  <!--slideshow-->
  <param name="movie" value="/content/images/slideshow/slideshow.swf">
  <param name="quality" value="high">
  <param name="wmode" value="window">
<script>
document.write('\
  <param name="flashvars" value="xml=/content/images/slideshow/'+get('id')+'.xml">\
  <embed src="/content/images/slideshow/slideshow.swf" width="500" height="300" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="window" flashvars="xml=/content/images/slideshow/'+get('id')+'.xml"></embed>');
</script>
</object>
</body>
</html>

0
 
seamusseamusAuthor Commented:
it didn't work exactly as you had it, but this gave me the starting point i needed to get it done... here's what worked:

<script language="JavaScript">
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http');
document.write('://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0');
document.write(',0,0" width="500" height="300">  <!--slideshow-->  <param name="movie" ');
document.write('value="/content/images/slideshow/slideshow.swf">  <param name="quality" v');
document.write('alue="high">  <param name="wmode" value="window">  <param name="flashva');
document.write('rs" value="xml=/content/images/slideshow/'+get('id')+'.xml">  <em');
document.write('bed src="/content/images/slideshow/slideshow.swf" width="500" height="300" ');
document.write('quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ty');
document.write('pe="application/x-shockwave-flash" wmode="window" flashvars="xml=/content/i');
document.write('mages/slideshow/'+get('id')+'.xml"></embed></object>');
</script>

0
 
ZvonkoSystems architectCommented:
Thanks for feedback.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now