Zeus Productions Banner

Zeus Tech Note
Installing and Using Xtras

(This document last revised August 26, 1997)

Copyright © 1996-1997. Zeus Productions. All Rights Reserved.
Written by Bruce A. Epstein

This TechNote explains how to install and use Xtras. You should first read the Xtras FAQ for answers to the most common questions about Xtras, including what versions are used under the different operating systems.

There are four distinct types of Xtras supported by Director, Lingo Xtras, Sprite Xtras, Tool Xtras and Transition Xtras. Regardless of the type of Xtra, they are all installed in the same location. The type of Xtra determines where they show up in Director once they are installed. Other Xtras may be used by Director but not show up anywhere in the interface. (Input Filters show up in the Import Dialog Box?) Others are used only during playback (?) such as the streaming Shockwave audio Xtras.


Xtra Versions

The Macintosh and Windows platforms require different versions of an Xtra. Furthermore, the different type of Macintosh models, and different versions of Windows may require more than one version of an Xtra.

Macintosh Xtras

The type of Xtra required on the Macintosh depends on the processor type (68K or PowerPC) and not the type of Projector (true?). The Mac OS will automatically look for the correct type of Xtra for the processor installed. The easiest course is to use both a Fat Binary Projector, and a Fat Xtra which is a single Xtra that will work with all types of Macintoshes.

Windows Xtras

The type of Xtra required under Windows depends on the processor type, not the operating system. The Xtra must always match the projector, so 16-bit Xtras are used with 16-bit Projectors and 32-bit Xtras are used with 32-bit Projectors. Generally 16-bit Xtras have an .X16 extension and are used under Windows 3.1 and 32-bit Xtras have an .X32 extension and are used under Windows 95/NT.

Installation


Under Windows, you can place both the .X16 and .X32 files in the same folder without fear of conflicts. The correct version of the Xtra will automatically be opened depending on the type of projector (16-bit or 32-bit) in use.

On the Macintosh, you ordinarily just include a FAT version of the Xtra, which will work with any type of Macintosh projector. It is possible to have separate 68K and PowerPC versions of an Xtra, but this is less common.

Director looks for Xtras in certain valid folders (see below). Xtras can be nested up to five folders deep, so it is possible to get your Xtras organized somewhat. By placing Xtras in the proper Xtras folder, they will be opened and closed automatically. Do not use the openXlib and closeXlib commands to open and close the Xtras, as you would with XObjects. Some problems have been reported when using openXLib and closeXLib with Xtras, and Macromedia strongly recommends putting the Xtras in the "Xtras" folder instead of using openXlib and closeXlib.

A projector will open all Xtras in the "Xtras" folder when it starts up. Unless you have very many Xtras, loading the Xtras should not require much time.

Xtras can contain version numbers, and theoretically, if you include multiple versions of the same Xtra, Director will select the newest one. In practice, many Xtra developers omit version information. It is best to delete old versions of Xtras and only include the current version in your Xtras folder.

Authoring Mode Xtras

During authoring, Xtras should be installed in the "Xtras" folder inside Director's installation directory:
After installing new Xtras be sure to restart Director. The Xtras will automatically be available for use throughout the Director session. Do not use "openxlib" or "closexlib" to access Xtras.

Run-Time Xtras

When using an Xtra from within a Projector, the Xtra(s) must be placed in a folder call "Xtras" within the same folder as the projector. Projectors will not access Xtras installed in the Authoring Mode Xtras folders.

TroubleShooting Your Installation

If a Lingo Xtra is installed properly, it should be listed along with other installed Xtras when you type "showXlib" in the message window. Tool Xtras should appear either under the Xtras menu. Transition Xtras should appear the transition dialog box. Sprite Xtras should appear under the list of available castmember types.

If you are having trouble: Macintosh Specific Trouble-shooting: Windows-specific trouble-shooting

Using Xtras


Using Lingo Xtras

Of all the Xtra types, only Lingo Xtras require you to write additional Lingo code. Within a Lingo Xtra there are one or more "methods" that perform various functions. Some methods, such as mMessageList and new are standard to all Xtras, but most methods are unique to a particular Xtra. There are three types of Lingo methods:

Standard Lingo Xtra Methods


All Lingo Xtras support certain standard methods:
global gFileObj
set gFileObj = new (xtra "FileIO")

if not objectP (gFileObj) then
alert "something didn't work"
else
gFileObj (createFile, the pathname & "junk.txt")
end if

Programming with Xtras

For those of you familiar with XObjects, there are several major differences when programming with Xtras: Each time an Xtra is instantiated and disposed, some memory is consumed, and it takes a while for Director to reclaim the memory. Instantiating an Xtra thousands of times is usually wasteful and can lead to a crash. Use a single Xtra instance throughout your project by assigning it to a global variable, rather than repeatedly instantiating the Xtra.

...much more to come, including:

Xtras in Shockwave, and new information about Xtras in Director 6



Home (Spotlight) | Table of Contents | Links | Contact Info

Place an Order | Products for Sale | Licensing | Downloads

TechNotes | FAQs | E-Mail Zeus | GuestBook | Glossary

[End of Page]

Copyright © 1996-1997. Zeus Productions. All Rights Reserved.