ssCore.Script.addCode

Add code from a Flash variable to a script module.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

module - The name of a script module.

variable - [Optional] - The fully qualified name of Flash variable that contains script code to be added to the module. This argument works only with AS2.

code - [Optional] - The script code to be added to the module. Use this for AS3 projects instead of the 'variable' argument.


Output Parameters:

scriptError - String containing details of a syntax error caught by the interpreter when loading your code. You should not attempt to execute code with syntax errors in it.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.Script.addCode( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.Script.addCode( paramsObject );


Notes:

None.


Examples:

var myModuleScript = "";
myModuleScript += "function go(o){";
myModuleScript += "trace(o.value);";
myModuleScript += "};";

ssCore.Script.addCode({module:"MyModule", variable:"_level0.myModuleScript"});