ShockFiler Xtra SHOCKFILER XTRA HELP: GETTING STARTED  
 

ShockFiler 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 ShockFiler Xtra, following the instructions in the installation page. Now that ShockFiler is installed, let's verify that the installation was successful. If you are using DirectorMX you should see the ShockFiler entry in the Scripting Xtras context menu, appearing at the top of the message window. Selecting the ShockFiler submenu and the "put interface" entry will output a list of all commands understood by ShockFiler 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 ShockFiler and the message window. All of ShockFiler 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 = sf_Version()

put mystring

--"2.0.0"

JavaScript syntax:

var mystring = sf_Version()

trace(myresult)

That's it. You just confirmed that ShockFiler is installed correctly, and its functions are available as new global keywords in Lingo and Javascript, ready to be used.

 

REGISTRATION

In addition to displaying an unregistered dialog, a non registered version of ShockFiler always displays a progress dialog for ftp transfers that includes a demo message under the progress bar.

If you have purchased the ShockFiler Xtra you received a registration number. Make the sf_Register registration call in the first movie that uses ShockFiler commands. Make sure you do it before using any other ShockFiler 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 ShockFiler functions.

 

on startMovie

success = sf_Register([111,222,333])

-- notice that the parameter to sf_Register is a list, not a string!

if success <> 1 then alert "Registration of ShockFiler Xtra failed"

end