Filename.swf?122 instead of filename.swf?file=122?

HI,

Can i use filename.swf?122 instead of filename.swf?file=122 and somehow program actionscript to “listen” for external variables and if it detects one is automatically the value of “file”?

And is it also possible to use something like filename.swf?122&33&44
And again use AS to “listen” for 3 variables values?

Grtz,

You can do it with some javascript, but you’d be limited to one variable if you don’t want to specify the variable name in the url. In the html file your movie sits in you need to replace the flash object definition tags with this:

<script language=“javascript”>
href=document.location.href;
params=href.substr(href.indexOf(’?’) + 1);
document.writeln (’<OBJECT classid=“clsid:D27CDB6E-AE6D-11cf-96B8-444553540000”’);
document.writeln (’ codebase=“http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0” WIDTH=620 HEIGHT=220>’);
document.writeln (’ <PARAM NAME=movie VALUE=“YoiurMovie.swf?Filename=’ + params + '”> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>’);
document.writeln (’ <EMBED src=“YourMovie.swf?Filename=’ + params + '” quality=high bgcolor=#FFFFFF WIDTH=620 HEIGHT=220 TYPE=“application/x-shockwave-flash” PLUGINSPAGE=“http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash”></EMBED></OBJECT>’);
</script>

the javascript captures the parameter and passes it on to the flash object. If you decided you don’t mind passing in the variable names too then you can pass as many variables as you heart desires with almost the same code:

<script language=“javascript”>
href=document.location.href;
params=href.substr(href.indexOf(’?’));
document.writeln (’<OBJECT classid=“clsid:D27CDB6E-AE6D-11cf-96B8-444553540000”’);
document.writeln (’ codebase=“http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0” WIDTH=620 HEIGHT=220>’);
document.writeln (’ <PARAM NAME=movie VALUE=“YoiurMovie.swf’ + params + '”> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>’);
document.writeln (’ <EMBED src=“YourMovie.swf’ + params + '” quality=high bgcolor=#FFFFFF WIDTH=620 HEIGHT=220 TYPE=“application/x-shockwave-flash” PLUGINSPAGE=“http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash”></EMBED></OBJECT>’);
</script>

Let me know if you have any trouble gettin it working :stuck_out_tongue:

thnks,

But
1 i can’t see your code if any was provided.
2 right now i use ?variableName=value

Q.
1 So i can use ?variableName=value&variableName2=value etc.

Grtz

**** my code dissappeared! This forum doesn’t seem to like html tags in posts 2 secs and I’ll find a tutorial for ya

hey I didn’t swear?! well d*mn wasn’t a swear word when I was a lad, maybe I’m gettin old…

okay the tutorial I was thinking of doesn’t exist anymore :frowning: but not to worry I’ve attached an example for you to look at. Hope this helps. Unfortunatly this version won’t work if you open the page without passing in a parameter in the url

aight thnks,

gonna delve into your code :wink:

Originally posted by m_andrews808
****** my code dissappeared!**

use [php****][/php****] tags to show your code.

cool thanks for the tip

:wink: