Protect your work
December 20, 1998
by Pat McClellan
Dear Multimedia Handyman,
Is it possible to create a director movie that is protected?
Mike Peacock
Mike,
The easiest way to lock up your authoring secrets is to create a projector of your movie. Projectors compile your scripts into machine code and lock away the magic. Of course, that's not necessarily the best solution.
In most cases, you don't want a huge projector file. Better to have a stub projector -- a bare bones movie that simply goes to your first real movie with content. To create a stub projector, create a new director movie (called launcher.dir) with the same background color, default palette and stage dimensions as your first movie. For this example, we'll call the first movie "first.dir". In your launcher.dir, you don't need to have anything in the cast except one script, which goes in frame 1 of the score.
on exitFrame go to movie "first" end
Now, make a projector of launcher.dir. This file will be just about as small as a projector can be, since it has no media or score instructions (other than that one little script.) The purpose of this projector is simply to open up Director's playback engine and then to move to the first movie. This movie can then call any of your other movie files.
During authoring, these movies are dir files. On a Mac, you don't have the file extension to tell you -- though I've gotten in the habit of using cross-platform names anyway. *.dir files are what you get if you simply save a Director movie. That means that if you distribute your program with dir files, anybody with Director can open them up and see how you did it.
You can protect your dir files by converting them to dxr files. On Windows, you'll see the file extension change to *.dxr. These files cannot be opened from Director. In fact, not only can others NOT open them, you can't either. So be warned, back up your dir files before protecting them.
To convert dir files to dcr files, select Xtras -> Update Movies... This will open up a batch processing dialog box in which you can select the movies to be converted. You can also select external cast files, which will be converted from *.cst files to *.cxt files. The dialog box will also ask you to select a directory in which the original dir and cst files will be backed-up. Don't ever forego backing up your files, or you're screwed.
Now, in Windows or if you're using cross-platform file names on the Mac, there is a significant issue that you must deal with. One of the first Lingo commands most people learn is...
go to movie "whatever"
Now, if you're using file extensions -- such as mymovie.dir -- then it's common to have a script command like this...
go to movie "mymovie.dir"
However, there's a problem with this. If you convert mymovie.dir to mymovie.dxr, then the go to movie command (as written above) won't work. Luckily, Lingo allows for this. Instead of including the full filename (with extension), just use this:
go to movie "mymovie"
That works just fine. Same thing for external cast names, if you happen to be assigning them in Lingo.
One cool thing about dxr files is that you can make xtras and utilities and distribute them as dxr files. Roy Pardi's Behavior Writer Xtra is a good example. This xtra is simply a Director movie that Roy saved as a dxr. By placing the dxr file in your Director application's Xtras folder, it shows up in the Director Xtras menu during authoring. When you select it, it runs as a movie in a window -- a nice way to access authoring xtras.
Good luck with your program.
Copyright 1997-2024, Director Online. Article content copyright by respective authors.