Essential Xtras

There are many useful Xtras - most of which are listed at the Mile-High Table O'Products. This article hilights a selection that we at Lingoworkshop use regularly and consider to be 'essential'.

BuddyAPI Xtra

BuddyAPI is the Xtra for projectors. You need it to interact with Windows API and Macintosh Toolbox. Common tasks requiring BuddyAPI include

  • Creating open and save dialogs
  • List directory contents, checking if files exist, copying files
  • Read and write registry and ini files
  • Control windows and other applications

Where to get it?

Alternatives

FileXtra is a free Xtra that provides methods to copy, delete, rename and move files and folders, as well as methods for volumes and system dialogs, among others.

PregEx Xtra

PregEx is a free and mind-blowingly fast Xtra that brings the power (and somewhat mystical enlightenment) of Pearl-like regular expressions to Director. This is an essential Xtra for non-shockwave projects that involve any text manipulation - whether its parsing custom data structures, searching text or working with lists of text. It is also increadibly useful during development (batch processing assets, conducting some logic based on path or contents, naming files etc). Although DMX2004 Javascript has some basic regular expression functions (search and replace) - PregEx provides a large array of functions - including the usefull 'search with callback'.

Getting into Regular Expressions can be a nightmare at first. The PregEx mailing list is low traffic, but usually most queries get answers. There a some helpful sites worth checking out, includings

Jeffrey Friedl's "Mastering Regular Expressions" (O'Reilly Media) gets lots of rave reviews.

Also - Mac Users should try BB Edit or TextWrangler (free) from Bare Bones Software. Apart from being useful and powerful text editors with Regular Expression search and replace, they come with some tutorials on using regular expressions (and provide a convenient way to practice/test your expressions).

Where to get it

PregEx Xtra

Alternatives

OS Controls Xtra

OS Controls Xtra lets you create and use basic system widgets. These widgets are drawn by the operating system meaning that you can create GUIs that look like other 'native' applications (and they will even reflect the user's settings or 'theme').

They are extremely easy to use - create a push-button member, for example, and drag it on to the stage. All the normal button behaviour is handled automatically.

The people behind Open Spark, who publish OS Controls, are very helpful and provide many good examples.

Where to get it

Alternatives

For creating system specific widgets, there isn't really any other option. For creating widgets that are fully customised for your application, you can always try the one-sprite widgets from the LingoWorkshop. If possible, avoid the Flash components that come with DMX2004. They will slow your whole movie down.

PropSave / BuddyFile / vList

PropSave, BuddyFile and vList are three Xtras for reading and writing data. Importantly, they keep data in its proper type (symbols, numbers and so forth are not converted to text - unlike saving data using SetPref or FileIO). In some cases, they can be used like a 'database' xtra -- where lists are an ideal simple structure for storing data.

PropSave is free, but compared to the other two Xtras, is fairly limited. Basically it provides two methods: One for saving data to a file, and another for reading the file. If thats all you need, then PropSave does a fine job of doing that.

Buddy File costs $US 60, or $US 45 for existing Buddy API customers. It also read and write lists of data, as well as text and binary files. It also lets you encrypt the files using Blowfish. Buddy File is distributed as an unlocked product and requires no registration number or special registered version. Payment is based on "a honour system" - if you use it, then you should pay the small fee asked. Respect this!

vList is the most expensive ($US 300 for the full monty, $US $150 for the basic version). Like the others, it reads and writes Lingo lists in a binary format. However, it does offer some more features (a new cast member type, AES encryption) and - unlike the other two - vList is 'shockwave safe' and can be used to save data to a user's local drive.

Where to get them

Alternatives

If your data can be represented (without too much trouble) as a string, then you can always save it in a text format. The simplest approach is to use Director's built-in string() method to convert the data to text and then write it out using SetPref or FileIO. To read the data back, you use GetPref or FileIO to open the file and value() method to (hopefully) convert it back to its correct format using Director's built-in string() method.

Another approach is to store the data in XML (which is a text document). This has the advantage (or possibly disadvantage) of using a fairly standard data format. However, it is much slower that using the Xtras. For an example of a lingo script for reading and writing lists using an XML-style text document, have a look at this script.

Printomatic

Printing... its a bit like breathing - you take it for granted, but when you can't do it - you know there is something wrong. Since I delivered my first Director project (the Videoworks ones probably needed it - but I can't remember that far back), there has been a need to print... and Director still cannot do it without an Xtra!

In the past, Prinotmatic has struggled with some printers and some printer drivers (though "nearly every problem with printing true color images or screen shots with PrintOMatic can be attributed to out of date or flawed printer drivers"). This problem does seem less common in recent years.

Where to get it

Alternatives

Not a lot. In projector's, you can use Directors 'printfrom' to print bitmaps. Apparently you can also use Flash assets to print (anyone volunteer to write a nice lingo wrapper?). Otherwise, a common strategy is to open documents up in separate applications (such as using BuddyAPI to print PDFs).

First published 13/02/2006