JavaScript to Flash problem -
01-14-2004
, 08:55 AM
So...
<script language="JavaScript">
var lang = String(document.location);
lang = lang.substr(lang.length-1,1);
//-->
</script>
<object classid="bleh"
codebase="bleh>
document.write('<param name=movie value="main.swf?lang='+lang+'">');
<param name=quality value=high>
<embed src="main.swf" quality=high
</embed>
</object>
First code get's the location of the html file and throws away everything except the last character (my variable value).
Second code embeds flash and I want it to identify it as main.swf?lang=3... (3 being the value of the variable lang).
However, flash reads it only as http://www.......com/main.swf?lang='+lang+' and!! .. it does (in flash) give lang a value but as this:
' lang '
I've played around with the quotation marks and taken example from other sites use of this method. What am I doing wrong?
cheers |