as2 question
- Started
- Last post
- 6 Responses
- kinetic
anyone know if this is possible...
functionName = myFunctionName
myParams = "test1, test2, test3"ExternalInterface.call(functionN... myParams);
it will call myFunctionName but the params aren't right because it sees the whole thing as a string...is it possible to pass those params in as "test1", "test2", "test3" ?
- bulletfactory0
aren't params accepted in this format? ----
functionName = function(param1, param2, param3) {
function stuff...
}then call it
functionName(params);
- jpea0
it's because your params ARE a string. they're not separate values. maybe put them in an array and pass the array through external interface.
myParams = ["test1", "test2", "test3"]
ExternalInterface.call(functionN... myParams[0], myParams[1], myParams[2]);
or
ExternalInterface.call(functionN... myParams);
and parse out the array on the other end.
- kinetic0
tried that...i made myParams an array and it still didn't work
there is some new shit in as3 called rest params that apparently solves this but i dont feel like writing all my classes in as3 ha
- cuke4260
concatenate the arguments with a | character and then split("|") in the javascript