unLingo Dictionary

(unLingo Dictionary is outdated now. It was assembled for Director 5.0.1, now we have 6.0.1. Nevertheless, most undocs are still valid, and some undocs have become official features now) This dictionary tries to define undocumented features of Lingo, the programming language of Macromedia Director. You may find a lot more information about this Multimedia Authoring Tool at http://www.mcli.dist.maricopa.edu/director/.
The current version of Director is 5.01, released in autumn 1996.
The version of this dictionary is 0.04, published 02-FEB-1997.
New entries since last update: activeCastLib, deleteAll, do, ilk, member.

The unLingo Dictionary is far from complete or perfect. Your contribution is eagerly awaited!

Assembled by

--------------------------------------------------
VIVIANI Comp   CH-8833 Samstagern    Switzerland
E-mail: viviani@active.ch  Dr. Andreas Viviani
Tel: +41 1 786 11 16    Fax: +41 1 786 11 25
Homepage:  http://www2.active.ch/~viviani
---------------------------------------
with the great help of famous DIRECT-L subscribers.

Formatting is reduced to a minimum, so you can save this file as text only.
Please excuse the clamping style; my quirk is to write min( big, small ) or if( me = gaga ) then abort (The latter I do to fool all those C-ies [which I am myself]).

Disclaimer:

Nobody is responsible for this dictionary and for you or your clients when using it.
Features may vanish without notice in future versions of Director.
Really good features don't vanish normally, they get official. Because you use them.
Oh, yes, and this dictionary is not a BUG list. For the latter and more, go to Gretchen's site at http://http://www.updatestage.com/




Overview

Documented Keywords with Undocumented Features

This list provides more information about keywords listed in the official Lingo Dictionary.



Outdated Lingo

Listed below are keywords still working in the current version of Director, but not documented due to their outdated state. In all probability, they vanish; be sure to avoid them! If a keyword has no full replacement, there is a link to a comment about.



Undocumented Keywords

A question mark indicates that the keyword has some reported functionality, but which remains unclear. Keywords with no link have no known purpose so far. The chase is open!




from now on the real dictionary follows.

activeCastLib

Type: Undocumented property

Syntax: the activeCastLib

Description: The property holds the number of the cast library of the foremost cast window while authoring. It is unclear what the command does in Projectors; it is certainly not similar to "the activeWindow".

Example: The statement

  put the activeCastLib
  -- 2
will give you the number of the cast library of the active cast window.



cpuHogTicks

Type: Undocumented property

Syntax: the cpuHogTicks

Description: The statement defines the number of ticks Director can reserve processor time before other programs may come in. The default is 20 ticks. Increasing this property can be useful to enhance the performance of standalone demos.

Example: The statement

  set the cpuHogTicks = 3600
will give Director more priority over other programs.

Note: The statement may be without effect in multithreaded environments like Windows 95 or Windows NT.





deleteAll

Type: Undocumented command

Syntax: deleteAll <listName>

Description: deletes all values from a linear or property list

Example: The line

  deleteAll iMyList
deletes all values in the list named "iMyList", independent of its type. Yes, it's quite trivial and can be done with "set iMyList = []" or "iMyList = [:]" too, but the advantage is that you don't have to care about which type the list is.





do

Type: Command; undocumented feature: declaration of globals

Syntax: do <string>

Description: It is written in the Lingo Dictionary "This command does not allow global variables to be declared, they must be declared in advance". This is only true if no value assignment is included in the do command. The "do" statement behaves like a handler, it can only reference to what is included in. The trick now is to use the RETURN constant (actually writing a 2-line command).

Example: The line

  do "global gMyGlobal" & RETURN & "set gMyGlobal = 0"
declares a global named "gMyGlobal" and sets it to zero. This global is now accessible from any handler.





font

Type: Castmember property; undocumented chunk expression property

Syntax: the font of <chunkExpression> of field <castMember>

Description: It is possible to change the type font of words and characters of field castmembers.

Example: A field named germanNumbers containing "eins zwei drei" will change the type font of the word "zwei" to Helvetica after the statement

  set the font of word 2 of field "germanNumbers" = "Helvetica"
See also: fontSize, fontStyle, foreColor.





fontSize

Type: Castmember property; undocumented chunk expression property

Syntax: the fontSize of <chunkExpression> of field <castMember>

Description: It is possible to change the font size of words and characters of field castmembers.

