-
Hi all
Okay I know how to call a function using an html link like this:
Code:
<a href="asfunction:_root.DoThis,Parameter">Click here</a>
my problem is I need to pass in several parameters but when I do this:
Code:
<a href="asfunction:_root.DoThis,Parameter1,Parameter2,Parameter3">Click here</a>
it passes one parameter with this value:
'Parameter1,Parameter2,Parameter3'
Does anyone know how I get round this?
Thanks in advance
-
try passing an array instead of individual variables.
-
Can't do that because the link is in a text file.
I can make some code to split the parameter up into many, but I want to know if there is an easier way of doing it.
Any other suggestions?
-
you can split the arguments using string.split on the arguments array.
eg:
function DoThis () {
trace ("arguments[0] = "+arguments[0])
argsSplit=arguments[0].split(",")
j=0;
while(j<argsSplit.length){
trace ("argsSplit"+j+"= " +argsSplit[j]);
j++
}
}
txt='<a href="asfunction:_root.DoThis,Parameter1,Parameter 2,Parameter3">Click here</a>'