Director MX2004 Memory Leak

Synopsis

Director MX2004 leaks memory during publishing and within the published projector. This appears to be associated with the mere presence of javascript in a Director MX2004 project.

Details

When publishing a large project containing javascript, Director MX2004 crashes. Increasing the publishing Extra memory brings temporary relief, until the project grows larger, when no amount of Extra memory will help anymore.

The published projector which contains javascript will run for a while, but after some time, enough leaks will have occurred to cause a crash due to exceptions like:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x17808000
Note that the javascript scripts does not have to be run; the mere presence of javascript scripts will cause a memory leak.

The memory leak is caused by a bug in Director MX2004 memory reclamation.

Workarounds

Javascript memory is automatically reclaimed by Director MX2004 calling its garbage collector periodically. However, this never happens.

So you have to call the garbage collector yourself periodically in your script. Call the garbage collector using:

_system.gc();
You are probably familiar with the _system object; but the gc() function is undocumented.

To prevent Director MX2004 crashes during publishing, open the message window, change the script language to javascript, and manually run _system.gc() just before you publish a projector.

Javascript loop variable does not increment

Synopsis

A loop such as for (i=0;i<10;i++) does not increment i, and the loop never terminates.

Details

This occurs occationally when BuddyApi is used, but is most likely a bug in MX2004.

Workarounds

Declaring var i explicitly seems to solve the problem.

Member.FileName

Synopsis

In a Windows projector created on a Mac OSX Director MX 2004, the FileName property of a Member object is blank.

Details

In a Windows projector created on a Mac OSX Director MX 2004, scripts that attempt to access the FileName property of a Member object will read a blank.

The same scripts in the corresponding OSX projector will be able to read the correct file name in HFS format.

Workarounds

None.

How To Make A Movie With XTras On Mac Director Run On Windows Director

Synopsis

On the Mac, while building a Director projector for Windows which includes BuddyApi and Buddy File, Director complains that it cannot find BuddyApi or Buddy File.

Details

This error occurs for the Windows projector because, not only must the Xtras be selected to be include in the projector, a configuration file in Director also has to be edited.

What To Do

The following need be done:
  • Buddy API Xtra - Add to Configuration/Xtras/Tools.
  • Buddy File Xtra - Add to Configuration/Xtras/Tools.
  • budapi.x32 - Add to Cross Platform Resources/Windows/Xtras
  • BudFile.x32 - Add to Cross Platform Resources/Windows/Xtras
  • Configuration/xtraInfo.txt - edit to add the following text:
    [#namePPC:"Buddy API OSX Xtra", #nameW32:"budapi.x32"]
    [#namePPC:"Buddy File OSX Xtra", #nameW32:"BudFile.x32"]
    

startMovie() and stopMovie() are Not the First or Last Things To Run In A Movie

Synopsis

Some tasks must be done before a movie starts, or after a movie ends. As Director did not guarantee that the startMovie() script actually runs before anything starts, video clips may start playing before startMovie() can do anything.

Work Around

Do what you need to do by using startMovie() and stopMovie() in separate, dummy movies, which will _movie.go the actual movie you want to show.

Windows Projector Cannot Screen QuickTime Clips

Synopsis

You have completed your Director project and the Mac projector is working beautifully; now you run the Windows projector, and QuickTime clips don't start.

Details

It is true. QuickTime clips do not play on Windows.

Work Arounds

Download and install QuickTime from Apple.

The '@' Movie Path Sometimes Does Not Work In BuddyApi

Synopsis

The '@' movie path sometimes does not work in BuddyApi.

Details

The '@' movie path sometimes does not work in BuddyApi, or it may work most of the time and not work in a projector.

Work Around

Replace the '@' method with _movie.path.
133, New Bridge Road #24-01
Chinatown Point S(049513) •
Tel: 6-552-6826 •
Email: sales@bumblebee.com.sg
Copyright Bumble Bee Laboratories Pte. Ltd. September 2023