Example: A field named germanNumbers containing "eins zwei drei" will change the font size of the word "zwei" to 18 pixels after the statement

  set the fontSize of word 2 of field "germanNumbers" = 18
See also: font, fontStyle, foreColor.





fontStyle

Type: Castmember property; undocumented chunk expression property

Syntax: the fontStyle of <chunkExpression> of field <castMember>

Description: It is possible to change the font styles of words and characters of field castmembers.

Example: A field named germanNumbers containing "eins zwei drei" will change the font style of the word "zwei" to boldface after the statement

  set the fontStyle of word 2 of field "germanNumbers" = "bold"
See also: font, fontSize, foreColor.





foreColor

Type: Castmember property; undocumented chunk expression property

Syntax: the foreColor of <chunkExpression> of field <castMember>

Description: It is possible to change the foreground colour of words and characters of field castmembers since Director 4.

Example: Given a field named colourField with the first character in cool blue and a field named hyperText containing "eins zwei drei", then the statement

  set the foreColor of word 2 of field "hyperText"¬
  = the foreColor of char 1 of field "colourField"
will change the foreground colour of the word "zwei" in field hyperText to cool blue.

Notes: There is no corresponding statement for backColor.
Please note the concept of colour definition from an existing field: This is a much better solution than setting colour palette numbers, which works only when the monitor is set to 256 colours.

See also: font, fontSize, fontStyle.





ilk

Type: Function with undocumented features.

Syntax: ilk( <anyVariable> ).

Description: This function returns handy symbols as listed in the examples below.

Examples:

put ilk( anything )
-- #void

put ilk( 1 )
-- #integer

put ilk( 1.0 )
-- #float

