PDA

View Full Version : Pass a variable ot Flash


WebDude
10-10-2002, 02:03 AM
I am using,

<script>
function parseGetVars() {
var getVars = new Array();
var qString = unescape(top.location.search.substring(1));
var pairs = qString.split(/\&/);
for (var i in pairs) {
var nameVal = pairs[i].split(/\=/);
getVars[nameVal[0]] = nameVal[1];
}
return getVars;
}
</script>

to get the variables from a URL.

I used

<script language = "JavaScript">

<!--
function PassFlash(){
window.document.movie.SetVariable("variable", "value");
}
//-->
</script>

to name and pass a variable to a Flash movie.

What I cant figure out is how to use the varaible that I parsed with parseGetVars() in the PassFlash() function. Any help out there?

adios
10-10-2002, 02:50 AM
Something like this...

function PassFlash(propname) {
var Qobj = parseGetVars();
window.document.movie.SetVariable(propname,Qobj[propname]);
}

PassFlash('color');