It occurs to me that you could simplify this at the JavaScript end, like this:

Code:
<SCRIPT LANGUAGE="JavaScript">
<!--

function flashFunc(func, args)
{
window.document.testfunc.SetVariable('myFunction',func);
window.document.testfunc.SetVariable('args',args);
}

//-->
</SCRIPT>
So it sends whatever function name and arguments you want without having to have a separate JavaScript function for each one. So you can invoke any Flash function with the following syntax:

Code:
flashFunc(FunctionName,arguments)
so for example we could do the same as the setAlpha example above, like this

Code:
flashFunc('setAlpha','box,100')
Assuming of course that the code exists at the Flash end to deal with whatever functions you are calling.