Game Development Reference
StartMovie - the script between the On StartMovie and End StartMovie
tags will only be run when the movie first loads into the browser. You
would usually use the On StartMovie script to initialize variables and
arrays, and start any background music.
NewFrame - the script between the On NewFrame and End NewFrame
tags will be run on every frame in the movie. The NewFrame script is the
main movie script where you would develop all the main scripting in your
You can also break up your scripts and make code reusable in multiple
areas by creating subroutines. The TScript dialog box also has the facility
to check the syntax of your script code.
In the TScript dialog box, click the Compile Button.
This will check through the current script and if any faults are found then
a compilation error will be generated and the offending code will be
highlighted. Scripts are automatically compiled when you click OK, but it
is often useful to compile them as you write.
Syntax and operators
TScripts uses a familiar syntax to many other programming languages
such as VB, C++ and Director Lingo.
Referencing variables, controls and strings
Controls within your movie, such as objects, Toons, Text objects and
Lights, etc., are referenced by their name, as are variables. Strings have
to be placed in quotation marks (“”), otherwise they will be read as
Set count = 0 “sets variable count equal to zero”
Set Text1 = “This is the text that will be displayed in the Text object