Trace
The trace function is used in ActionScript, typically for debugging purposes. In GraalScript, it is an alias for the echo command.See also: trace
Var
Use of the keyword var in ECMAScript creates a variable whose scope is the body of the function in which it is declared. The var keyword is ignored by the GraalScript compiler, since temp variables already have this property.Static
Another keyword that is reserved in GraalScript but is unused is static. In ECMAScript, this would bind a function to a class rather than an instance. This behavior can be duplicated in GraalScript, in a way, by using the public qualifier and joining the function to the object (usually a TStaticVar).Anonymous functions
On the other hand, a function can be bound to an instance rather than a class simply by using an anonymous function.obj.some_function = function (params) { statements; };
function A() { var hats = 3; this.getHats = function() { return hats; }; return this; } function B() { var a = A(); trace(a.getHats); } B();
Additionally, the properties of the MovieClip object reflect the names of the equivalent properties in ActionScript (e.g., _x and _y, as opposed to x and y)