Link to home
Start Free TrialLog in
Avatar of seamusseamus
seamusseamus

asked on

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>
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of seamusseamus
seamusseamus

ASKER

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>

Thanks for feedback.