I am having problems in Firefox with calling a Flash function from
Basically, I can call the function just fine using the straight-
myFlashMovie.doSomething(param1, param2, param3);
...that works fine.
However, the functionality I am creating is slightly more complex and
therefore calls for the use of the "apply" method of the Function
What I therefore want to do is essentially this:
var args = new Array(param1, param2, param3); //build my array of
params (in the real code, it's not so simple as this, but you get the
var func = myFlashMovie.doSomething; // set variable func to
reference my flash function
This then allows me to call different flash functions dynamically,
with different numbers of params etc. As I've said, the actual setup
is slightly different so no need to discuss whether or not this kind
of approach is necessary or not (it is).
The problem is, that using the Function.apply methood DOES NOT work in
Firefox for executing Flash functions. I have tested various things,
1) Does Function.apply work in Firefox for executing normal JS
functions -- YES
"myFlashMovie.doSomething" as being a function -- YES (tested using
3) Can myFlashMovie.doSomething be executed using the normal method
of myFlashMovie.doSomething(p1, p2, p3) etc. -- YES, it works fine!
So, my only solution currently is very inelegant indeed, and that is
to do something like this
myFlashMovie.doSomething(args, args, args);
...which works, yes, but isn't exactly great.
So, I was wondering if anyone had managed to execute a Flash function
from JS, in Firefox, and successfully done it using Function.apply.
Alternatively, anyone got better alternative to my switch(args.length)
method? Maybe one that's a bit less limiting?
Many thanks in advance!!