put ilk( #symbol )
-- #symbol

put ilk( "hi!" )
-- #string

put ilk( [1] )
-- #list

put ilk( [#1:1] )
-- #propList

put ilk( point( 1, 1 ) )
-- #point

put ilk( rect( 1, 1, 1, 1 ) )
-- #rect

put ilk( birth( script 1 ) )
-- #instance

put ilk( sprite 1 )
-- #sprite

put ilk( member 1 of castlib 1 )
-- #member

put ilk( castLib 1 )
-- #castLib

put ilk( the activeWindow )
-- #window

put ilk( the score )
-- #media




log10

Type: Hand-knit this function yourself.

Syntax: Like you want, see below.

Description: This keyword is a ghost since Director 3 and should represent the logarithm to the base of 10. There is already a log function, which returns the so-called natural logarithm, base e. Some confusion arises as mathematicians abbreviate the base 10 logarithm as "log" and the base e logarithm as "ln". You may implement log (aka log10) easily from ln (aka log), as shown in the example.

Example: With the following handler in a Movie Script:

  on log10 aNumber
    return log( aNumber ) / log( 10 )
  end log10
you can get in the Message Window:
  put log10( 1000 )
  -- 3.0000




maskMember

Type: Undocumented cast member property

Syntax: put the maskMember of member <memberNameOrNum>

Description: Returns the number of the cast member which will be used for a certain cast member as a mask when the cast member ink is set to "mask". The property cannot be set.

Example:

  put the maskMember of member 1
  -- (member 2 of castLib 1)

Note: The command is not very useful since the answer is as trivial as expected. This would be quite another story with the property settable.





member of sprite

Type: Undocumented sprite property

Syntax: the member of sprite <aSpriteNumber>

Description: This property is an object property of sprites that should be used instead of "memberNum" in Director 5! Even Macromedians posted samples with it to the List. The property can be read or set. The construction avoids problems with multiple cast libraries that are common with the old "memberNum" and "number of member".

Examples:

  put the member of sprite 5
  -- (member 2 of castLib 1)

  set the member of sprite 5 to member "sevenfold"
  set the member of sprite 5 to member "twofold" of castlib "DIBS"

Note: This property may have been forgotten accidentally in the Lingo Dictionary and the online help.





mouseEnter

Type: Undocumented sprite message

Syntax: The keyword is used in handlers:

  on mouseEnter
    <statement(s)>
  end
Description: The message is sent once to the corresponding sprite script or cast member script when the mouse cursor enters the sprite bounding box. But read on.

Example: Given a field cast member named colourPicker with the foreground colour of the second word set to green, the statement

  on mouseEnter
    set the backColor of member "stylePicker" = ¬
    the foreColor of word 2 of member "colourPicker"
    updateStage
  end mouseEnter
will change the background colour of the cast member named stylePicker to green when the mouse cursor enters the sprite box.

Warning: The feature only works correctly with the mouse button down! If the mouse is not pressed, the message is sent for the absolute coordinates of the sprite relative to the monitor, not the stage! So the feature works properly only with the stage set to top left. Therefore, you better test the rollOver function in an idle or enterFrame handler, despite this is not so intuitive.

See also: mouseLeave, mouseWithin.





mouseLeave

Type: Undocumented sprite message

Syntax: The keyword is used in handlers:

  on mouseLeave
    <statement(s)>
  end
Description: The message is sent once to the corresponding sprite script or cast member script when the mouse cursor leaves the sprite bounding box. But read on.

Example: Given a field cast member named colourPicker with the foreground colour of the first word set to red, the statement

  on mouseLeave
    set the backColor of member "stylePicker" = ¬
    the foreColor of word 1 of member "colourPicker"
    updateStage
  end mouseLeave
will change the background colour of the cast member named stylePicker to red when the mouse cursor leaves the sprite box.

Warning: The feature only works correctly with the mouse button down! If the mouse is not pressed, the message is sent for the absolute coordinates of the sprite relative to the monitor, not the stage! So the feature works properly only with the stage set to top left. Therefore, you better test the rollOver function in an idle or enterFrame handler, despite this is not so intuitive.

See also: mouseEnter, mouseWithin.





mouseWithin

Type: Undocumented sprite message

Syntax: The keyword is used in handlers:

  on mouseWithin
    <statement(s)>
  end
Description: The message is sent repeatedly to the corresponding sprite script or cast member script when the the mouse cursor is within the bounding box. Therefore, it is comparable to an idle message, but for rolled over sprites only. That seems to be a handy way to process rollovers, but read on.

Example: While moving the mouse over a member with the cast member script

  on mouseWithin
    set the locH of sprite 1 = ¬
    the locH of sprite 1 + the ticks mod 10
    updateStage
  end mouseWithin
it will get the willies.

Warning: The feature only works correctly with the mouse button down! If the mouse is not pressed, the message is sent for the absolute coordinates of the sprite relative to the monitor, not the stage! So the feature works properly only with the stage set to top left. Therefore, you better test the rollOver function in an idle or enterFrame handler, despite this is not so intuitive.

See also: mouseEnter, mouseLeave.





organizationName

Type: Undocumented property

Syntax: the organizationName

Description: Returns a string equivalent to the organization given when the program was registered. It can be tested but not set.

Example: The following statement returns the string indicated when processed in the Message window:

  put the organizationName
  -- "Acme Interactive, Inc."

Note: Works at author-time only, so you can't check the organization that created a projector title.

See also: serialNumber, userName.





productVersion

Type: Undocumented property

Syntax: the productVersion

Description: Provides the same string as version, indicating the implemented version of Director. It can be tested but not set.

Example: The following statement returns the string indicated when processed in the Message window:

  put the productVersion
  -- "5.0"

Note: the productVersion is preferable to the documented keyword (global) version, which shows some dubious behaviour when used in scripts.





productName

Type: Undocumented property

Syntax: the productName

Description: Returns the string "Director". It can be tested but not set.

Example: The following statement returns the string indicated when processed in the Message window:

  put the productName
  -- "Director"

Note: Although this command seems useless, it may play a future role in "Macromedia Office" (i.e., multiprogram-environments with programs from Macromedia).





rect

Type: Castmember property; some features undocumented

Syntax: the rect of member <fieldCastMember>

Description: It is possible to change the width of field castmembers and the height of fixed size field castmembers.

Example: The statement

  set the rect of member "displayText" = rect( 0, 0, 200, 200 )
will change the shape of the field named displayText to a rectangle 200 by 200 pixels wide, and wrap the text accordingly.





rollover

Type: Sprite function; best feature undocumented.

Syntax: rollover() or the rollover

Description: This otherwise documented function returns the number of the visible sprite the mouse cursor is over its bounding box, if used without argument. If there is an invisible or no sprite box under the cursor, it returns 0 (FALSE).

Example: All this headache and waste of processor time while looping through 48 sprite channels has gone with

  on idle
    set mouseUpChoice = the rollover
    put mouseUpChoice * 10 into field "usersPossibleChoice"
  end idle
to detect the sprite the user points to. The example displays the 10fold of the sprite channel in a field named usersPossibleChoice. No updateStage necessary, by the way. Why is this not in the official documentation?

Note: The standard rollover function, for example rollover(25), returns TRUE if that sprite number is rolled over, independent of the setting of "the visible of sprite". But "the rollover" returns zero if an invisible sprite is rolled over.





runMode

Type: Property; undocumented

Syntax: the runMode

Description: The value is "Author" when a movie is run from Director, or "Projector" when the movie is played as a Projector. This can be useful for different code in the two environments, for example, to hide some stuff in Projectors used only during development, or to turn on a self-knitted debugger in Author mode.

Example:

  if the runMode = "Author" then alert "Hits =" && hits
will show an alert displaying the value of the variable hits when the script is executed in Director.

Note: Shockwave returns . Although this is not correct, it is informative too and may modify a movie accordingly for the Internet.





saveMovie

Type: Command, some features undocumented

Syntax: saveMovie

Description: saveMovie will save the current movie or changes made to an existing movie even in a protected .dxr file, and, surprisingly, even in a Windows projector, but not in a Mac projector.

Note: This will not work on a write protected volume, like a CD-ROM, of course.
The "README" of DIR500 says: "Using saveMovie in a Windows 3.1 projector may corrupt the projector. The problem does not occur when using saveMovie in Director movies called from projectors, or protected movies." So the latter is saver anyway.





serialNumber

Type: Undocumented property

Syntax: the serialNumber

Description: Returns a string equivalent to the serial number given when the program was registered. It can be tested but not set.

Example: The following statement returns the string indicated according to the valid serial number when processed in the Message window:

  put the serialNumber
  -- "DRM500-12345-67890-12345"

Note: Works at author-time only, so you can't get other people's serial number by telling their .DXR's to report this value.

See also: organizationName, userName.





startTime

Type: Sprite property, outdated

Syntax: the startTime of sprite <spriteNumber>

Description: The value of startTime in ticks sets the beginning of a digital video movie in the specified sprite channel. This determines where playback begins.

Example: The statement has the digital video movie in sprite channel 5 start playing at 100 ticks into the movie:

  set the startTime of sprite 5 to 100
Note: This property may have been forgotten accidentally in the Lingo Dictionary.

See also: stopTime





stopTime

Type: Sprite property, outdated

Syntax: the stopTime of sprite <spriteNumber>

Description: The value of stopTime in ticks specifies the end of a digital video movie in the specified sprite channel. This determines where playback halts or loops if the loop property is turned on.

Example: The statement has the digital video movie in sprite channel 5 stop playing at 1500 ticks into the movie:

  set the stopTime of sprite 5 to 1500
Note: This property may have been forgotten accidentally in the Lingo Dictionary.

See also: startTime





the (list properties)

Type: keyword (property identifier), some features undocumented

Syntax: the <propertyName> of <listName>

Description: A fine way to get values from property lists, somewhat more intuitive than this getProp( listName, propertyName ). List properties may even be set this way. The list has to be declared as a global.

Example: Given a colour depth of 8 (256 colours) and a list named bloodList containing [#white:0, #aristocratic:3, #arterial:6, #venous:254] and a sprite named Bloody, the line

  set the foreColor of sprite "Bloody" = the venous of bloodList
will set the foreground colour of the sprite to a dark red when a Windows palette is active.





userName

Type: Undocumented property

Syntax: the userName

Description: Returns a string equivalent to the owner of Director as given when the program was registered. It can be tested but not set.

Example: The following statement returns the string indicated when processed in the Message window:

  put the userName
  -- "Humphrey Bogart"

Note: Works at author-time only, so you can't check the author that created a title.

See also: organizationName, serialNumber.





visible

Type: Window property, some features undocumented

Syntax: the visible of the stage

Description: The statement determines whether the stage is visible on the Macintosh.

Example: The statement

  set the visible of the stage = FALSE
will make the stage invisible on the Macintosh.

Note: This feature is not available under Windows. It would concern all MIAWs too: They can play only inside the stage on this platform. crusty old browsers document.write('


Director Web Tips n Tricks: '); document.write(document.title); document.write('
tip last modified ' + document.lastModified); document.write('

URL: '); document.write(document.location); document.write(''); // done hiding -->