TEXTCRUNCHER XTRA HELP: GETTING STARTED | ||
TextCruncher is a Scripting Xtra. Scripting Xtras are used to extend the Lingo language with new functions and datatypes. Unlike Asset Xtras there is no visual representation of a scripting Xtra in the Director interface, and you can not create castmembers or sprites. The first step is to download and install the TextCruncher Xtra, following the instructions in the installation page. Now that TextCruncher is installed, let's verify that the installation was successful. If you are using DirectorMX you should see the TextCruncher entry in the Scripting Xtras context menu, appearing at the top of the message window. Selecting the TEXTCRUNCHER submenu and the "put interface" entry will output a list of all commands understood by TextCruncher in the message window. You can also use the following command
Lingo: put the xtralist JavaScript syntax: trace(_player.xtraList) to verify which Xtras are installed, including the version number for each one. We will now try a simple scripting session using TextCruncher and the message window. All of TextCruncher functions are available as global Lingo keywords, so there is no need to create an instance of the Xtra in order to use them. For example: Lingo: mystring = ReplaceAll("dog cat", "mouse", "dog") put mystring --"mouse cat" JavaScript syntax: var mystring = ReplaceAll("dog cat", "mouse", "dog") trace(myresult) That's it. You just confirmed that TextCruncher is installed correctly, and its functions are available as new global keywords in Lingo and Javascript, ready to be used.
REGISTRATION The registered version does not display a warning. If you have purchased the TextCruncher Xtra you received a registration number. Make the following registration call in the first movie that uses TextCruncher commands. Make sure you do it before using any other TextCruncher commands. The code can be in any type of script. The startMovie handler is the most convenient place to put it because it will execute before any other code that might try to use TextCruncher functions.
on startMovie TC_Register("DUF98989") -- your registration number is the string inside the parentheses end |