Hi,
SmartFoxServer utilizes Rhino, Mozilla's javascript engine, to compile AS code at runtime and execute it.
It is known that there might be a few cases in which the engine fails to compile the code due to very large methods or extremely large scripts.
There can be a number of workarounds:
1- if you get an error like "Invalid method Code length..." you probably have one or more very long method(s) in your code. Try better organizing the code by splitting the big function into multiple functions. This will also help readability and maintainability of your code.
2- if long functions are not the culprit but your script is huge (5k lines or more) you probably need classes. You could move part of your logic into regular Java classes and use them in your script as if they where AS classes.
We explain how to integrate Java in AS in our documentation and provide examples.
3- try assigning more heap memory to the JVM. This can be done with the -Xmx switch. More infos here -->
http://edocs.bea.com/wls/docs61/perform/JVMTuning.html
4- as a last resort it is possible to avoid compiling the code at runtime and let it run in "interpreted" mode. This will probably lead to slower execution of the code but, according to Mozilla's website, it seems that these "code limits" issues disappear in "interpreted mode".
This last solution is not available in the current SFS version but if it proves to solve the issue we can quickly provide a patch that allows to change the settings of the Rhino compiler.
hope it helps
p.s. = a few more details about these compiler issues can be found here:
http://www.mozilla.org/rhino/rhino16R1.html
( scroll down a bit until you find this title ->
Removal of code complexity limits in the interpreter )