DIRECTOR MX ® 2004 Director Scripting Reference
Trademarks ActiveEdit, ActiveTest, Add Life to the Web, Afterburner, Aftershock, Andromedia, Allaire, Animation PowerPack, Aria, Attain, Authorware, Authorware Star, Backstage, Blue Sky Software, Blue Sky, Breeze, Bright Tiger, Clustercats, ColdFusion, Contents Tab Composer, Contribute, Design In Motion, Director, Dream Templates, Dreamweaver, Drumbeat 2000, EDJE, EJIPT, Extreme 3D, Fireworks, Flash, FlashHelp, Flash Lite, FlashPaper, Flex, Flex Builder, Fontographer, FreeHand, Generator, Help To Source, Ho
CONTENTS CHAPTER 1: Introduction . ............................................ 5 Intended audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 What’s new with Director scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 What’s new in this documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Finding information about scripting in Director . . . . . . . . . . . . . . . . . . . .
CHAPTER 4: Debugging Scripts in Director . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Good scripting habits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Basic debugging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Debugging in the Script window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Debugging in the Message window . . . . . . . . . . . . . . . .
CHAPTER 1 Introduction This reference provides conceptual and how-to information about scripting in Macromedia Director MX 2004, and also provides reference descriptions and examples for the scripting application programming interfaces (APIs) that you use to write scripts. The scripting APIs are the means by which you access the functionality of Director through script to add interactivity to a movie.
What’s new with Director scripting If you have written scripts in previous versions of Director, you should note some new and important changes about scripting in this latest release. Dot syntax scripting format In previous releases of Director, you could write Lingo scripts by using two types of syntax: verbose syntax or dot syntax. Verbose syntax was very similar to English, and was relatively easy for new programmers to learn.
Although the way you access the scripting APIs in this release may vary from previous releases, you still have access to the same APIs that you did before, in addition to some brand new ones. The only difference is that you access them by using the new objects. For more information on the objects and their corresponding scripting APIs, see “Introducing the Director objects” on page 51.
Constants Provides a list of the constants that are available in Director. Events and Messages Keywords Methods 8 Provides a list of the events that are available in Director. Provides a list of the keywords that are available in Director. Provides a list of the methods that are available in Director. Operators Provides a list of the operators that are available in Director. Properties Provides a list of the properties that are available in Director.
CHAPTER 2 Director Scripting Essentials If you are new to scripting in Macromedia Director MX 2004, you may want to take some time to learn the basic scripting concepts that are essential to understanding how to script in Director before you begin. Some of these essentials include definitions of important terms, syntax rules, available data types, and information about the basic elements of scripting in Director—for example, variables, arrays, operators, and so on.
• Parent scripts are special scripts that contain Lingo that is used to create child objects. You can • use parent scripts to generate script objects that behave and respond similarly yet can still operate independently of each other. A parent script icon appears in the lower right corner of the Cast window thumbnail. For information on using parent scripts and child objects, see “Object-oriented programming with Lingo” on page 55.
• Handlers, or event handlers, are sets of statements within a script that run in response to a specific event and subsequent message. When an event occurs, Director generates and sends a corresponding message to scripts, and a corresponding handler runs in response to the message. The names of handlers are always the same as the events and messages they respond to.
• Properties are attributes that define an object. For example, a sprite in a movie has specific • attributes, such as how wide it is, how tall it is, its background color, and so on. To access the values of these three specific attributes, you would use the Sprite object’s width, height, and backColor properties. For more information on assigning properties to variables, see “Storing and updating values in variables” on page 21. Statements are valid instructions that Director can execute.
• Parentheses are required after all method and function names. For example, when calling the Sound object’s beep() method, you must include the parentheses after the word beep. Otherwise, a script error will occur. // JavaScript syntax _sound.beep(); // this statement will work properly _sound.beep; // this statement will result in a script error When you call a method, function, or handler from within another method, function, or handler, you must include parentheses in the calling statement.
• The const keyword can be used in JavaScript syntax to specify a constant whose value does not change. Lingo has its own predefined set of constants (TAB, EMPTY, and so on); therefore, the keyword const does not apply to Lingo. For example, the following statement specifies a constant named intAuthors and sets its value to 12. This value will always be 12, and cannot be changed through script.
• Case-sensitivity can vary between Lingo and JavaScript syntax. Lingo is not case-sensitive in any circumstance—you can use uppercase and lowercase letters however you want. For example, the following four statements are equivalent: -- Lingo syntax member("Cat").hilite member("cat").hiLite MEMBER("CAT").HILITE Member("Cat").Hilite = = = = true True TRUE true Although Lingo is not case-sensitive, it’s a good habit to choose a case convention and use it consistently throughout your scripts.
Some data types are shared between Lingo and JavaScript syntax, and some data types are specific to one language or another. The set of data types that Director supports is fixed and cannot be modified, meaning that new data types cannot be added and existing data types cannot be removed. Director supports the following data types. 16 Data type Description # (symbol) A self-contained unit that can be used to represent a condition or flag. For example, #list or #word.
Data type Description undefined (JavaScript syntax only) Denotes a variable that does not have a value. Vector A point in 3D space. VOID (Lingo only) Denotes an empty value. Note: Many of the data types and objects that are specific to JavaScript syntax contain their own set of methods and properties that can be used to further manipulate those types.
Literal values A literal value is any part of a statement or expression that is to be used exactly as it is, rather than as a variable or a script element. Literal values that you encounter in script are character strings, integers, decimal numbers, cast member names and numbers, frame and movie names and numbers, symbols, and constants. Each type of literal value has its own rules. Strings Strings are words or groups of characters that script treats as regular words instead of as variables.
A decimal number, also called a floating-point number, or float, is any number that includes a decimal point. In Lingo, the floatPrecision property controls the number of decimal places used to display these numbers. Director always uses the complete number, up to 15 significant digits, in calculations; Director rounds any number with more than 15 significant digits in calculations. JavaScript syntax does not distinguish between integers and floating-point numbers, and merely uses numbers.
Constants A constant is a named value whose content never changes. In Lingo, the predefined terms TRUE, FALSE, VOID, and EMPTY are constants because their values are always the same. The predefined terms BACKSPACE, ENTER, QUOTE, RETURN, SPACE, and TAB are constants that refer to keyboard characters. For example, to test whether the last key pressed was the Space bar, use the following statement: -- Lingo syntax if _key.
In JavaScript syntax, you cannot compare symbols of the same name to determine whether they refer to the same symbol. To compare symbols of the same name, you must first convert them to strings by using the toString() method, and then perform the comparison. Variables Director uses variables to store and update values. As the name implies, a variable contains a value that can be changed or updated as a movie plays.
To assign a value to a variable: • Use the equals (=) operator. For example, the following statement assigns a URL to the variable placesToGo: // JavaScript syntax var placesToGo = "http://www.macromedia.com"; Variables can also hold the results of mathematical operations.
To display all current global variables and their current values: • Use the Global object’s showGlobals() method in the Message window. For more information on the Message window, see “Debugging in the Message window” on page 87. To clear all current global variables: • Use the Global object’s clearGlobals() method in the Message window to set the value of all global variables to VOID (Lingo) or undefined (JavaScript syntax).
• If you declare a variable inside or outside a JavaScript syntax function by using the syntax _global.varName, the variable is available to all scripts within a movie. The following example uses the syntax _global.gMovie in one script to declare the variable as global. This variable is available to all scripts within the movie. gMovie // JavaScript syntax _global.gMovie = 1; // Declare gMovie in one script // Create a function in a separate script that operates on gMovie function mouseDown() { _global.
Operators Operators are elements that tell Lingo and JavaScript syntax scripts how to combine, compare, or modify the values of an expression. Many of the operators in Director are shared between Lingo and JavaScript syntax, and some are unique to each language.
Arithmetic operators Arithmetic operators add, subtract, multiply, divide, and perform other arithmetic operations. Parentheses and the minus sign are also arithmetic operators. Operator Effect Precedence ( ) Groups operations to control precedence order. 5 - When placed before a number, reverses the sign of a number. 5 * Performs multiplication. 4 mod (Lingo only) Performs modulo operation. 4 / Performs division.
Operator Meaning Precedence !== (JavaScript syntax only) Two operands are not equal and/or not of the same type 1 <> (Lingo only) Two operands are not equal 1 < The left operand is less than the right operand 1 <= The left operand is less than or equal to the right operand 1 > The left operand is greater than the right operand 1 >= The left operand is great than or equal to the right operand 1 = (Lingo only) Two operands are equal 1 Assignment operators Assignment operators assign a
The not (Lingo) or ! (JavaScript syntax) operator is useful for toggling a TRUE or FALSE value to its opposite. For example, the following statement turns on the sound if it’s currently off and turns off the sound if it’s currently on: -- Lingo syntax _sound.soundEnabled = not (_sound.soundEnabled) // JavaScript syntax _sound.soundEnabled = !(_sound.soundEnabled); String operators String operators combine and define strings.
Both Lingo and JavaScript syntax provide conventions for altering the default execution order or script statements, and for performing actions depending on specific conditions. For example, you may want to do the following in your scripts: • Execute a set of statements if a logical condition is true, or execute alternate statements if the • • logical condition is false. Evaluate an expression and attempt to match the expression’s value to a specific condition.
When writing if...then structures in Lingo, you can place the statement or statements following then in the same line as then, or you can place them on their own line by inserting a carriage return after then. If you insert a carriage return, you must also include an end if statement at the end of the if...then structure.
• If the user pressed any other letter key, the computer beeps. -- Lingo syntax case (_key.key) of "a" : _movie.go("Apple") "b", "c": _movie.puppetTransition(99) _movie.go("Oranges") otherwise: _sound.beep() end case // JavaScript syntax switch (_key.key) { case "a" : _movie.go("Apple"); break; case "b": _movie.puppetTransition(99); _movie.go("Oranges"); break; case "c": _movie.puppetTransition(99); _movie.go("Oranges"); break; default: _sound.
The following example performs a similar action, but with decreasing numbers: -- Lingo syntax repeat with n = 10 down to 2 sprite(n).ink = 36 end repeat // JavaScript syntax for (var n=10; n>=2; n--) { sprite(n).ink = 36; } In Lingo, to repeat a set of instructions as long as a specific condition exists, use the repeat while structure. In JavaScript syntax, to repeat a set of instructions as long as a specific condition exists, use the structure.
Events, messages, and handlers A key component to creating powerful, useful scripts is an understanding of the concepts and functionality of events, messages, and handlers. Understanding the order in which events and messages are sent and received will help you determine exactly when specific scripts or parts of scripts should run. It will also help you debug scripts when specific actions are not occurring when you expect them to occur.
When the movie encounters a frame, events occur in the following order: 1 2 3 4 This event occurs only if new sprites begin in the frame. beginSprite stepFrame prepareFrame After enterFrame and before exitFrame, Director handles any time delays required by the tempo setting, idle events, and keyboard and mouse events. enterFrame 5 exitFrame 6 endSprite This event occurs only if the playhead exits a sprite in the frame.
• It must consist of one word or of several words connected by an underscore—no spaces are allowed. • It must be different from the name of any predefined Lingo or JavaScript syntax element. Using predefined Lingo or JavaScript keywords for message and handler names can create confusion. Although it is possible to explicitly replace or extend the functionality of a Lingo or JavaScript element by using it as a message or handler name, this should be done only in certain advanced situations.
After a handler intercepts a message, the message does not automatically pass on to the remaining locations. However, in Lingo you can use the pass() method to override this default rule and pass the message to other objects. If no matching handler is found after the message passes to all possible locations, Director ignores the message. The exact order of objects to which Director sends a message depends on the message.
For example, consider that you wrote a custom sprite method named jump() that takes a single integer as a parameter, and you placed the method in a behavior. When you call jump() from a sprite object reference, the handler must also include a parameter that represents the script object reference, and not just the single integer. In this case, the implied parameter is represented by the keyword me, but any term will work. -- Lingo syntax myHeight = sprite(2).
// JavaScript syntax function jump(aVal) { if(aVal == 5) { return; } else { aVal = aVal + 10; return(aVal); } } When you define a handler that returns a result, you must use parentheses after the handler when you call it from another handler. For example, the statement put(findColor()) calls the on findColor handler and then displays the result in the Message window.
You can also create empty linear lists. The following statements create empty linear lists. -- Lingo syntax workerList = [] -- using the Lingo list operator workerList = list() -- using list() with no parameters // JavaScript syntax var workerList = list(); // using list() with no parameters Creating property lists You create a property list in one of the following ways: • In Lingo, use either the top level propList() function or the list operator ([:]).
The following statements illustrate defining the linear list workerList that contains one value, Heather, and then adds Carlos as the second value in the list. -- Lingo syntax workerList = ["Heather"] -- define a linear list workerList[2] = "Carlos" -- set the second value using the equal operator workerList.
-- Lingo syntax foodList = [#Bruno:"sushi"] trace(foodList) -- displays foodList.Bruno = "teriyaki" trace(foodList) -- displays -- define a property list [#Bruno: "sushi"] -- use dot syntax to set the value of Bruno [#Bruno: "teriyaki"] // JavaScript syntax var foodList = propList("Bruno", "sushi"); // define a property list trace(foodList); // displays ["Bruno": "sushi"] foodList.
Checking items in lists You can determine the characteristics of a list and the number of items the list contains by using the following methods. • To display the contents of a list, use the put() or trace() functions, passing the variable that contains the list as a parameter. • To determine the number of items in a list, use the count() method (Lingo only) or the property. To determine a list’s type, use the ilk() method. To determine the maximum value in a list, use the max() method.
Adding and deleting items in lists You can add or delete items in a list by using the following methods. • • • • • • To add an item at the end of a list, use the append() method. To add an item at its proper position in a sorted list, use the add() or addProp() methods. To add an item at a specific place in a linear list, use the addAt() method. To add an item at a specific position in a property list, use the addProp() method.
To create a copy of a list that is independent of another list: • Use the duplicate() method. For example, the following statements create a list and then make an independent copy of the list. -- Lingo syntax oldList = ["a", "b", "c"] newList = oldList.duplicate() -- makes an independent copy of oldList // JavaScript syntax var oldList = list("a", "b", "c"); var newList = oldList.
// JavaScript syntax var list1 = list(5,10); var list2 = list(15,20); var mdList = list(list1, list2); trace(mdList[1][2]); // displays 10 trace(mdList[2][1]); // displays 15 JavaScript syntax arrays JavaScript syntax arrays are similar to Lingo-style linear lists in that each element in an array is a single value. One of the main differences between JavaScript syntax arrays and Lingo-style linear lists is that the index into an array always starts with 0.
• To delete an item from an array, use the Array object’s splice() method. • To replace an item in an array, use the Array object’s splice() method. The following example illustrates using the Array object’s splice() method to add items to, delete items from, and replace items in an array. // JavaScript syntax var myArray = new Array("1", "2"); trace(myArray); displays 1,2 myArray.push("5"); // adds the value "5" to the end of myArray trace(myArray); // displays 1,2,5 myArray.
Sorting arrays Arrays are sorted in alphanumeric order, with numbers being sorted before strings. Strings are sorted according to their initial letters, regardless of how many characters they contain. To sort an array: • Use the Array object’s sort() method. The following statements sort a non-sorted alphabetical array. // JavaScript syntax var oldArray = ["d", "a", "c", "b"]; oldArray.sort(); // results in a, b, c, d The following statements sort a non-sorted alphanumeric array.
Chapter 2: Director Scripting Essentials
CHAPTER 3 Writing Scripts in Director Scripts in Macromedia Director MX 2004 support all kinds of functionality in movies that would not be possible otherwise. As you write scripts, you may find the need for increasingly advanced scripts to support complex interactivity in your Director movies. Intermediate and advanced scripting concepts and techniques are presented here, including information about objectoriented scripting in Director.
Therefore, after you know how to access the scripting APIs in one language, you essentially know how to access them in the other language. For example, JavaScript syntax code can access Lingo data types such as symbols, linear lists, property lists, and so on, create and invoke Lingo parent scripts and behaviors, create and invoke Xtra extensions, and use Lingo string chunk expressions.
To identify chunks of text, include terms after the dot to refer to more specific items within text. For example, the first statement below refers to the first paragraph of the text cast member named "News Items". The second statement below refers to the second word in the first paragraph. -- Lingo syntax member("News Items").paragraph[1] member("News Items").paragraph[1].word[2] // JavaScript syntax member("News Items").getPropRef("paragraph", 1); member("News Items").getPropRef("paragraph", 1).
Core objects This category of objects provides access to the core functionality and features available in Director, such as the Director player engine, movie windows, sprites, sounds, and so on. They represent the base layer through which all APIs and other object categories are accessed. There are also a group of top-level methods and properties that enable you to access all of the core objects directly, instead of having to traverse the object hierarchy to access a specific core object.
Object model diagrams The following diagrams illustrate the basic high-level relationships between the object groups and their hierarchies within Director. For information on object creation, properties and methods, and other APIs, see the relevant API reference topics.
Top level functions and properties There are a number of top level functions and properties that provide direct access to the core objects and functionality in Director. You will likely make extensive use of many of these functions and properties as you create references to core objects, new images, lists, and so on. For example, the top level _movie property refers directly to the core Movie object, and the top level list() function creates a linear list.
Each paradigm enables you to apply the advantages of object-oriented programming to your scripts, so it does not really matter which scripting language you are using. You merely apply the principles in different ways. Because each scripting language uses a different paradigm to apply object-oriented principles, the techniques described for one language won’t work in the other language.
Parent script and child object basics In Lingo, a parent script is a set of handlers and properties that define a child object; it is not a child object itself. A child object is a self-contained, independent instance of a parent script. Children of the same parent have identical handlers and properties, so child objects in the same group can have similar responses to events and messages. Typically, parent scripts are used to build child objects that make it easier to organize movie logic.
A parent script makes another parent script its ancestor by assigning the script to its ancestor property. For example, the following statement makes the script What_Everyone_Does an ancestor to the parent script in which the statement occurs: -- Lingo syntax ancestor = new(script "What_Everyone_Does") When handlers and properties are not defined in a child object, Director searches for the handler or property in the child’s ancestors, starting with the child’s parent script.
The following on new handler creates a new child object from the parent script and initializes the child’s spriteNum property with the value passed to it in the aSpriteNum parameter. The return me statement returns the child object to the handler that originally called the on new handler. -- Lingo syntax property spriteNum on new me, aSpriteNum spriteNum = aSpriteNum return me end For more information on calling the on new handlers, see “Creating a child object” on page 59.
Creating a child object Child objects exist entirely in memory; they are not saved with a movie. Only parent and ancestor scripts exist on disk. To create a new child object, you use the new() method and assign the child object a variable name or position in a list so you can identify and work with it later. To create a child object and assign it to a variable, use the following syntax. -- Lingo syntax variableName = new(script "scriptName", parameter1, parameter2, ...
In addition to checking the properties that you assign, you can check whether a child object contains a specific handler or find out which parent script an object came from. This is useful when you have objects that come from parent scripts that are similar but that have subtle differences. For example, you may want to create a scenario in which one of several parent scripts might be used to create a child object.
Using scriptInstanceList You can use the scriptInstanceList property to dynamically add new behaviors to a sprite. Normally, scriptInstanceList is the list of behavior instances created from the behavior initializers defined in the Score. If you add child objects created from parent scripts to this list, the child objects receive the messages sent to other behaviors. For example, the following statement adds a child object to the scriptInstanceList property of sprite 10: -- Lingo syntax add(sprite(10).
To add an object to the actorList: • Use the actorList property as follows, where childObject is a reference to the child object to add: -- Lingo syntax _movie.actorList.add(childObject) The object’s stepFrame handler in its parent or ancestor script then runs automatically each time the playhead advances. The object is passed as the first parameter, me, to the on stepFrame handler.
This statement uses the following elements: • • • • • • • is the variable you are placing the timeout object into. timeout indicates which type of Lingo object you are creating. timeoutName is the name you give to the timeout object. This name appears in the timeOutList. It is the #name property of the object. new creates a new object. intMilliseconds indicates the frequency with which the timeout object should call the handler you specify. This is the #period property of the object.
Relaying system events with timeout objects When you create timeout objects that target specific child objects, you enable those child objects to receive system events. Timeout objects relay these events to their target child objects. The system events that can be received by child objects include prepareMovie, startMovie, stopMovie, prepareFrame, and exitFrame. By including handlers for these events in child objects, you can make the child objects respond to them for whatever purposes you see fit.
In general, keep the following in mind: • When using a reference to a script instance as a target, the target handler in that particular script instance is called. This technique does now allow the use of custom properties. • When using a reference to anything other than a script instance (such as a property list) as a target, the target handler in a movie script is called. This technique allows the use of custom properties.
• class A generic term for a superclass or subclass; a parent or child class. • instance or object instance A single object that has been created from a superclass. Custom classes One of the major advantages of object-oriented programming is the ability to create your own custom classes that enable you to add custom functionality to your scripts.
Constructor functions are typically used only to initialize new objects, but can also return the object if desired. If you do return the initialized object, the returned object becomes the value of the new expression. Object instances The most common way to create a new object instance is to use the new operator followed by the name of a constructor function. The following examples create new object instances.
Object inheritance In addition to being able to create your own custom classes, another major advantage of objectoriented programming is the ability of subclasses to inherit the properties and methods of the superclasses from which they were created. Inheritance enables you to easily create objects that already have built-in properties and functionality. In JavaScript syntax, there is one superclass that acts as the base class from which all other subclasses are created—the Object superclass.
Prototype objects typically are not suited to define properties and methods whose values may vary across object instances. In cases where values may vary across object instances, you typically define those properties and methods within the class itself.
The following example defines a function named Car_increaseSpeed(). The function name is then assigned to the increaseSpeed property of the Car class’s prototype object. // increase the speed of a Car function Car_increaseSpeed(x) { this.speed += x; return this.speed; } Car.prototype.increaseSpeed = Car_increaseSpeed; An object instance of Car could then access the increaseSpeed() method and assign its value to a variable by using the following syntax.
The following example defines a function named setInitialSpeed() that can change the default speed of new car instances. The function name is assigned to the setInitialSpeed property of the Car class. function Car(make, model, color) { // define a Car class this.make = make; this.model = model; this.color = color; this.speed = Car.defaultSpeed; } Car.defaultSpeed = 10; // initial speed for new Car instances // increase the speed of a Car function Car_setInitialSpeed(x) { Car.defaultSpeed = x; } Car.
Deleting variables You can delete a class variable or an instance variable by using the delete operator. The following example illustrates this process. function Car() { // define a Car constructor function ... } Car.color = "blue"; // define a color property for the Car class Car.prototype.engine = "V8"; // define an engine property for the prototype var objCar = new Car(); trace(Car.color); // displays "blue" trace(objCar.engine); // displays "V8" delete Car.color; delete Car.prototype.engine; trace(Car.
You can also add properties to object instances after the instances have been created. When you add a property to a specific object instance, that property is available only to that specific object instance. Using the myCar object instance created previously, the following statements add the color property to myCar after it has already been created. trace(myCar.color); // returns undefined myCar.color = "blue"; // add the color property to the myCar instance trace(myCar.
Setting Script window preferences You can change the font of text in the Script window and define different colors for various code components. To change the default font of text in the Script window and the color of various code elements, you use Script window preferences. Director automatically colors different types of code elements unless you turn off Auto Coloring. To set Script window preferences: 1 Select Edit > Preferences > Script.
Inserting common scripting terms The Script window provides pop-up menus of common scripting terms that you can use to insert statements in a script. The same menus also appear in the Message window. In both the Script window and the Message window, you can select which scripting syntax you want to use for a particular script. To select the scripting syntax: • From the Script Syntax pop-up menu, select either Lingo or JavaScript.
• The Categorized 3D Lingo menu lists categories of all 3D Lingo elements according to the features they are used for. • The Scripting Xtras pop-up menu includes the methods and properties of all scripting Xtra extensions found, regardless of whether they are Macromedia or third-party Xtra extensions. Note: The scripting Xtra extensions listed in the Scripting Xtras pop-up menu are only those that support the interface() method and whose names actually appear in the pop-up menu.
• To locate a handler in the current script, select the handler’s name from the Go to Handler pop-up menu in the Script window. • To compile any modified scripts, click the Script window’s Recompile All Modified Scripts • • • • • • button or close the Script window. When you modify a Script, an asterisk appears in the Script window title bar, indicating that the script needs to be recompiled. To compile all scripts in a movie, select Recompile All Scripts from the Control menu.
To find text in scripts: 1 Make the Script window active. 2 Select Edit > Find > Text. The Find Text dialog box appears. 3 Enter text that you want to find in the Find field, and then click Find. By default, find is not case-sensitive: ThisHandler, thisHandler, and THISHANDLER are all the same for search purposes. Click the Case Sensitive check box to make the find case-sensitive. To specify which cast members to search: • Select the appropriate option under Search: Scripts.
Performing common tasks The following are ways to perform common tasks for creating, attaching, and opening scripts. To create a frame behavior (script attached to a frame): • Double-click the behavior channel in the frame to which you want to attach the behavior. Behavior channels When you create a new behavior, the behavior receives the cast library number of the first available location in the current Cast window.
To create a sprite behavior (script attached to a sprite): • In the Score or on the Stage, select the sprite that you’re attaching the behavior to. Then select Window > Behavior Inspector and select New Behavior from the Behavior pop-up menu. When you create a new sprite behavior, the Script window opens and already contains the Lingo on mouseUp handler. The first line contains the line on mouseUp, followed by a line with a blinking insertion point, and then a line with the word end.
To cycle through the scripts in the Script window: • Use the Previous Cast Member and Next Cast Member arrows at the top of the Script window to advance or back up to a script. To duplicate a script: • Select the script in the Cast window and select Duplicate from the Edit menu. To create a script that is attached automatically to every sprite made from a specific cast member, attach the script to the cast member itself.
You can edit linked scripts normally in the Director Script window. Changes you make are written to the external files each time you save your Director movie. (If you imported the linked script from a UNIX server, UNIX line endings are preserved.) If you import a script whose text file is locked, you won’t be able to edit the script in Director. You cannot apply custom text colors to linked scripts in the Script window. Script auto coloring, however, is enabled for linked scripts.
CHAPTER 4 Debugging Scripts in Director Scripts do not always do what you want the first time. The script often has an error in its syntax: possibly a word is misspelled or a small part of the script is missing. Other times, the script might work but does not produce the expected result. Mistakes or bugs almost always occur when writing your scripts, so you should allow enough time for debugging when you develop multimedia titles.
Good scripting habits Good scripting habits can help you avoid many scripting problems in the first place. • Try to write your scripts in small sets of statements and test each one as you write it. This isolates potential problems where they are easier to identify. • Insert comments that explain what the script statements are intended to do and what the values in the script are for. This makes it easier to understand the script if you return to it later or if someone else works on it.
Locating the problem Do the following to start locating a problem: • Think backwards through the chain to identify where the unexpected started to happen. • Use the Message window to trace which frames the movie goes through and the handlers that your scripts run. • Determine what the scripts should be doing and consider what in these statements relates to • • the problem.
Looking for syntax errors Syntax errors are probably the most common bug encountered while scripting. When a script fails, it is a good idea to first make sure that: • Terms are spelled correctly, spaces are in the correct places, and necessary punctuation is used. Director cannot interpret incorrect syntax. • Quotation marks surround the names of cast members, labels, and strings within a statement. • All necessary parameters are present. The specific parameters depend on the individual element.
Debugging in the Script window The Script window contains several features that can help you debug scripts. To open the Script window: • Select Window > Script. To make the current line of code a comment: • Click Comment. To remove commenting from the current line of code: • Click Uncomment. To turn breakpoints in the current line of code on and off: • Click Toggle Breakpoint. To turn off all breakpoints. • Click Ignore Breakpoints.
Managing the Message window The Message window has an Input pane and an Output pane. The Input pane is editable. The Output pane is read-only. The only way to display text in the Output pane is by calling the put() or trace() functions. You can adjust the sizes of the Input and Output panes by dragging the horizontal divider that separates them. To resize the Output pane: • Drag the horizontal divider to a new position.
For example, if you type the following statement into the Message window: -- Lingo syntax put(50+50) // JavaScript syntax trace(50+50); and press Enter (Windows) or Return (Macintosh), the result appears in the Output pane: -- Lingo syntax -- 100 // JavaScript syntax // 100 If you type the following statement into the Message window: -- Lingo syntax _movie.stage.bgColor = 255 // JavaScript syntax _movie.stage.bgColor = 255; and press Enter (Windows) or Return (Macintosh), the Stage becomes black.
Like the Script window, the Message window contains pop-up menus of scripting commands. When you select a command from one of the pop-up menus, the command appears in the Message window with the first argument that you must provide selected. Several menus are provided to give you easy access to the whole catalog of scripting terms. The pop-up menus include the following: • • • • • Alphabetical Lingo includes all commands except 3D Lingo, presented in an alphabetical list.
Entries after an arrow made up of a double hyphen and right angle bracket (-->) indicate lines of your code that have run. For example, the following Lingo lines: --> --> --> --> _sound.fadeOut(1, 5*60) if leftSide < 10 then if leftSide < 200 then _movie.go("Game Start") indicate that these Lingo statements have run. Suppose you were trying to determine why the playhead did not go to the frame labeled "Game Start." If the line --> _movie.
Understanding object structure The Object inspector can be very useful for understanding the structure of complex objects. For example, 3D cast members have many layers of properties. Because the Object inspector shows you a visual representation of the nested structure of those properties, it makes it much easier to become familiar with them and their relationships to each other. Understanding the property structure of objects in Director is important when writing scripts.
To view an object using the Inspect Object button: 1 In the Script window, highlight the part of a statement that refers to an object. 2 In the Script window, click Inspect Object. If the object has subproperties, a plus sign (+) appears to the left of it. 3 Click the plus sign. The properties of the object appear below it. Properties with subproperties appear with a plus sign to their left. Click each plus sign to display the subproperties.
Removing objects You can also remove items from the Object inspector. To remove a single item from the Object inspector: • Select the item and press the Backspace (Windows) or Delete (Macintosh) key. To clear the entire contents of the Object inspector: • Right-click (Windows) or Control-click (Macintosh) inside the Object inspector and select Clear All from the context menu. When you open a separate movie from the one you are working on, the objects you entered in the Object inspector remain.
To add a breakpoint that will open the Debugger window: 1 In the Script window, open the script that should contain the breakpoint. 2 Click in the left margin of the Script window next to the line of code where you want the breakpoint to appear, or place the insertion point on the line of code and click Toggle Breakpoint. Your code will stop executing at the beginning of this line, and the Script window will enter debugging mode.
Viewing variables in the Debugger window The Variable pane of the Debugger window displays the variables associated with the current handler. The current handler is the handler displayed in the Script pane and the last handler displayed in the Call Stack pane. You can also display the variables associated with previous handlers in the call stack. As you step through a script, changes to the values of any of the variables are displayed in red.
To add an object to the Watcher pane whose name does not appear in the Script pane: 1 Double-click the first empty cell in the object column of the Watcher pane. 2 Type the name of the object in the cell and press Enter (Windows) or Return (Macintosh). If the object has properties, a plus sign (+) appears next to the object’s name. To display an object’s properties: • Click the plus sign next to the object name. The Watcher pane lets you organize objects in a few ways.
When you are finished debugging, you can exit the Debugger at any time: To resume normal execution of code an exit the Debugger window: • Click the Run Script button. To exit the Debugger and stop playback of the movie: • Click the Stop Debugging button. Editing scripts in debugging mode When you are in debugging mode, you may edit your scripts directly in the Debugger window. This enables you to fix bugs as soon as you find them and then continue debugging.
Advanced debugging If the problem is not easy to identify, try the following approaches: • Determine which section has the problem. For example, if clicking a button produces the • • • • • • wrong result, investigate the script assigned to the button. If a sprite does the wrong thing, try checking the sprite’s property values. Are they set to the values you want when you want? Figure out where the script flows.
Chapter 4: Debugging Scripts in Director
CHAPTER 5 Director Core Objects The core objects in Macromedia Director MX 2004 provide access to the core functionality and features available in Director, projectors, and the Macromedia Shockwave Player. Core objects include the Director player engine, movie windows, sprites, sounds, and so on. They represent the base layer through which almost all APIs and other object categories are accessed; the exceptions are the scripting objects, which extend the core functionality of Director.
Property summary for the Cast Library object Property fileName (Cast) member (Cast) name number (Cast) preLoadMode selection See also castLib, castLib(), Member, Movie, Player, Sprite, Window Global Provides a location to store and access global variables. These variables are available to both Lingo and JavaScript syntax. You can access the Global object by using the top level _global property.
Method summary for the Global object Method clearGlobals() showGlobals() See also _global Key Used to monitor a user’s keyboard activity. You can access the Key object by using the top level _key property. You can either assign _key to a variable, or use the _key property directly to access the Key object’s methods and properties. • Assign _key to a variable. -- Lingo syntax objKey = _key // JavaScript syntax var objKey = _key; • Use the _key property directly. -- Lingo syntax isCtrlDown = _key.
Member Represents a cast member within a cast library. Cast members are the media and script assets in a movie. Media cast members may be text, bitmaps, shapes, and so on. Script cast members include behaviors, movie scripts, and so on. A cast member can be referenced either by number or by name. • When referring to a cast member by number, Director searches a particular cast library for that • cast member, and retrieves the member’s data. This method is faster than referring to a cast member by name.
Property summary for the Member object Property castLibNum modifiedDate comments name creationDate number (Member) fileName (Member) purgePriority height rect (Member) hilite regPoint linked scriptText loaded size media thumbNail mediaReady type (Member) modified width modifiedBy See also Media Types, member(), member (Cast), member (Movie), member (Sprite), Movie, Player, Scripting Objects, Sprite, Window Mouse Provides access to a user’s mouse activity, including mouse movement and
Property (continued) mouseChar mouseV mouseDown mouseWord mouseH rightMouseDown mouseItem rightMouseUp mouseLine stillDown See also _mouse Movie Represents a movie being played within the Director player. The Director player can contain one or more movies. A movie can consist of one or more cast libraries. A cast library can consist of one or more cast members, which represent the media and script assets in a movie. Media cast members may be text, bitmaps, shapes, and so on.
Method (continued) constrainH() preLoadMovie() constrainV() printFrom() delay() puppetPalette() deleteFrame() puppetSprite() duplicateFrame() puppetTempo() endRecording() puppetTransition() finishIdleLoad() ramNeeded() frameReady() (Movie) rollOver() go() saveMovie() goLoop() sendAllSprites() goNext() sendSprite() goPrevious() stopEvent() idleLoadDone() unLoad() (Movie) insertFrame() unLoadMember() label() unLoadMovie() marker() updateFrame() mergeDisplayTemplate() updateSta
Property (continued) dockingEnabled path (Movie) editShortCutsEnabled preferred3dRenderer enableFlashLingo preLoadEventAbort exitLock score fileFreeSize scoreSelection fileSize script fileVersion sprite (Movie) fixStageSize stage frame timeoutList frameLabel traceLoad framePalette traceLogFile frameScript traceScript frameSound1 updateLock frameSound2 useFastQuads frameTempo xtraList (Movie) See also _movie, Cast Library, Member, movie, Player, Sprite, Window Player Represents
Method summary for the Player object Method alert() getPref() appMinimize() halt() cursor() open() (Player) externalParamName() quit() externalParamValue() setPref() flushInputEvents() windowPresent() Property summary for the Player object Property activeCastLib netPresent activeWindow netThrottleTicks alertHook organizationName applicationName productName applicationPath productVersion currentSpriteNum safePlayer debugPlaybackEnabled scriptingXtraList digitalVideoTimeScale search
Sound Controls audio playback in all eight available sound channels. The Sound object consists of Sound Channel objects, which represent individual sound channels. You can create a reference to the Sound object by using top level _sound property. • Assign _sound to a variable. -- Lingo syntax objSound = _sound // JavaScript syntax var objSound = _sound; • Use the _sound property to access the Sound object’s soundDevice property. -- Lingo syntax objDevice = _sound.
Sound Channel Represents an individual sound channel found within the Sound object. There are eight available sound channels. You can use a Sound Channel object in script to access and modify any of the eight sound channels. Note: You can modify only the first two sound channels in the Score of the Director user interface. You can create a reference to a Sound Channel object by using the top level sound() method, the Player object’s sound property, or the Sound object’s channel() method.
Property (continued) loopCount sampleRate loopEndTime startTime loopsRemaining status loopStartTime volume (Sound Channel) See also channel() (Sound), sound (Player), sound(), Sound Sprite Represents an occurrence of a cast member in a sprite channel of the Score. A Sprite object covers a sprite span, which is a range of frames in a given sprite channel. A Sprite Channel object represents an entire sprite channel, regardless of the number of sprites it contains.
You can use a reference to a Sprite object to access the cast member from which the sprite was created. Any changes made to the cast member from which a sprite was created are also reflected in the sprite. The following example illustrates changing the text of a text cast member from which sprite 5 was created. This change to the cast member will also be reflected in sprite 5. -- Lingo syntax labelText = sprite(5) labelText.member.
Sprite Channel Represents an individual sprite channel in the Score. A Sprite object covers a sprite span, which is a range of frames in a given sprite channel. A Sprite Channel object represents an entire sprite channel, regardless of the number of sprites it contains. Sprite channels are controlled by the Score by default. Use the Sprite Channel object to switch control of a sprite channel over to script during a Score recording session. A sprite channel can be referenced either by number or by name.
Property summary for the Sprite Channel object Property name (Sprite Channel) number (Sprite Channel) scripted sprite (Sprite Channel) See also Cast Library, channel() (Top level), Member, Movie, Player, Sprite, Window System Provides access to system and environment information, including system level methods. You can create a reference to the System object by using the top level _system property. • Assign _system to a variable.
Window Represents a window in which a movie is playing, including the Stage window and any other movies in a window (MIAWs) that are in use. You can create a reference to a Window object by using the top level window() function, the Player object’s window property, or the Player object’s windowList property. • Use the top level window() method. -- Lingo syntax objWindow = window("Sun") // JavaScript syntax var objWindow = window("Sun"); • Use the Player object’s window property.
Property summary for the Window object Property appearanceOptions resizable bgColor (Window) sizeState dockingEnabled sourceRect drawRect title (Window) fileName (Window) titlebarOptions image (Window) type (Window) movie visible name windowBehind picture (Window) windowInFront rect (Window) See also Cast Library, Member, Movie, Player, Sprite, window(), window, windowList Window 117
Chapter 5: Director Core Objects
CHAPTER 6 Media Types The media types in Macromedia Director MX 2004 provide access to the functionality of the various media types, such as RealMedia, DVD, Animated GIF, and so on, that are added to movies as cast members. Literally, media types are not actually objects, but rather cast members that are of a specific type of media.
Method summary for the Animated GIF media type Method resume() rewind() (Animated GIF, Flash) Property summary for the Animated GIF media type Property directToStage frameRate linked path (Movie) playBackMode See also Member Bitmap Represents a bitmap cast member.
Property summary for the Bitmap media type Property alphaThreshold imageCompression backColor imageQuality blend (Sprite) palette depth (Bitmap) picture (Member) dither rect (Image) foreColor trimWhiteSpace image (Image) useAlpha See also Member Button Represents a button or check box cast member. You can add a button cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.newMember(#button) // JavaScript syntax _movie.
You can associate a bitmap cast member with a color palette cast member by setting the palette property of the bitmap cast member. The following example sets the palette property of the bitmap cast member bmpMember to the color palette cast member colorPaletteMember. The value of the palette property reflects the number of the color palette cast member. -- Lingo syntax member("bmpMember").palette = member("colorPaletteMember") // JavaScript syntax member("bmpMember").
DVD Represents a DVD cast member. You can add a DVD cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.newMember(#dvd) // JavaScript syntax _movie.newMember("dvd"); Some of the following methods or properties may apply only to sprites that are created from a DVD cast member. Event summary for the DVD media type The following DVD events are always be handled by a DVDeventNotification event handler.
Property summary for the DVD media type Property angle (DVD) duration (DVD) angleCount folder aspectRatio frameRate (DVD) audio (DVD) fullScreen audioChannelCount mediaStatus (DVD) audioExtension playRate (DVD) audioFormat resolution (DVD) audioSampleRate selectedButton audioStream startTimeList audioStreamCount stopTimeList buttonCount subPicture chapter subPictureCount chapterCount title (DVD) closedCaptions titleCount currentTime (DVD) videoFormat domain volume (DVD) See a
Property summary for the Field media type Property alignment fontStyle autoTab lineCount border margin boxDropShadow pageHeight boxType scrollTop dropShadow selEnd editable selStart font text fontSize wordWrap See also Member Film Loop Represents a film loop cast member. You can add a film loop cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.newMember(#filmloop) // JavaScript syntax _movie.
Director supports the following Flash components: Flash component Description Button A resizable rectangular user interface button. CheckBox A fundamental part of any form or web application; can be used wherever you need to gather a set of true or false values that aren’t mutually exclusive. DateChooser A calendar that allows a user to select a date. Label A single line of text. List A scrollable single- or multiple-selection list box.
Flash Movie Represents a cast member or sprite that contains Flash content. You can add a Flash movie cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.newMember(#flash) // JavaScript syntax _movie.newMember("flash"); A Flash movie cast member or sprite can also contain Flash components. Flash components provide prepackaged functionality that extends the existing functionality of Flash movie cast members or sprites.
Property (continued) clickMode rotation defaultRect scale (Member) defaultRectMode scaleMode eventPassMode sound (Member) fixedRate static flashRect streamMode frameCount streamSize imageEnabled viewH linked viewPoint mouseOverButton viewScale originH viewV originMode See also Flash Component, Member Font Represents a font cast member. You can add a font cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.
Linked Movie Represents a linked movie cast member. You can add a linked movie cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.newMember(#movie) // JavaScript syntax _movie.newMember("movie"); Property summary for the Linked Movie media type Property scriptsEnabled See also Member QuickTime Represents a QuickTime cast member. You can add a QuickTime cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.
Property summary for the QuickTime media type Property audio (RealMedia) scale (Member) currentTime (QuickTime, AVI) staticQuality fieldOfView tilt hotSpotEnterCallback trackCount (Member) hotSpotExitCallback trackCount (Sprite) invertMask trackEnabled isVRMovie trackNextKeyTime loopBounds trackNextSampleTime mask trackPreviousKeyTime motionQuality trackPreviousSampleTime mouseLevel trackStartTime (Member) node trackStartTime (Sprite) nodeEnterCallback trackStopTime (Member) nodeEx
Method summary for the RealMedia media type Method pause() (RealMedia, SWA, Windows Media) play() (RealMedia, SWA, Windows Media) realPlayerNativeAudio() realPlayerPromptToInstall() realPlayerVersion() seek() stop() (RealMedia, SWA, Windows Media) Property summary for the RealMedia media type Property audio (RealMedia) password currentTime (RealMedia) pausedAtStart (RealMedia, Windows Media) displayRealLogo percentBuffered duration (RealMedia, SWA) soundChannel (RealMedia) image (RealMedia) state
Shockwave Audio Represents a Shockwave Audio cast member. You can add a Shockwave Audio cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.newMember(#swa) // JavaScript syntax _movie.
Sound Represents a cast member that is used to store and refer to sound samples. Sound samples are controlled by the core Sound and Sound Channel objects. A sound cast member does not have any APIs of its own, and uses the APIs of the Sound and Sound Channel objects to control its behavior. You can add a sound cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.newMember(#sound) // JavaScript syntax _movie.
Property summary for the Text media type Property antiAlias hyperlink antiAliasThreshold hyperlinkRange bottomSpacing hyperlinks charSpacing hyperlinkState firstIndent kerning fixedLineSpace kerningThreshold font RTF fontStyle selectedText HTML useHypertextStyles See also Member Vector Shape Represents a vector shape cast member. You can add a vector shape cast member to a movie by using the Movie object’s newMember() method. -- Lingo syntax _movie.
Property summary for the Vector Shape media type Property antiAlias imageEnabled backgroundColor originH broadcastProps originMode centerRegPoint originPoint closed originV curve regPointVertex defaultRect scale (Member) defaultRectMode scaleMode endColor strokeColor fillColor strokeWidth fillCycles vertex fillDirection vertexList fillMode viewH fillOffset viewPoint fillScale viewScale flashRect viewV gradientType See also Member Windows Media Represents a Windows Media cas
Method summary for the Windows Media media type Method pause() (RealMedia, SWA, Windows Media) play() (RealMedia, SWA, Windows Media) playFromToTime() rewind() (Windows Media) stop() (RealMedia, SWA, Windows Media) Property summary for the Windows Media media type Property audio (Windows Media) pausedAtStart (RealMedia, Windows Media) directToStage playRate (Windows Media) duration (Member) video (RealMedia, Windows Media) height volume (Windows Media) loop (Windows Media) width mediaStatus (Real
CHAPTER 7 Scripting Objects The scripting objects, also known as Xtra extensions, in Macromedia Director MX 2004 provide access to the functionality of the software components that are installed with Director and extend core Director functionary. The preexisting Xtra extensions provide capabilities such as importing filters and connecting to the Internet. If you know the C programming language, you can create your own custom Xtra extensions.
Method (continued) getPosition() writeChar() openFile() writeReturn() readChar() writeString() NetLingo Enables you to perform network operations such as obtaining or streaming media from a network, checking network availability, checking the progress of a network operation, and so on. You can create a reference to a NetLingo object by using the new operator.
SpeechXtra Enables you to add text-to-speech functionality to a movie. You can create a reference to a SpeechXtra object by using the new operator.
XML Parser Enables you to perform XML parsing. You can create a reference to an XML Parser object by using the new operator.
CHAPTER 8 3D Objects The 3D objects enable you to add 3D functionality to a movie. These objects are exposed to both Lingo and JavaScript syntax within Macromedia Director MX 2004, projectors, and the Macromedia Shockwave Player. You access these 3D objects through Shockwave 3D (or simply 3D) cast members. You can also create 3D sprites from the 3D cast members. Both 3D cast members and 3D sprites contain functionality that is specific to 3D cast members and sprites.
Camera Represents a Camera object. A camera controls how a 3D sprite views the 3D world. A 3D sprite displays a particular camera’s view into the world. You can create a reference to a camera by using the camera property of the 3D Member object. The camera property gets the camera at a specified index position in the list of cameras. In Lingo, you use the camera property directly from the 3D Member object to create a reference.
Property (continued) fog.color() projection fog.decayMode rootNode fog.enabled (fog) yon See also Group, Light, Model, Model Resource, Motion, Shader, Texture Group Represents a model that does not have a resource or any shaders. A group is the most basic node, and is merely a point in space that is represented by a transform. You can assign children and parents to this node in order to group models, lights, cameras, or other groups.
Property summary for the Group object Property name (3D) parent pointAtOrientation transform (property) userData worldPosition See also Camera, Light, Model, Model Resource, Motion, Shader, Texture Light Represents a light in a 3D world. Lights are used to light a 3D world. Without lights, the objects within the world cannot be seen. You can create a reference to a light by using the light property of the 3D Member object.
Member Represents a Shockwave 3D cast member. A Shockwave 3D (or simply 3D) cast member contains a complete 3D world. A 3D world contains the set of objects you use to add 3D functionality to a movie. You can create a reference to a 3D cast member by using either the top level member() function, or by using the member property of the Movie or Sprite object. These are the same techniques you can use to create a reference to a non-3D cast member. • Use the top level member() function.
Property summary for the Member object Property ambientColor loop (3D) animationEnabled model bevelDepth modelResource bevelType motion bytesStreamed (3D) percentStreamed (3D) camera preLoad (3D) cameraPosition reflectivity cameraRotation shader diffuseColor smoothness directionalColor specularColor directionalPreset state (3D) directToStage streamSize (3D) displayFace texture displayMode textureMember group textureType light tunnelDepth See also Camera, Group, Light, Model,
A model also contains modifiers that control how the model is rendered or how its animation behaves. Modifiers are attached to a model by using the addModifier() method. After a modifier has been attached to a model, its properties can be manipulated with script. The following modifiers are available to a model: Modifier Description Bones player Modifies a model’s geometry over time. Collision Allows a model to be notified of and respond to collisions.
Motion Represents a predefined animation sequence that involve the movement of a model or a model component. Individual motions can be set to play by themselves or with other motions. For example, a running motion can be combined with a jumping motion to simulate a person jumping over a puddle. You can create a reference to a motion by using the motion property of the 3D Member object. The motion property gets the motion at a specified index position in the list of motions.
See also Member, Sprite Shader Represents a model’s surface color. You can draw images on the surface of a model by applying one or more textures to each shader. You can create a reference to a shader by using the shader property of the 3D Member object. The shader property gets the shader at a specified index position in the list of shaders. In Lingo, you use the shader property directly from the 3D Member object to create a reference.
Method summary for the Sprite object Method addCamera cameraCount() deleteCamera Property summary for the Sprite object Property antiAliasingEnabled backColor camera directToStage See also Camera, Member Texture Represents the texture applied to a shader. You can create a reference to a texture by using the texture property of the 3D Member object. The texture property gets the texture at a specified index position in the list of textures.
CHAPTER 9 Constants This section provides an alphabetical list of all the constants available in Macromedia Director MX 2004. The majority of these constants apply only to Lingo. JavaScript syntax does contain some constants that are similar to the Lingo constants listed here; therefore, where appropriate, JavaScript syntax usage and examples are provided to help you map the functionality of Lingo constants with their closest counterparts in JavaScript syntax.
BACKSPACE Usage -- Lingo syntax BACKSPACE // JavaScript syntax 51 // value of _key.keyCode Description Constant; represents the Backspace key. This key is labeled Backspace in Windows and Delete on the Macintosh. Example This on keyDown handler checks whether the Backspace key was pressed and, if it was, calls the handler clearEntry: --Lingo syntax on keyDown if (_key.key = BACKSPACE) then clearEntry _movie.stopEvent() end keyDown // JavaScript syntax function keyDown() { if (_key.
ENTER Usage --Lingo syntax ENTER // JavaScript syntax 3 // value of _key.keyCode Description Character constant; represents Enter (Windows) or Return (Macintosh) for a carriage return. On PC keyboards, the element ENTER refers only to Enter on the numeric keypad. For a movie that plays back as an applet, use RETURN to specify both Return in Windows and Enter on the Macintosh.
FALSE Usage -- Lingo syntax FALSE // JavaScript syntax false Description Constant; applies to an expression that is logically FALSE, such as 2 > 3. When treated as a number value, FALSE has the numerical value of 0. Conversely, 0 is treated as FALSE. Example This statement turns off the soundEnabled property by setting it to FALSE: -- Lingo syntax _sound.soundEnabled = FALSE // JavaScript syntax _sound.soundEnabled = false; See also if, not, TRUE PI Usage -- Lingo syntax PI // JavaScript syntax Math.
QUOTE Usage --Lingo syntax QUOTE // JavaScript syntax \" Description Constant; represents the quotation mark character and refers to the literal quotation mark character in a string, because the quotation mark character itself is used by Lingo scripts to delimit strings.
RETURN (constant) Usage -- Lingo syntax RETURN // JavaScript syntax 36 // value of _key.keyCode \n // when used in a string Description Constant; represents a carriage return. Example This statement causes a paused movie to continue when the user presses the carriage return: -- Lingo syntax if (_key.key = RETURN) then _movie.go(_movie.frame + 1) // JavaScript syntax if (_key.keyCode == 36) { _movie.go(_movie.
TAB Usage -- Lingo syntax TAB // JavaScript syntax 48 // value of _key.keyCode Description Constant; represents the Tab key. Example This statement checks whether the character typed is the tab character and calls the handler doNextField if it is: -- Lingo syntax if (_key.key = TAB) then doNextField // JavaScript syntax if (_key.keyCode == 48) { doNextField(); } These statements move the playhead forward or backward, depending on whether the user presses Tab or Shift+Tab: -- Lingo syntax if (_key.
TRUE Usage -- Lingo syntax TRUE // JavaScript syntax true Description Constant; represents the value of a logically true expression, such as 2 < 3. It has a traditional numerical value of 1, but any nonzero integer evaluates to TRUE in a comparison. Example This statement turns on the soundEnabled property by setting it to TRUE: -- Lingo syntax _sound.soundEnabled = TRUE // JavaScript syntax _sound.
CHAPTER 10 Events and Messages This section provides an alphabetical list of all the events and messages available in Macromedia Director MX 2004. on activateApplication Usage -- Lingo syntax on activateApplication statement(s) end // JavaScript syntax function activateApplication() { statement(s); } Description Built-in handler; runs when the projector is brought to the foreground.
Example This handler plays a sound each time the user brings the projector back to the foreground: -- Lingo syntax on activateApplication sound(1).queue(member("openSound")) sound(1).play() end // JavaScript syntax function activateApplication() { sound(1).queue(member("openSound")); sound(1).
See also activeWindow, close(), on deactivateWindow, frontWindow, on moveWindow, open() (Window) on beginSprite Usage -- Lingo syntax on beginSprite statement(s) end // JavaScript syntax function beginSprite() { statement(s); } Description System message and event handler; contains statements that run when the playhead moves to a frame that contains a sprite that was not previously encountered.
on closeWindow Usage -- Lingo syntax on closeWindow statement(s) end // JavaScript syntax function closeWindow() { statement(s); } Description System message and event handler; contains statements that run when the user closes the window for a movie by clicking the window’s close box. The on closeWindow handler is a good place to put Lingo commands that you want executed every time the movie’s window closes.
• • • The number of the sound or sprite channel for the file where the cue point occurred. cuePointNumber The ordinal number of the cue point that triggers the event in the list of the cast member’s cue points. cuePointName The name of the cue point that was encountered. channelID The message is passed—in order—to sprite, cast member, frame, and movie scripts. For the sprite to receive the event, it must be the source of the sound, like a QuickTime movie or SWA cast member.
Example This handler plays a sound each time the user sends the projector to the background: -- Lingo syntax on deactivateApplication sound(1).queue(member("closeSound")) sound(1).play() end // JavaScript syntax function deactivateApplication() { sound(1).queue(member("closeSound")); sound(1).
on DVDeventNotification Usage -- Lingo syntax on DVDeventNotification objectRef, event {, eventArg1} {, eventArg2} {, eventArg3} statement(s) end // JavaScript syntax function DVDeventNotification (objectRef, event {, eventArg1} {, eventArg2} {, eventArg3}) { statement(s); } Description Author-specified DVD event handler. Contains statements that run in response to events that occur while a DVD is playing. This handler can be used to track all DVD events.
Event Description chapterStart Occurs when playback of a new program in the title domain starts. The following additional information is passed to DVDeventNotification when this event occurs: • eventArg2 - An integer that indicates the new chapter number. diskEjected Occurs when a DVD is ejected. diskInserted Occurs when a DVD is inserted. domainChange Occurs when the DVD player’s domain changes.
Event Description parentalLevelChange Occurs when the parental level of the authored content is about to change. The following additional information is passed to DVDeventNotification when this event occurs: • eventArg2. An integer that indicates the new parental level set in the player. playbackStopped Occurs when playback stops. The DVD Navigator has completed playback of the PGC and did not find any other branching instruction for subsequent playback.
Event Description UOPchange Occurs when one of the available playback or search mechanisms has changed. The following additional information is passed to DVDeventNotification when this event occurs: • eventArg2 - An integer or address that indicates which playback or search mechanisms the DVD disc explicitly disabled. warning Occurs when a DVD warning condition is encountered.
Example This handler runs when the playhead exits a sprite: -- Lingo syntax on endSprite me -- clean up gNumberOfSharks = gNumberOfSharks - 1 sound(5).stop() end // JavaScript syntax function endSprite() { // clean up gNumberOfSharks--; sound(5).
Example This handler turns off the puppet condition for sprites 1 through 5 each time the playhead enters the frame: -- Lingo syntax on enterFrame repeat with i = 1 to 5 _movie.puppetSprite(i, FALSE) end repeat end // JavaScript syntax function enterFrame() { for (i=1;i<=5;i++) { _movie.
Example This shows how to make the playhead jump to a specific frame depending on what frame is passed in as the parameter: -- Lingo syntax on EvalScript aParam _movie.go(aParam) end // JavaScript syntax function EvalScript(aParam) { _movie.go(aParam); } This handler runs the statement _movie.go(aParam) if it receives an EvalScript message that includes dog, cat, or tree as an argument: -- Lingo syntax on EvalScript aParam case aParam of "dog", "cat", "tree": _movie.
on exitFrame Usage -- Lingo syntax on exitFrame statement(s) end // JavaScript syntax function exitFrame() { statement(s); } Description System message and event handler; contains statements that run each time the playhead exits the frame that the on exitFrame handler is attached to. The on exitFrame handler is a useful place for Lingo that resets conditions that are no longer appropriate after leaving the frame.
This handler branches the playhead to a specified frame if the value in the global variable vTotal exceeds 1000 when the playhead exits the frame: // JavaScript syntax function exitFrame() { if (_global.vTotal > 1000) { _movie.
on getBehaviorTooltip Usage -- Lingo syntax on getBehaviorTooltip statement(s) end // JavaScript syntax function getBehaviorTooltip() { statement(s); } Description System message and event handler; contains Lingo that returns the string that appears in a tooltip for a script in the Library palette. Director sends the getBehaviorTooltip message to the script when the cursor stops over it in the Library palette. Place the on getBehaviorTooltip handler within the behavior. The use of the handler is optional.
Description System message and event handler; contains Lingo that generates a list of definitions and labels for the parameters that appear in a behavior’s Parameters dialog box. Place the on getPropertyDescriptionList handler within a behavior script. Behaviors that don’t contain an on getPropertyDescriptionList handler don’t appear in the Parameters dialog box and can’t be edited from the Director interface.
on hyperlinkClicked Usage -- Lingo syntax on hyperlinkClicked me, data, range statement(s) end // JavaScript syntax function hyperlinkClicked(data, range) { statement(s); } Description System message and event handler; used to determine when a hyperlink is actually clicked.
on idle Usage -- Lingo syntax on idle statement(s) end // JavaScript syntax function idle() { statement(s); } Description System message and event handler; contains statements that run whenever the movie has no other events to handle and is a useful location for Lingo statements that you want to execute as frequently as possible, such as statements that update values in global variables and displays current movie conditions.
on isOKToAttach Usage -- Lingo syntax on isOKToAttach me, aSpriteType, aSpriteNum statement(s) end // JavaScript syntax function isOKToAttach(aSpriteType, aSpriteNum) { statement(s) } Description Built-in handler; you can add this handler to a behavior in order to check the type of sprite the behavior is being attached to and prevent the behavior from being attached to inappropriate sprite types.
// JavaScript syntax function isOKToAttach(aSpriteType, aSpriteNum) { switch (aSpriteType) { case symbol("graphic"): // any graphic sprite type return sprite(aSpriteNum).member.
You can override an on keyDown handler by placing an alternative on keyDown handler in a location that Lingo checks before it gets to the handler you want to override. For example, you can override an on keyDown handler assigned to a cast member by placing an on keyDown handler in a sprite script. Example This handler checks whether the Return key was pressed and if it was, sends the playhead to another frame: -- Lingo syntax on keyDown if (_key.key = RETURN) then _movie.
When the movie plays back as an applet, an on keyUp handler always traps key presses, even if the handler is empty. If the user is typing in an editable field, an on keyUp handler attached to the field must include the pass command for the key to appear in the field. Where you place an on keyUp handler can affect when it runs, as follows: • • • • To apply the handler to a specific editable field sprite, put it in a behavior.
When the mouse button is pressed, Lingo searches the following locations, in order, for an on mouseDown handler: primary event handler, sprite script, cast member script, frame script, and movie script. Lingo stops searching when it reaches the first location that has an on mouseDown handler, unless the handler includes the pass command to explicitly pass the mouseDown message on to the next location.
on mouseEnter Usage -- Lingo syntax on mouseEnter statement(s) end // JavaScript syntax function mouseEnter() { statement(s); } Description System message and event handler; contains statements that run when the mouse pointer first contacts the active area of the sprite. The mouse button does not have to be pressed. If the sprite is a bitmap cast member with matte ink applied, the active area is the portion of the image that is displayed; otherwise, the active area is the sprite’s bounding rectangle.
on mouseLeave Usage -- Lingo syntax on mouseLeave statement(s) end // JavaScript syntax function mouseLeave() { statement(s); } Description System message and event handler; contains statements that run when the mouse leaves the active area of the sprite. The mouse button does not have to be pressed. If the sprite is a bitmap cast member with the matte ink applied, the active area is the portion of the image that is displayed; otherwise, the active area is the sprite’s bounding rectangle.
on mouseUp (event handler) Usage -- Lingo syntax on mouseUp statement(s) end // JavaScript syntax function mouseUp() { statement(s); } Description System message and event handler; contains statements that are activated when the mouse button is released. When the mouse button is released, Lingo searches the following locations, in order, for an on mouseUp handler: primary event handler, sprite script, cast member script, frame script, and movie script.
Example This handler, assigned to sprite 10, switches the cast member assigned to sprite 10 when the user releases the mouse button after clicking the sprite: -- Lingo syntax on mouseUp sprite(10).member = member("Dimmed") end // JavaScript syntax function mouseUp() { sprite(10).
on mouseWithin Usage -- Lingo syntax on mouseWithin statement(s) end // JavaScript syntax function mouseWithin() { statement(s); } Description System message and event handler; contains statements that run when the mouse is within the active area of the sprite. The mouse button does not have to be pressed. If the sprite is a bitmap cast member with the matte ink applied, the active area is the portion of the image that is displayed; otherwise, the sprite’s bounding rectangle is the active area.
Example This handler displays a message in the Message window when the window a movie is playing in moves: -- Lingo syntax on moveWindow put("Just moved window containing" && _movie.name) end // JavaScript syntax function moveWindow() { put("Just moved window containing " + _movie.
on prepareFrame Usage -- Lingo syntax on prepareFrame statement(s) end // JavaScript syntax function prepareFrame { statement(s); } Description System message and event handler; contains statements that run immediately before the current frame is drawn. Unlike beginSprite and endSprite events, a prepareFrame event is generated each time the playhead enters a frame. The on prepareFrame handler is a useful place to change sprite properties before the sprite is drawn.
Description System message and event handler; contains statements that run after the movie preloads cast members but before the movie does the following: • Creates instances of behaviors attached to sprites in the first frame that plays. • Prepares the first frame that plays, including drawing the frame, playing any sounds, and executing transitions and palette effects. New global variables used for sprite behaviors in the first frame should be initialized in the handler.
Example This handler moves sprite 3 to the coordinates stored in the variable centerPlace when the window that the movie is playing in is resized: -- Lingo syntax on resizeWindow centerPlace sprite(3).loc = centerPlace end // JavaScript syntax function resizeWindow(centerPlace) { sprite(3).
on rightMouseUp (event handler) Usage -- Lingo syntax on rightMouseUp statement(s) end // JavaScript syntax function rightMouseUp() { statement(s); } Description System message and event handler; in Windows, specifies statements that run when the right mouse button is released.
Example The following handler overrides the behavior’s values set in the Parameters dialog box for the behavior. New values are contained in the list currentInitializerList. Normally, the Parameters dialog box allows the user to set the mass and gravitational constants.
on sendXML Usage -- Lingo syntax on sendXML "sendxmlstring", "window", "postdata" statement(s) end // JavaScript syntax function sendXML(sendxmlstring, window, postdata) { statement(s); } Description Event handler; functions much like the getURL scripting method, which is also available using the Macromedia Flash Asset Xtra extension. The on sendXML handler is called in Lingo when the XMLobject.send ActionScript method is executed in a Flash sprite or Flash XML object. In ActionScript, the XMLobject.
// JavaScript syntax function sendXML(theURL, targetWindow, xmlData) { gotoNetPage(theURL, targetWindow); postNetText(theURL, xmlData); } on startMovie Usage -- Lingo syntax on startMovie statement(s) end // JavaScript syntax function startMovie() { statement(s); } Description System message and event handler; contains statements that run just before the playhead enters the first frame of the movie. The startMovie event occurs after the prepareFrame event and before the enterFrame event.
on stepFrame Usage -- Lingo syntax on stepFrame statement(s) end // JavaScript syntax function stepFrame() { statement(s); } Description System message and event handler; works in script instances in actorList because these are the only objects that receive on stepFrame messages. This event handler is executed when the playhead enters a frame or the Stage is updated. An on stepFrame handler is a useful location for Lingo that you want to run frequently for a specific set of objects.
on stopMovie Usage -- Lingo syntax on stopMovie statement(s) end // JavaScript syntax function stopMovie() { statement(s); } Description System message and event handler; contains statements that run when the movie stops playing. An on stopMovie handler is a good place to put Lingo that performs cleanup tasks—such as closing resource files, clearing global variables, erasing fields, and disposing of objects—when the movie is finished.
Description System message and event handler; called periodically to determine how much of an object has been downloaded from the Internet. The handler is called only if tellStreamStatus (TRUE) has been called, and the handler has been added to a movie script. The on streamStatus event handler has the following parameters: URL Displays the Internet address of the data being retrieved. state Displays the state of the stream being downloaded.
on timeOut Usage -- Lingo syntax on timeOut statement(s) end // JavaScript syntax function timeOut() { statement(s); } Description System message and event handler; contains statements that run when the keyboard or mouse is not used for the time period specified in timeOutLength. Always place an on timeOut handler in a movie script. To have a timeout produce the same response throughout a movie, use the timeoutScript to centrally control timeout behavior.
Example The following handler pauses a movie when a user double-clicks the system tray icon. -- Lingo syntax on trayIconMouseDoubleClick _movie.delay(500) end // JavaScript syntax function trayIconMouseDoubleClick() { _movie.
trayIconRightMouseDown Usage -- Lingo syntax on trayIconRightMouseDown statement(s) end // JavaScript syntax function trayIconRightMouseDown() { statement(s); } Description Movie and Window event handler (Microsoft Windows only). Contains statements that run when a user right-clicks the system tray icon. The trayIconRightMouseDown event is sent to the handler only if the systemTrayIcon property is set to TRUE. Example The following handler pauses a movie when a user right-clicks the system tray icon.
An on zoomWindow event handler is a good place to put Lingo that rearranges sprites when window dimensions change. Example This handler moves sprite 3 to the coordinates stored in the variable centerPlace when the window that the movie is playing in is resized: -- Lingo syntax on zoomWindow centerPlace = point(10, 10) sprite(3).loc = centerPlace end // JavaScript syntax function zoomWindow() { var centerPlace = point(10, 10); sprite(3).
CHAPTER 11 Keywords This section provides an alphabetical list of all the keywords available in Macromedia Director MX 2004. These keywords apply only to Lingo. JavaScript syntax does contain some keywords and constructs that are similar in function to the following Lingo keywords, but they are not documented here. For more information about JavaScript syntax keywords and constructs, see Chapter 2, “Director Scripting Essentials,” on page 9.
Description Keyword; starts a multiple branching logic structure that is easier to write than repeated if...then statements. Lingo compares the value in case expression to the expressions in the lines beneath it, starting at the beginning and continuing through each line in order, until Lingo encounters an expression that matches case expression. When Lingo finds a matching expression, it executes the corresponding statement or statements that follow the colon after the matching expression.
char...of Usage -- Lingo syntax textMemberExpression.char[whichCharacter] char whichCharacter of fieldOrStringVariable textMemberExpression.char[firstCharacter..lastCharacter] char firstCharacter to lastCharacter of fieldOrStringVariable Description Keyword; identifies a character or a range of characters in a chunk expression. A chunk expression is any character, word, item, or line in any source of text (such as field cast members and variables) that holds a string.
end Usage -- Lingo syntax end Description Keyword; marks the end of handlers and multiple-line control structures. Example The following mouseDown handler ends with an end mouseDown statement. on mouseDown _player.alert("The mouse was pressed") end mouseDown end case Usage -- Lingo syntax end case Description Keyword; ends a case statement. Example This handler uses the end case keyword to end the case statement: on keyDown case (_key.key) of "a": _movie.go("Apple") "b", "c": _movie.
Example The first statement of this script checks whether the monitor is set to black and white and then exits if it is: on setColors if _system.colorDepth = 1 then exit sprite(1).foreColor = 35 end See also abort, halt(), quit(), pass, return (keyword) exit repeat Usage -- Lingo syntax exit repeat Description Keyword; instructs Lingo to leave a repeat loop and go to the statement following the end statement but to remain within the current handler or method.
The term field was used in earlier versions of Director and is maintained for backward compatibility. For new movies, use member to refer to field cast members. Example This statement places the characters 5 through 10 of the field name entry in the variable myKeyword: myKeyword = field("entry").char[5..10] This statement checks whether the user entered the word desk and, if so, goes to the frame deskBid: if member("bid") contains "desk" then _movie.go("deskBid") See also char...of, item...of, line...
See also showGlobals(), property, gotoNetMovie if Usage if logicalExpression then statement if logicalExpression then statement else statement end if if logicalExpression then statement(s) end if if logicalExpression then statement(s) else statement(s) end if if logicalExpression1 then statement(s) else if logicalExpression2 then statement(s) else if logicalExpression3 then statement(s) end if if logicalExpression1 then statement(s) else logicalExpression2 end if Description Keyword; if...
Example This statement checks whether the carriage return was pressed and then continues if it was: if the key = RETURN then go the frame + 1 This handler checks whether the Command and Q keys were pressed simultaneously and, if so, executes the subsequent statements: on keyDown if (_key.commandDown) and (_key.key = "q") then cleanUp quit end if end keyDown Compare the following two constructions and the performance results.
Description Keyword; specifies an item or range of items in a chunk expression. An item in this case is any sequence of characters delimited by the current delimiter as determined by the itemDelimiter property. The terms whichItem, firstItem, and lastItem must be integers or integer expressions that refer to the position of items in the chunk. Chunk expressions refer to any character, word, item, or line in any source of strings.
Chunk expressions refer to any character, word, item, or line in any source of characters. Sources of characters include field cast members and variables that hold strings. Example This statement assigns the first four lines of the variable Action to the field cast member To Do: member("To Do").text = Action.line[1..4] This statement inserts the word and after the second word of the third line of the string assigned to the variable Notes: put "and" after Notes.line[3].word[2] See also char...of, item...
on new me return me end The following two sets of handlers make up a parent script. The first set uses me to refer to the child object. The second set uses the variable myAddress to refer to the child object. In all other respects, the parent scripts are the same.
The menu keyword is followed immediately by a colon, a space, and the name of the menu. In subsequent lines, specify the menu items for that menu. You can set a script to execute when the user chooses an item by placing the script after the vertical bar symbol (|). A new menu is defined by the subsequent occurrence of the menu keyword. Note: Menus are not available in Shockwave Player. On the Macintosh, you can use special characters to define custom menus. These special characters are case-sensitive.
NAN Usage -- Lingo syntax NAN Description Return value; Indicates that a specified Lingo expression is not a number. This statement attempts to display the square root of -1, which is not a number, in the Message window: -- Lingo syntax put((-1).sqrt) -- NAN See also INF next Usage -- Lingo syntax next Description Keyword; refers to the next marker in the movie and is equivalent to the phrase the marker (+ 1).
next repeat Usage -- Lingo syntax next repeat Description Keyword; sends Lingo to the next step in a repeat loop in a script. This function differs from that of the exit repeat keyword. Example This repeat loop displays only odd numbers in the Message window: repeat with i = 1 to 10 if (i mod 2) = 0 then next repeat put(i) end repeat on Usage -- Lingo syntax on handlerName {argument1}, {arg2}, {arg3} ...
Example The following handler tests which key the user pressed most recently and responds accordingly: • If the user pressed A, B, or C, the movie performs the corresponding action following the of keyword. • If the user pressed any other key, the movie executes the statement that follows the otherwise keyword. In this case, the statement is a simple alert. on keyDown case (_key.key) of "a": _movie.go("Apple") "b", "c": _movie.puppetTransition(99) _movie.go("Oranges") otherwise: _player.
This parent script handler declares pMySpriteNum a property to make it available: -- script Elder property pMyChannel on new me, whichSprite me.pMyChannel = whichSprite return me end The original behavior script sets up the ancestor and passes the spriteNum property to all behaviors: property spriteNum property ancestor on beginSprite me ancestor = new script("Elder", spriteNum) end See also me, ancestor, spriteNum put...
put...before Usage -- Lingo syntax put expression before chunkExpression Description Command; evaluates a Lingo expression, converts the value to a string, and inserts the resulting string before a specified chunk in a container, without replacing the container’s contents. (If chunkExpression specifies a nonexistent target chunk, the string value is inserted as appropriate into the container.) Chunk expressions refer to any character, word, item, or line in any container.
Example This statement changes the second line of the field cast member Review Comments to “Reviewed by Agnes Gooch”: put "Reviewed by Agnes Gooch" into line 2 of member("Review Comments") The same can be accomplished with a text cast member using this syntax: put "Reviewed by Agnes Gooch" into member("Review Comments").line[2] See also char...of, item...of, line...of, paragraph, word...of, put...before, put...after, set...to, set...
repeat with Usage -- Lingo syntax repeat with counter = start to finish statement(s) end repeat Description Keyword; executes the Lingo specified by statement(s) the number of times specified by counter. The value of counter is the difference between the value specified by start and the value specified by finish. The counter is incremented by 1 each time Lingo cycles through the repeat loop.
While in a repeat loop, Lingo ignores other events. To check the current key in a repeat loop, use the keyPressed property. If you need to process something for several seconds or more, evaluate the function in a loop with some type of counter or test to track progress. If the stop condition is never reached or there is no exit from the repeat loop, you can force Director to stop by using Control+Alt+period (Windows) or Command+period (Macintosh).
return (keyword) Usage -- Lingo syntax return expression Description Keyword; returns the value of expression and exits from the handler. The expression argument can be any Lingo value. When calling a handler that serves as a user-defined function and has a return value, you must use parentheses around the argument lists, even if there are no arguments, as in the diceRoll function handler discussed under the entry for the result function.
set...to, set...= Usage -- Lingo syntax lingoProperty = expression variable = expression Description Command; evaluates an expression and puts the result in the property specified by lingoProperty or the variable specified by variable. Example This statement sets the name of member 3 to Sunset: member(3).name = "Sunset" The following statement sets the soundEnabled property to the opposite of its current state. When soundEnabled is TRUE (the sound is on), this statement turns it off.
sprite...within Usage -- Lingo syntax sprite(sprite1).within(sprite2) sprite sprite1 within sprite2 Description Keyword; operator that compares the position of two sprites and determines whether the quad of sprite1 is entirely inside the quad of sprite2 (TRUE) or not (FALSE). If both sprites have matte ink, their actual outlines, not the quads, are used. A sprite’s outline is defined by the nonwhite pixels that make up its border. This is a comparison operator with a precedence level of 5.
word...of Usage -- Lingo syntax member(whichCastMember).word[whichWord] textMemberExpression.word[whichWord] chunkExpression.word[whichWord] word whichWord of fieldOrStringVariable fieldOrStringVariable. word[whichWord] textMemberExpression.word[firstWord..lastWord] member(whichCastMember).word[firstWord..lastWord] word firstWord to lastWord of chunkExpression chunkExpression.word[whichWord..lastWord] Description Chunk expression; specifies a word or a range of words in a chunk expression.
CHAPTER 12 Methods This section provides an alphabetical list of all the methods available in Director. abort Usage --Lingo syntax abort // JavaScript syntax abort(); Description Command; tells Lingo to exit the current handler and any handler that called it without executing any of the remaining statements in the handler. This differs from the exit keyword, which returns to the handler from which the current handler was called. The abort command does not quit Director. Parameters None.
abs() Usage --Lingo syntax abs (numericExpression) // JavaScript syntax Math.abs (numericExpression) Description Math function (Lingo only); calculates the absolute value of a numerical expression. The abs() function has several uses. It can simplify the tracking of mouse and sprite movement by converting coordinate differences (which can be either positive or negative numbers) into distances (which are always positive numbers).
Parameters point(x, y) Required. A point in Stage coordinates that specifies the location of the embedded DVD menu item. Example This statement activates the hilite of the menu item at a specified Stage location: -- Lingo syntax member("movie1").activateAtLoc(point(100, 200)) // JavaScript syntax member("movie1").activateAtLoc(point(100, 200)); See also DVD activateButton() Usage -- Lingo syntax dvdObjRef.activateButton() // JavaScript syntax dvdObjRef.
add Usage -- Lingo syntax linearList.add(value) // JavaScript syntax array.push(value) Description List command; for linear lists only, adds a value to a linear list. For a sorted list, the value is placed in its proper order. For an unsorted list, the value is added to the end of the list. This command returns an error when used on a property list. Note: Don’t confuse the add command with the + operator used for addition or the & operator used to concatenate strings. Parameters value Required.
Description 3D meshdeform modifier command; adds an empty texture layer to the model’s mesh. You can copy texture coordinates between layers using the following code: modelReference.meshdeform.texturelayer[a].texturecoordinatelist = modelReference.meshdeform.texturelayer[b].texturecoordinatelist Parameters None. Example This statement creates a new texture layer for the first mesh of the model named Ear. --Lingo syntax member("Scene").model("Ear").meshdeform.mesh[1].textureLayer.
addBackdrop Usage -- Lingo syntax sprite(whichSprite).camera{(index)}.addBackdrop(texture, locWithinSprite, rotation) member(whichCastmember).camera(whichCamera).addBackdrop(texture, locWithinSprite, rotation) // JavaScript syntax sprite(whichSprite).camera{(index)}.addBackdrop(texture, locWithinSprite, rotation); member(whichCastmember).camera(whichCamera).addBackdrop(texture, locWithinSprite, rotation); Description 3D camera command; adds a backdrop to the end of the camera’s list of backdrops.
Parameters whichCamera Required. A reference to the camera to add to the list of cameras for the sprite. index Required. An integer that specifies the index in the list of cameras at which whichCamera is added. If index is greater than the value of cameraCount(), the camera is added to the end of the list. Example This statement inserts the camera named FlightCam at the fifth index position of the list of cameras of sprite 12: --Lingo syntax sprite(12).addCamera(member("scene").
Example This statement adds the model named Tire to the list of children of the model named Car. -- Lingo syntax member("3D").model("Car").addChild(member("3D").model("Tire")) // JavaScript syntax member("3D").model("Car").addChild(member("3D").model("Tire")); This statement adds the model named Bird to the list of children of the camera named MyCamera and uses the #preserveWorld argument to maintain Bird’s world position. -- Lingo syntax member("3D").camera("MyCamera").addChild(member("3D").
Example This statement adds the toon modifier to the model named Box. -- Lingo syntax member("shapes").model("Box").addModifier(#toon) // JavaScript syntax member("shapes").model("Box").
// JavaScript syntax t1 = member("Scene").newTexture("Rough", symbol("fromCastMember"),\ member("Cedar")); sprite(5).camera.addOverlay(t1, point(220, 220), 0); member("Scene").camera[1].addOverlay(t1, point(20, 20), 45); See also removeOverlay addProp Usage list.addProp(property, value) addProp list, property, value Description Property list command; for property lists only, adds a specified property and its value to a property list. For an unsorted list, the value is added to the end of the list.
addToWorld Usage -- Lingo syntax member(whichCastmember).model(whichModel).addToWorld() member(whichCastmember).group(whichGroup).addToWorld() member(whichCastmember).camera(whichCamera).addToWorld() member(whichCastmember).light(whichLight).addToWorld() // JavaScript syntax member(whichCastmember).model(whichModel).addToWorld() member(whichCastmember).group(whichGroup).addToWorld() member(whichCastmember).camera(whichCamera).addToWorld() memberwhichCastmember).light(whichLight).
When using the final two optional parameters, you can specify the location of the control handles for the vertex. The control handle location is offset relative to the vertex, so if no location is specified, it will be located at 0 horizontal offset and 0 vertical offset. Parameters indexToAddAt Required. An integer that specifies the index at which the member is added. pointToAddVertex Required. A point that specifies the position at which the member is added. horizControlLocH Optional.
Example The following statement produces an alert stating that there is no CD-ROM drive connected: -- Lingo syntax _player.alert("There is no CD-ROM drive connected.") // JavaScript syntax _player.alert("There is no CD-ROM drive connected."); This statement produces an alert stating that a file was not found: -- Lingo syntax _player.alert("The file" && QUOTE & filename & QUOTE && "was not found.") // JavaScript syntax _player.alert("The file \"" + filename + "\" was not found.
appMinimize() Usage -- Lingo syntax _player.appMinimize() // JavaScript syntax _player.appMinimize(); Description Player method; in Microsoft Windows, causes a projector to minimize to the Windows Task Bar. On the Macintosh, causes a projector to be hidden. On the Macintosh, reopen a hidden projector from the Macintosh application menu. This method is useful for projectors and MIAWs that play back without a title bar. Parameters None. Example --Lingo syntax on mouseUp me _player.
Example This statement displays the arctangent of 1: (1).atan The result, to four decimal places, is 0.7854, or approximately pi/4. Most trigonometric functions use radians, so you may want to convert from degrees to radians.
// JavaScript syntax function mouseUp() { _sound.beep(1); } See also Sound beginRecording() Usage -- Lingo syntax _movie.beginRecording() // JavaScript syntax _movie.beginRecording(); Description Movie method; starts a Score generation session. When you call beginRecording(), the playhead automatically advances one frame and begins recording in that frame. To avoid this behavior and begin recording in the frame in which beginRecording() is called, place a statement such as _movie.go(_movie.
// JavaScript syntax function animBall(numberOfFrames) { _movie.beginRecording(); var horizontal = 0; var vertical = 100; for (var i = 1; i <= numberOfFrames; i++) { _movie.go(1); sprite(20).member = member("Ball"); sprite(20).locH = horizontal; sprite(20).locV = vertical; sprite(20).foreColor = 255; horizontal = horizontal + 3; vertical = vertical + 2; _movie.updateFrame(); } _movie.
bitNot() Usage (integer).bitNot bitNot(integer) Description Function (Lingo only); converts the specified integer to a 32-bit binary number and reverses the value of each binary digit, replacing 1’s with 0’s and 0’s with 1’s. The result is the new binary number, which Lingo displays as a base 10 integer. Integer Binary number 1 00000000000000000000000000000001 Result -2 11111111111111111111111111111110 In JavaScript syntax, use the bitwise operator "~". Parameters None.
Parameters integer1 Required. The first integer. integer2 Required. The second integer.
breakLoop() Usage -- Lingo syntax soundChannelObjRef.breakLoop() // JavaScript syntax soundChannelObjRef.breakLoop(); Description Sound Channel method; causes the currently looping sound in channel soundChannelObjRef to stop looping and play through to its endTime. If there is no current loop, this method has no effect. Parameters None.
This command is only useful playing back in a projector or in Director, and has no effect when playing back in a browser. This property can be tested and set. Example This statement refers to the location of the Netscape browser: browserName "My Disk:My Folder:Netscape" This statement displays the browser name in a Message window: put browserName() build() Usage -- Lingo syntax member(whichCastmember).modelResource(whichModelResource).build() // JavaScript syntax member(whichCastmember).
Line 7 calls the build() command to construct the mesh. -- Lingo syntax nm = member("Shapes").newMesh("Plane",1,3,0,3,0) nm.vertexList = [vector(0,0,0), vector(20,0,0), vector(20, 20, 0)] nm.face[1].vertices = [1,2,3] nm.colorList = [rgb(255,255,0), rgb(0, 255, 0), rgb(0,0,255)] nm.face[1].colors = [3,2,1] nm.generateNormals(#smooth) nm.build() nm = member("Shapes").newModel("TriModel", nm) // JavaScript syntax nm = member("Shapes").newMesh("Plane",1,3,0,3,0); nm.
// JavaScript syntax function resetCache() { current = cacheDocVerify(); if (current == symbol("once")) { alert("Turning cache verification on"); cacheDocVerify(symbol("always")) } } Parameters cacheSetting Optional. A symbol that specifies how often the contents of a page on the Internet are refreshed. Possible values are #once (default) and #always.
// JavaScript syntax function checkCache() { if (cacheSize() < 1000) { alert("increasing cache to 1MB"); cacheSize(1000); } } See also cacheDocVerify(), clearCache call Usage call #handlerName, script, {args...} call (#handlerName, scriptInstance, {args...}) Description Command; sends a message that invokes a handler in a specified script or list of scripts. The call command can use a variable as the name of the handler.
The following example shows how a call statement can call handlers in a behavior or parent script and its ancestor.
callAncestor Usage callAncestor handlerName, script, {args...} Description Command; sends a message to a child object’s ancestor script. Ancestors can, in turn, have their own ancestors. When you use callAncestor, the name of the handler can be a variable, and you can explicitly bypass the handlers in the primary script and go directly to the ancestor script. Parameters symHandlerName Required. A symbol that specifies the handler to activate. scriptInstance Required.
This statement makes the man walk: call #walk, m -- "Animal walking with 2 legs" This statement makes the man run: set msg = #run callAncestor msg, m -- "Animal running with 2 legs" This statement creates a second instance of the parent script: set m2 = new(script "man") This statement sends a message to the ancestor script for both men: callAncestor #run,[m,m2] -- "Animal running with 2 legs" -- "Animal running with 2 legs" See also ancestor, new() callFrame() Usage -- Lingo syntax spriteObjRef.
camera() Usage member(whichCastMember).camera(whichCamera) member(whichCastMember).camera[index] member(whichCastMember).camera(whichCamera).whichCameraProperty member(whichCastMember).camera[index].whichCameraProperty sprite(whichSprite).camera{(index)} sprite(whichSprite).camera{(index)}.whichCameraProperty Description 3D element; an object at a vector position from which the 3D world is viewed. Each sprite has a list of cameras.
Example This statement shows that sprite 5 contains three cameras. -- Lingo syntax put sprite(5).cameraCount() -- 3 // JavaScript syntax put(sprite(5).cameraCount()); // 3 See also addCamera, deleteCamera cancelIdleLoad() Usage -- Lingo syntax _movie.cancelIdleLoad(intLoadTag) // JavaScript syntax _movie.cancelIdleLoad(intLoadTag); Description Movie method; cancels the loading of all cast members that have the specified load tag. Parameters Required.
The default cast library number is 1. To specify a cast member in a cast library other than cast 1, set castLib() to specify the alternative cast library. Parameters castNameOrNum Required. A string that specifies the cast library name, or an integer that specifies the cast library number.
channel() (Sound) Usage -- Lingo syntax _sound.channel(intChannelNum) // JavaScript syntax _sound.channel(intChannelNum); Description Sound method; returns a reference to a specified sound channel. The functionality of this method is identical to the top level sound() method. Parameters intChannelNum Required. An integer that specifies the sound channel to reference. Example This statement sets the variable named myChannel to sound channel 2: -- Lingo syntax myChannel = _sound.
charPosToLoc() Usage --Lingo syntax memberObjRef.charPosToLoc(nthCharacter) // JavaScript syntax memberObjRef.charPosToLoc(nthCharacter); Description Field function; returns the point in the entire field cast member (not just the part that appears on the Stage) that is closest to a specified character. This is useful for determining the location of individual characters. Values for charPosToLoc are in pixels from the top left corner of the field cast member.
Parameters stringExpression Required. A string that specifies the expression from which a substring is returned. firstCharacter lastCharacter Required. An integer that specifies the point at which the substring starts. Required. An integer that specifies the point at which the substring ends.
Example This statement displays the ASCII code for the letter A: put ("A").charToNum -- 65 The following comparison determines whether the letter entered is a capital A, and then navigates to either a correct sequence or incorrect sequence in the Score: -- Lingo syntax on CheckKeyHit theKey if (theKey).charToNum = 65 then go "Correct Answer" else go "Wrong Answer" end if end // JavaScript syntax function CheckKeyHit(theKey) { if (theKey.
Parameters None. Example This statement clears all globally created ActionScript objects from memory: -- Lingo syntax clearAsObjects() // JavaScript syntax clearAsObjects(); See also newObject(), setCallback() clearCache Usage clearCache Description Command; clears the Director network cache. The clearCache command clears only the cache, which is separate from the browser’s cache. If a file is in use, it remains in the cache until it is no longer in use. Parameters None.
clearError() Usage -- Lingo syntax memberObjRef.clearError() // JavaScript syntax memberObjRef.clearError(); Description Flash command; resets the error state of a streaming Flash cast member to 0. When an error occurs while a cast member is streaming into memory, Director sets the cast member’s state property to -1 to indicate that an error occurred.
clearFrame() Usage -- Lingo syntax _movie.clearFrame() // JavaScript syntax _movie.clearFrame(); Description Movie method; clears all sprite channels in a frame during Score recording. Parameters None. Example The following handler clears the content of each frame before it edits that frame during Score generation: -- Lingo syntax on newScore _movie.beginRecording() repeat with counter = 1 to 50 _movie.clearFrame() _movie.frameScript = 25 _movie.updateFrame() end repeat _movie.
This method is useful when initializing global variables or when opening a new movie that requires a new set of global variables. Parameters None. Example The following handlers set all global variables to VOID (Lingo) or null (JavaScript): -- Lingo syntax on mouseDown _global.clearGlobals() end // JavaScript syntax function mouseDown() { _global.clearGlobals(); } See also Global clone Usage member(whichCastmember).model(whichModel).clone(cloneName) member(whichCastmember).group(whichGroup).
cloneDeep Usage member(whichCastmember).model(whichModel).cloneDeep(cloneName) member(whichCastmember).group(whichGroup).cloneDeep(cloneName) member(whichCastmember).light(whichLight).cloneDeep(cloneName) member(whichCastmember).camera(whichCamera).
Example This statement makes a copy of the model named Pluto of the cast member named Scene and inserts it into the cast member named Scene2 with the new name Planet. The children of Pluto are also imported, as are the model resources, shaders, and textures used by Pluto and its children. member("Scene2").cloneModelFromCastmember("Planet", "Pluto", \ member("Scene")) See also cloneMotionFromCastmember, clone, cloneDeep, loadFile() cloneMotionFromCastmember Usage member(whichCastmember).
Be aware that closing a window does not stop the movie in the window nor clear it from memory. This method simply closes the window in which the movie is playing. You can reopen it quickly by using the open() (Window) method. This allows rapid access to windows that you want to keep available. If you want to completely dispose of a window and clear it from memory, use the forget() method.
closeXlib Usage closeXlib whichFile Description Command; closes an Xlibrary file. Xtra extensions are stored in Xlibrary files. Xlibrary files are resource files that contain Xtra extensions. HyperCard XCMDs and XFCNs can also be stored in Xlibrary files. The closeXlib command doesn’t work for URLs. In Windows, using the DLL extension for Xtra extensions is optional. It is good practice to close any file you have opened as soon as you have finished using it.
Parameters intPaletteIndex Required if using 8-bit palette values. An integer that specifies the 8-bit palette value to use. Valid values range from 0 to 255. All other values are truncated. intRed Required if using RGB values. An integer that specifies the red color component in the current palette. Valid values range from 0 to 255. All other values are truncated. Required if using RGB values. An integer that specifies the green color component in the current palette. Valid values range from 0 to 255.
Parameters intSpriteNum Required. An integer that specifies the sprite whose horizontal coordinates are evaluated against intPosn. intPosn Required. An integer to be evaluated against by the horizontal coordinates of the left and right sides of the sprite identified by intSpriteNum.
Both the constrainV() and constrainH()s constrain only one axis each. Parameters intSpriteNum Required. An integer that identifies the sprite whose vertical coordinates are evaluated against intPosn. intPosn Required. An integer to be evaluated against by the vertical coordinates of the left and right sides of the sprite identified by intSpriteNum.
To see an example of quad used in a completed movie, see the Quad movie in the Learning/Lingo folder inside the Director application folder. Parameters sourceImgObj Required. A reference to the source image object from which pixels are copied. Required if copying pixels into a screen coordinate rectangle or a floating point quad. The rectangle or quad into which pixels are copied. destRectOrQuad sourceRect Required. The source rectangle from which pixels are copied. paramList Optional.
The following statement copies part of the image of member Happy into part of member flower. The part of the image copied from Happy is within rectangle(0, 0, 200, 90). It is pasted into rectangle(20, 20, 100, 40) within the image of member flower. The copied portion of Happy is resized to fit the rectangle into which it is pasted. The following statement copies the entire image of member Happy into a rectangle within the image of member flower.
cos() Usage (angle).cos cos (angle) Description Function (Lingo only); calculates the cosine of the specified angle, which must be expressed in radians. In JavaScript syntax, use the Math object’s cos() function. Parameters angle Required. An integer that specifies the angle to test. Example The following statement calculates the cosine of PI divided by 2 and displays it in the Message window: put (PI/2).cos See also atan(), PI, sin() count() Usage -- Lingo syntax list.count object.
Example This statement displays the number 3, the number of entries: --Lingo syntax put([10,20,30].count) -- 3 // JavaScript syntax put(list(10,20,30).count); // 3 See also globals createFile() Usage -- Lingo syntax fileioObjRef.createFile(stringFileName) // JavaScript syntax fileioObjRef.createFile(stringFileName); Description Fileio method; Creates a specified file. Parameters stringFileName Required. A string that specifies the path and name of the file to create.
createMatte() Syntax imageObject.createMatte({alphaThreshold}) Description This function creates and returns a matte object that you can use with copyPixels() to duplicate the effect of the matte sprite ink. The matte object is created from the specified image object’s alpha layer. The optional parameter alphaThreshold excludes from the matte all pixels whose alpha channel value is below that threshold. It is used only with 32-bit images that have an alpha channel.
See also image (Image), image(), rect (Image) crop() (Bitmap) Usage -- Lingo syntax memberObjRef.crop() // JavaScript syntax memberObjRef.crop(); Description Bitmap command; allows a bitmap cast member to be cropped to a specific size. You can use crop to trim existing cast members, or in conjunction with the picture of the Stage to grab a snapshot and then crop it to size for display. The registration point is kept in the same location so the bitmap does not move in relation to the original position.
pos1 = vector(100, 0, 0) pos2 = vector(0, 100, 0) put pos1.cross(pos2) -- vector( 0.0000, 0.0000, 1.00000e4 ) See also crossProduct(), perpendicularTo crossProduct() Usage vector1.crossProduct(vector2) Description 3D vector method; returns a vector which is perpendicular to both vector1 and vector2. Example In this example, pos1 is a vector on the x axis and pos2 is a vector on the y axis. The value returned by pos1.crossProduct(pos2) is vector( 0.0000, 0.0000, 1.
• Use the syntax _player.cursor(cursorMemRef) for the custom cursors available through the Cursor Xtra. Note: Although the Cursor Xtra allows cursors of different cast library types, text cast members cannot be used as cursors. • Use the syntax _player.cursor(intCursorNum) to specify default system cursors.
Value Description 282 Wait mouse down 1 283 Wait mouse down 2 284 Vertical size 285 Horizontal size 286 Diagonal size 290 Closed hand 291 No-drop hand 292 Copy (closed hand) 293 Inverse arrow 294 Rotate 295 Skew 296 Horizontal double arrow 297 Vertical double arrow 298 Southwest Northeast double arrow 299 Northwest Southeast double arrow 300 Smear/smooth brush 301 Air brush 302 Zoom in 303 Zoom out 304 Zoom cancel 305 Start shape 306 Add point 307 Close shape
Cursor commands can be interrupted by an Xtra or other external agent. If the cursor is set to a value in Director and an Xtra or external agent takes control of the cursor, resetting the cursor to the original value has no effect because Director doesn’t perceive that the cursor has changed. To work around this, explicitly set the cursor to a third value and then reset it to the original value. Parameters intCursorNum Required when using an integer to identify a cursor.
date() (formats) Usage -- Lingo syntax syntax date({stringFormat}) date({intFormat}) date({intYearFormat, intMonthFormat, intDayFormat}) // JavaScript syntax Date({“month dd, yyyy hh:mm:ss”}); Date({“month dd, yyyy”}); Date({yy,mm,dd,hh,mm,ss}); Date({yy,mm,dd}); Date({milliseconds}); Description Top level function and data type.
intFormat Optional when creating a Lingo date object. An integer that specifies the new date object. intYearFormat Optional when creating a Lingo date object. An integer that specifies the fourdigit year of the new date object. intMonthFormat Optional when creating a Lingo date object. An integer that specifies the twodigit month of the new date object. Optional when creating a Lingo date object. An integer that specifies the twodigit day of the new date object.
date() (System) Usage -- Lingo syntax _system.date({yyyymmdd}) // JavaScript syntax _system.date({yyyymmdd}); Description System method; returns the current date in the system clock. The format Director uses for the date varies, depending on how the date is formatted on the computer. • In Windows, you can customize the date display by using the International control panel. • (Windows stores the current short date format in the System.ini file.
The only mouse and keyboard activity possible during this time is stopping the movie by pressing Control+Alt+period (Windows) or Command+period (Macintosh). Because it increases the time of individual frames, delay() is useful for controlling the playback rate of a sequence of frames. The delay() method can be applied only when the playhead is moving. However, when delay() is in effect, handlers still run; only the playhead halts, not script execution.
delete() Usage -- Lingo syntax fileioObjRef.delete() // JavaScript syntax fileioObjRef.delete(); Description Fileio method; Deletes a file. Parameters None. See also Fileio deleteAt Usage list.deleteAt(number) deleteAt list, number Description List command; deletes an from a linear or property list. The deleteAt command checks whether an item is in a list; if you try to delete an object that isn’t in the list, Director displays an alert. Parameters number Required.
deleteCamera Usage member(whichCastmember).deleteCamera(cameraName) member(whichCastmember).deleteCamera(index) sprite(whichSprite).deleteCamera(cameraOrIndex) Description 3D command; in a cast member, this command removes the camera from the cast member and the 3D world. Children of the camera are removed from the 3D world but not deleted. It is not possible to delete the default camera of the cast member. In a sprite, this command removes the camera from the sprite’s list of cameras.
Example The following handler checks whether the sprite in channel 10 of the current frame has gone past the right edge of a 640-by-480-pixel Stage and deletes the frame if it has: -- Lingo syntax on testSprite _movie.beginRecording() if (sprite(10).locH > 640) then _movie.deleteFrame() end if _movie.endRecording() end // JavaScript syntax function testSprite() { _movie.beginRecording(); if (sprite(10).locH > 640) { _movie.deleteFrame(); } _movie.
deleteLight Usage member(whichCastmember).deleteLight(whichLight) member(whichCastmember).deleteLight(index) Description 3D command; removes the light from the cast member and the 3D world. Children of the light are removed from the 3D world but not deleted. Parameters lightNameOrNum Required. A string or integer that specifies the name or index position of the light to delete. Example These examples delete lights from the cast member named Room. member("Room").
deleteModelResource Usage member(whichCastmember).deleteModelResource(whichModelResource) member(whichCastmember).deleteModelResource(index) Description 3D command; removes the model resource from the cast member and the 3D world. Models using the deleted model resource become invisible, because they lose their geometry, but they are not deleted or removed from the world. Parameters Required. A string or integer that specifies the name or index position of the model resource to delete.
deleteOne Usage list.deleteOne(value) deleteOne list, value Description List command; deletes a value from a linear or property list. For a property list, deleteOne also deletes the property associated with the deleted value. If the value appears in the list more than once, deleteOne deletes only the first occurrence. Attempting to delete a property has no effect. Parameters value Required. The value to delete from the list.
See also deleteAt deleteShader Usage member(whichCastmember).deleteShader(whichShader) member(whichCastmember).deleteShader(index) Description 3D command; removes the shader from the cast member. Parameters shaderNameOrNum Required. A string or integer that specifies the name or index position of the shader to delete. Example The first line of this example deletes the shader Road from the cast member named StreetScene. The second line deletes the third shader of StreetScene. member("StreetScene").
deleteVertex() Usage -- Lingo syntax memberObjRef.deleteVertex(indexToRemove) // JavaScript syntax memberObjRef.deleteVertex(indexToRemove); Description Vector shape command; removes an existing vertex of a vector shape cast member in the index position specified. Parameters indexToRemove Required. An integer that specifies the index position of the vertex to delete. Example This line removes the second vertex point in the vector shape Archie: -- Lingo syntax member("Archie").
displaySave() Usage -- Lingo syntax fileioObjRef.displaySave(stringTitle, stringFileName) // JavaScript syntax fileioObjRef.displaySave(stringTitle, stringFileName); Description Fileio method; Displays a Save dialog box. This method returns to script the full path and name of the saved file. Parameters stringTitle Required. A string that specifies the title displayed in the Save dialog box. stringFileName Required. A string that specifies the full path and name of the file to save.
doneParsing() Usage parserObject.doneParsing() Description Function; returns 1 (TRUE) when the parser has completed parsing a document using parseURL(). The return value is 0 (FALSE) until the parsing is complete. Parameters None. See also parseURL() dot() Usage vector1.dot(vector2) Description 3D vector method; returns the sum of the products of the x, y, and z components of two vectors. If both vectors are normalized, the dot is the cosine of the angle between the two vectors.
dotProduct() Usage vector1.dotProduct(vector2) Description 3D vector method; returns the sum of the products of the x, y, and z components of two vectors. If both vectors are normalized, the dotproduct is the cosine of the angle between the two vectors.
Although many network operations can be active at one time, running more than four concurrent operations usually slows down performance unacceptably. Neither the Director movie’s cache size nor the setting for the Check Documents option affects the behavior of the downloadNetThing command. Parameters URL Required. The URL of any object that can be downloaded: for example, an FTP or HTTP server, an HTML page, an external cast member, a Director movie, or a graphic. localFile Required.
x2 Required if drawing a line using x and y coordinates. An integer that specifies the x coordinate of the end of the line. y2 Required if drawing a line using x and y coordinates. An integer that specifies the y coordinate of the end of the line. Required. A color object or parameter list that specifies the color of the line or shape’s border. The parameter list can be used instead of a simple color object to specify the following properties.
Example This statement creates a new image object from the image of cast member Lunar Surface and places the new image object into the variable workingImage: workingImage = member("Lunar Surface").image.duplicate() See also image() duplicate() (list function) Usage (oldList).duplicate() duplicate(oldList) Description List function; returns a copy of a list and copies nested lists (list items that also are lists) and their contents. The function is useful for saving a list’s current content.
Parameters intPosn Optional. An integer that specifies the Cast window for the duplicate cast member. If omitted, the duplicate cast member is placed in the first open Cast window position. Example This statement makes a copy of cast member Desk and places it in the first empty Cast window position: -- Lingo syntax member("Desk").duplicate() // JavaScript syntax member("Desk").
_movie.duplicateFrame() end repeat _movie.endRecording() end animBall // JavaScript syntax function animBall(numberOfFrames) { _movie.beginRecording(); sprite(20).member = member("Ball", "Toys"); for (var i = 0; i <= numberOfFrames; i++) { _movie.duplicateFrame(); } _movie.endRecording(); } See also insertFrame(), Movie enableHotSpot() Usage -- Lingo syntax spriteObjRef.enableHotSpot(hotSpotID, trueOrFalse) // JavaScript syntax spriteObjRef.
Example When used in the following handler, the endRecording keyword ends the Score generation session: -- Lingo syntax on animBall(numberOfFrames) _movie.beginRecording() horizontal = 0 vertical = 100 repeat with i = 1 to numberOfFrames _movie.go(i) sprite(20).member = member("Ball") sprite(20).locH = horizontal sprite(20).locV = vertical sprite(20).foreColor = 255 horizontal = horizontal + 3 vertical = vertical + 2 _movie.updateFrame() end repeat _movie.
Parameters None. Example This statement deletes the cast member named Gear in the Hardware cast: -- Lingo syntax member("Gear", "Hardware").erase() // JavaScript syntax member("Gear", "Hardware").erase(); This handler deletes cast members numbered from start through finish: -- Lingo syntax on deleteMember start, finish repeat with i = start to finish member(i).erase() end repeat end deleteMember // JavaScript syntax function deleteMember(start, finish) { for (var i=start; i<=finish; i++) { member(i).
externalEvent() Usage externalEvent "string" Description Command; sends a string to the browser that the browser can interpret as a scripting language instruction, allowing a movie playing or a browser to communicate with the HTML page in which it is embedded. This command works only for movies in browsers. Note: The externalEvent command does not produce a return value. There is no immediate way to determine whether the browser handled the event or ignored it.
Alternatively, define a script for the event: Within the movie, include the function and any parameters as part of the string for externalEvent: externalEvent ("MyFunction ('parm1','parm2')") See also on EvalScript extrude3D Usage member(whichTextCastmember).
externalParamName() Usage -- Lingo syntax _player.externalParamName(paramNameOrNum) // JavaScript syntax _player.externalParamName(paramNameOrNum); Description Player method; returns the name of a specified parameter in the list of external parameters from an HTML
Parameter Definition swSound A string value which may specify the name of a sound in the Director movie to be played, or whether or not a sound should be played at all. swText A string value that specifies text to be used in the movie. swURL A string URL that may specify the location of another movie with Shockwave content or Shockwave Audio file. swVolume An integer value (0 to 10 is recommended) that is used to control the volume level of the sound output from the movie.
This method is valid only for movies with Shockwave content that are running in a browser. It cannot be used with Director movies or projectors. The following list describes the pre-defined external parameters that can be used. Parameter Definition swAudio A string that specifies the location of a Shockwave Audio file to be played with the movie. The value is a fully qualified URL. swBackColor A color value intended to modify the movie's Stage color property.
Example This statement places the value of an external parameter in the variable myVariable: -- Lingo syntax if (_player.externalParamName("swURL") = "swURL") then myVariable = _player.externalParamValue("swURL") end if // JavaScript syntax if (_player.externalParamName("swURL") == "swURL") { var myVariable = _player.externalParamValue("swURL"); } See also externalParamName(), Movie extractAlpha() Usage imageObject.
Example This Lingo fades in sound channel 3 over a period of 3 seconds from the beginning of cast member introMusic2: -- Lingo syntax sound(3).play(member("introMusic2")) sound(3).fadeIn(3000) // JavaScript syntax sound(3).play(member("introMusic2")); sound(3).fadeIn(3000); See also fadeOut(), fadeTo(), pan, Sound Channel, volume (Windows Media) fadeOut() Usage -- Lingo syntax soundChannelObjRef.fadeOut({intMilliseconds}) // JavaScript syntax soundChannelObjRef.
fadeTo() Usage -- Lingo syntax soundChannelObjRef.fadeTo(intVolume {, intMilliseconds}) // JavaScript syntax soundChannelObjRef.fadeTo(intVolume {, intMilliseconds}); Description Sound Channel method; gradually changes the volume of a sound channel to a specified volume over a given number of milliseconds. The current pan setting is retained for the entire fade.
Parameters None. See also Fileio , openFile() fill() Usage -- Lingo syntax imageObjRef.fill(left, top, right, bottom, colorObjOrParamList) imageObjRef.fill(point(x, y), point(x, y), colorObjOrParamList) imageObjRef.fill(rect, colorObjOrParamList) // JavaScript syntax imageObjRef.fill(left, top, right, bottom, colorObjOrParamList); imageObjRef.fill(point(x, y), point(x, y), colorObjOrParamList); imageObjRef.fill(rect, colorObjOrParamList); Description Image method.
point(x, y), point(x, y) Required if filling a region using points. Two points that specify the upper-left and lower-right corners of region to fill, relative to the upper-left corner of the given image object. rect Required if filling a region using a rectangle. A rectangle that specifies the rectangular region to fill. Example This statement renders the image object in the variable myImage completely black: The following statement draws a filled oval in the image object TestImage.
Example This statement finds the first empty cast member on or after cast member 100: -- Lingo syntax trace(castLib(1).findEmpty(member(100))) // JavaScript syntax trace(castLib(1).findEmpty(member(100))); See also Cast Library, Member findPos Usage list.findPos(property) findPos(list, property) Description List command; identifies the position of a property in a property list.
The findPosNear command is similar to the findPos command, except that when the specified property is not in the list, the findPosNear command identifies the position of the value with the most similar alphanumeric name. This command is useful in finding the name that is the closest match in a sorted directory of names. Parameters valueOrProperty Required. The value or property whose position is identified.
flashToStage() Usage -- Lingo syntax spriteObjRef.flashToStage(pointInFlashMovie) // JavaScript syntax spriteObjRef.flashToStage(pointInFlashMovie); Description Function; returns the coordinate on the Director Stage that corresponds to a specified coordinate in a Flash movie sprite. The function accepts both the Flash channel and movie coordinate and returns the Director Stage coordinate as Director point values: for example, point(300,300).
float() Usage (expression).float float (expression) Description Function (Lingo only); converts an expression to a floating-point number. The number of digits that follow the decimal point (for display purposes only, calculations are not affected) is set using the floatPrecision property. In JavaScript syntax, use the parseFloat() function. Parameters expression Required. The expression to convert to a floating-point number.
Example This statement tests whether 3.0 is a floating-point number. The Message window displays the number 1, indicating that the statement is TRUE. put (3.0).floatP -- 1 This statement tests whether 3 is a floating-point number. The Message window displays the number 0, indicating that the statement is FALSE. put (3).floatP -- 0 See also float(), ilk(), integerP(), objectP(), stringP(), symbolP() flushInputEvents() Usage -- Lingo syntax _player.flushInputEvents() // JavaScript syntax _player.
forget() (Window) Usage -- Lingo syntax windowObjRef.forget() // JavaScript syntax windowObjRef.forget(); Description Window method; instructs script to close a window and stop its playback when it’s no longer in use and no other variables refer to it. Calling forget() on a window also removes that window’s reference from the windowList. When the forget() method is called, the window and the movie in a window (MIAW) disappear without calling the stopMovie, closeWindow, or deactivateWindow handlers.
Example This statement deletes the timeout object named AlarmClock from the timeoutList: timeout("AlarmClock").forget() See also timeout(), timeoutHandler, timeoutList, new() framesToHMS() Usage framesToHMS(frames, tempo, dropFrame, fractionalSeconds) Description Function; converts the specified number of frames to their equivalent length in hours, minutes, and seconds. This function is useful for predicting the actual playtime of a movie or controlling a video playback device.
frameReady() (Movie) Usage -- Lingo syntax _movie.frameReady({intFrameNum}) _movie.frameReady(frameNumA, frameNumB) // JavaScript syntax _movie.frameReady({intFrameNum}); _movie.frameReady(frameNumA, frameNumB); Description Movie method; for Director movies, projectors, and movies with Shockwave content, determines whether the cast members of a frame or range of frames have been downloaded. This method returns TRUE if the specified cast members have been downloaded, and FALSE if not.
The following frame script checks to see if frame 25 of a Flash movie sprite in channel 5 can be rendered. If it can’t, the script keeps the playhead looping in the current frame of the Director movie. When frame 25 can be rendered, the script starts the movie and lets the playhead proceed to the next frame of the Director movie. See also mediaReady, Movie frameStep() Usage -- Lingo syntax dvdObjRef.frameStep(intFrames) // JavaScript syntax dvdObjRef.
Example This statement determines whether the largest contiguous free block is smaller than 10K and displays an alert if it is: -- Lingo syntax if (the freeBlock < (10 * 1024)) then alert "Not enough memory!" // JavaScript syntax if (freeBlock < (10 * 1024)) { alert("Not enough memory!") } See also freeBytes(), memorySize, ramNeeded(), size freeBytes() Usage the freeBytes Description Function; indicates the total number of bytes of free memory, which may not be contiguous. A kilobyte (K) is 1024 bytes.
generateNormals() Usage member(whichCastmember).modelResource(whichModelResource). generateNormals(style) Description 3D #mesh model resource command; calculates the normal vectors for each vertex of the mesh. If the style parameter is set to #flat, each vertex receives a normal for each face to which it belongs. Furthermore, all three of the vertices of a face will have the same normal.
getaProp Usage propertyList.propertyName getaProp(list, item) list[listPosition] propertyList [ #propertyName ] propertyList [ "propertyName" ] Description List command; for linear and property lists, identifies the value associated with the item specified by item, listPosition, or propertyName in the list specified by list. • When the list is a linear list, replace item with the number for an item’s position in a list as • shown by listPosition. The result is the value at that position.
getAt Usage getAt(list, position) list [position] Description List command; identifies the item in a specified position of a specified list. If the list contains fewer elements than the specified position, a script error occurs. The getAt command works with linear and property lists. This command has the same function as the getaProp command for linear lists. This command is useful for extracting a list from within another list, such as the deskTopRectList. Parameters list Required.
You can also use the bracket list access: firstPerson = employeeInfoList[1] put firstPerson -- ["Dennis", "consulting", 510] firstPersonDept = firstPerson[2] put firstPersonDept -- "consulting" As with getAt, brackets can be nested: firstPersonDept = employeeInfoList[1][2] See also getaProp, setaProp, setAt getError() (Flash, SWA) Usage -- Lingo syntax memberObjRef.getError() // JavaScript syntax memberObjRef.
Parameters None. Example This handler uses getError to determine whether an error involving the Shockwave Audio cast member Norma Desmond Speaks occurred and displays the appropriate error string in a field if it did: -- Lingo syntax on exitFrame if member("Norma Desmond Speaks").getError() <> 0 then member("Display Error Name").text = member("Norma Desmond \ Speaks").getErrorString() end if end // JavaScript syntax function exitFrame() { var memNor = member("Norma Desmond Speaks").
// JavaScript syntax function CheckFlashStatus() { var errorCheck = member("Dali").getError(); if (errorCheck != 0) { if (errorCheck = "memory") { member("Dali").clearError(); unloadCast(); _movie.go("Artists"); } else { _movie.go("Sorry"); } } } See also clearError(), getErrorString(), state (Flash, SWA) getError() (XML) Usage parserObject.
Possible getError() integer values and corresponding getErrorString() messages are: getError() value getErrorString() message 0 OK 1 memory 2 network 3 playback device 99 other Parameters None. Example This handler uses getError() to determine whether an error occurred for Shockwave Audio cast member Norma Desmond Speaks, and if so, uses getErrorString to obtain the error message and assign it to a field cast member: -- Lingo syntax on exitFrame if member("Norma Desmond Speaks").
Parameters None. See also Fileio, openFile() getFlashProperty() Usage -- Lingo syntax spriteObjRef.getFlashProperty(targetName, symProp) // JavaScript syntax spriteObjRef.getFlashProperty(targetName, symProp); Description This function allows Lingo to invoke the Flash action script function getProperty() on the given Flash sprite. This Flash action script function is used to get the value of properties of movie clips or levels within a Flash movie.
getFrameLabel() Usage sprite(whichFlashSprite).getFrameLabel(whichFlashFrameNumber) getFrameLabel(sprite whichFlashSprite, whichFlashFrameNumber) Description Function; returns the frame label within a Flash movie that is associated with the frame number requested. If the label doesn’t exist, or that portion of the Flash movie has not yet been streamed in, this function returns an empty string. Parameters whichFlashFrameNumber Required. Specifies the frame number that is associated with the frame label.
#maxTextureSize is a linear list containing the maximum width and height of a texture, in pixels. Textures that exceed this size are downsampled until they do not. To avoid texture sampling artifacts, author textures of various sizes and choose the ones that do not exceed the #maxTextureSize value at run time. #supportedTextureRenderFormats is a linear list of video card. For details, see textureRenderFormat.
getLast() Usage list.getLast() getLast(list) Description List function; identifies the last value in a linear or property list specified by list. Parameters None. Example This statement identifies the last item, 22, in the list Answers, which consists of [10, 12, 15, 22]: put Answers.getLast() This statement identifies the last item, 850, in the list Bids, which consists of [#Gee:750, #Kayne:600, #Ohashi:850]: put Bids.
getLength() Usage -- Lingo syntax fileioObjRef.getLength() // JavaScript syntax fileioObjRef.getLength(); Description Fileio method; Returns the length of an open file. You must first open a file by calling openFile() before using getLength() to return the length of the file. Parameters None.
To see an example of getNetText() used in a completed movie, see the Forms and Post movie in the Learning/Lingo folder inside the Director application folder. Parameters URL Required. The URL to the file that contains the text to get. propertyList Optional. Specifies a property list used for CGI queries. serverOSString characterSet Optional. Specifies the encoding of return characters in propertyList. Optional. Specifies character settings.
Example The following statement stores the normalized value of the vector MyVec in the variable Norm. The value of Norm is vector (-0.1199, 0.9928, 0.0000) and the magnitude of Norm is 1. MyVec = vector(-209.9019, 1737.5126, 0.0000) Norm = MyVec.getNormalized() put Norm -- vector( -0.1199, 0.9928, 0.0000 ) put Norm.magnitude -- 1.
getOne() Usage list.getOne(value) getOne(list, value) Description List function; identifies the position (linear list) or property (property list) associated with a value in a list. For values contained in the list more than once, only the first occurrence is displayed. The getOne command returns the result 0 when the specified value is not in the list. When used with linear lists, the getOne command performs the same functions as the getPos command. Parameters value Required.
getPixel() Usage -- Lingo syntax imageObjRef.getPixel(x, y {, #integer}) imageObjRef.getPixel(point(x, y) {, #integer}) // JavaScript syntax imageObjRef.getPixel(x, y {, #integer}); imageObjRef.getPixel(point(x, y) {, #integer}); Description Image method. Returns an indexed or RGB color of the pixel at a specified point in a given image. The index of the rows and columns of the returned image starts with 0.
getPlayList() Usage -- Lingo syntax soundChannelObjRef.getPlayList() // JavaScript syntax soundChannelObjRef.getPlayList(); Description Sound Channel method; returns a copy of the list of queued sounds for a sound channel. The returned list does not include the currently playing sound, nor may it be edited directly. You must use setPlayList(). The playlist is a linear list of property lists. Each property list corresponds to one queued sound cast member.
// JavaScript syntax function playMusic() { sound(2).queue(member("Chimes")); sound(2).queue(propList("member",member("introMusic"), "startTime",3000, "endTime",10000, "loopCount",5, "loopStartTime",8000, "loopEndTime",8900)); put(sound(2).getPlayList()); sound(2).play(); } See also endTime, loopCount, loopEndTime, loopStartTime, Member, member, preLoadTime, queue(), setPlayList(), Sound Channel, startTime getPosition() Usage -- Lingo syntax fileioObjRef.getPosition() // JavaScript syntax fileioObjRef.
To see an example of getPref() used in a completed movie, see the Read and Write Text movie in the Learning/Lingo folder inside the Director application folder. Parameters stringPrefName Required. A string that specifies the file for which content is retrieved. Example This handler retrieves the content of the file Test and then assigns the file’s text to the field Total Score: -- Lingo syntax on mouseUp theText = _player.getPref("Test") member("Total Score").
getPref() Usage getPref(prefFileName) Description Function; retrieves the content of the specified file. When you use this function, replace prefFileName with the name of a file created by the setPref function. If no such file exists, getPref returns VOID. The filename used for prefFileName must be a valid filename only, not a full path; Director supplies the path. The path to the file is handled by Director. The only valid file extensions for prefFileName are .txt and .
Example This statement identifies the value associated with the property #c in the property list Answers, which consists of [#a:10, #b:12, #c:15, #d:22]: getProp(Answers, #c) The result is 15, because 15 is the value associated with #c. See also getOne() getPropAt() Usage list.getPropAt(index) getPropAt(list, index) Description Property list function; for property lists only, identifies the property name associated with a specified position in a property list.
• • • • indicates the bit depth of the hardware output buffer. colorBufferDepth indicates the bit depth of the color buffer. This property can be tested but not set. modifiers is a linear list of modifiers available for use by models in 3D cast members. Possible values include #collision, #bonesPlayer, #keyframePlayer, #toon, #lod, #meshDeform, #sds, #inker, and third-party Xtra-based modifiers. This property can be tested but not set.
Example This statement displays in the message window the current status of a download begun with getNetText() and the resulting net ID placed in the variable netID: put getStreamStatus(netID) -- [#URL: "www.macromedia.com", #state: "InProgress", #bytesSoFar: 250, #bytesTotal: 50000, #error: EMPTY] \ See also on streamStatus, tellStreamStatus() getVariable() Usage -- Lingo syntax spriteObjRef.getVariable(variableName {, returnValueOrReference}) // JavaScript syntax spriteObjRef.
This statement sets the variable tObject to refer to the same object that the variable named gVar refers to in the Flash movie in sprite 3: -- Lingo syntax tObject = sprite(3).getVariable("gVar",FALSE) // JavaScript syntax var tObject = sprite(3).getVariable("gVar",0); This statement returns the value of the variable currentURL from the Flash cast member in sprite 3 and displays it in the Message window: -- Lingo syntax put(sprite(3).getVariable("currentURL")) // JavaScript syntax trace(sprite(3).
Example This statement shows the world-relative transform of the model named Box, followed by its position and rotation properties: put member("3d world").model("Box").getworldTransform() -- transform(1.000000,0.000000,0.000000,0.000000, \ 0.000000,1.000000,0.000000,0.000000, \ 0.000000,0.000000,1.000000,0.000000, - \ 94.144844,119.012825,0.000000,1.000000) put member("3d world").model("Box"). getworldTransform().position -- vector(-94.1448, 119.0128, 0.0000) put member("3d world").model("Box").
Parameters Required. A string that specifies the marker label of the frame to which the playhead branches, or an integer that specifies the number of the frame to which the playhead branches. frameNameOrNum movieName Optional. A string that specifies the movie that contains the frame specified by frameNameOrNum. This value must specify a movie file; if the movie is in another folder, movieName must also specify the path.
If no markers are to the left of the playhead, the playhead branches to: • The next marker to the right if the current frame does not have a marker. • The current frame if the current frame has a marker. • Frame 1 if the movie contains no markers. Parameters None. Example This statement causes the movie to loop between the current frame and the previous marker: -- Lingo syntax _movie.goLoop() // JavaScript syntax _movie.
goPrevious() Usage -- Lingo syntax _movie.goPrevious() // JavaScript syntax _movie.goPrevious(); Description Movie method; sends the playhead to the previous marker in the movie. This marker is two markers back from the current frame if the current frame does not have a marker or one marker back from the current frame if the current frame has a marker.
Example The following handler branches to different points within a Flash movie in channel 5. It accepts a parameter that indicates which frame to go to. -- Lingo syntax on Navigate(whereTo) sprite(5).goToFrame(whereTo) end // JavaScript syntax function Navigate(whereTo) { sprite(5).goToFrame(whereTo); } gotoNetMovie Usage gotoNetMovie URL gotoNetMovie (URL) Description Command; retrieves and plays a new movie with Shockwave content from an HTTP or FTP server.
gotoNetPage Usage gotoNetPage "URL", {"targetName"} Description Command; opens a movie with Shockwave content or another MIME file in the browser. Only URLs are supported as valid parameters. Relative URLs work if the movie is on an HTTP or FTP server. In the authoring environment, the gotoNetPage command launches the preferred browser if it is enabled. In projectors, this command tries to launch the preferred browser set with the Network Preferences dialog box or browserName command.
group() Usage member(whichCastmember).group(whichGroup) member(whichCastmember).group[index] Description 3D element; a node in the 3D world that has a name, transform, parent, and children, but no other properties. Every 3D cast member has a default group named World that cannot be deleted. The parent hierarchy of all models, lights, cameras, and groups that exist in the 3D world terminates in group("world").
handler() Usage scriptObject.handler(#handlerSymbol) Description This function returns TRUE if the given scriptObject contains a specified handler, and FALSE if it does not. The script object must be a parent script, a child object, or a behavior. Parameters symHandler Required. Specifies the name of the handler. Example This Lingo code invokes a handler on an object only if that handler exists: if spiderObject.handler(#pounce) = TRUE then spiderObject.
hilite (command) Usage fieldChunkExpression.hilite() hilite fieldChunkExpression Description Command; highlights (selects) in the field sprite the specified chunk, which can be any chunk that Lingo lets you define, such as a character, word, or line. On the Macintosh, the highlight color is set in the Color control panel. Parameters None. Example This statement highlights the fourth word in the field cast member Comments, which contains the string Thought for the Day: member("Comments").word[4].
Example This frame script checks to see if the mouse is currently located over a button in a Flash movie sprite in channel 5 and, if it is, the script sets a text field used to display a status message: -- Lingo syntax on exitFrame if sprite(5).hitTest(_mouse.mouseLoc) = #button then member("Message Line").text = "Click here to play the movie." _movie.updatestage() else member("Message Line").text = "" end if _movie.go(_movie.frame) end // JavaScript syntax function exitFrame() { var hT = sprite(5).
dropFrame Required. Logical expression that determines whether the frame is a drop frame (TRUE) or not (FALSE). If the string hms ends in a d, the time is treated as a drop frame, regardless of the value of dropFrame. Required. Logical expression that determines the meaning of the numbers after the seconds; they can be either fractional seconds rounded to the nearest hundredth of a second (TRUE) or the number of residual frames (FALSE).
// JavaScript syntax function enterFrame() { var i = 5; while (i < 11) { sprite(i).hold(); i++; } } See also playRate (QuickTime, AVI) identity() Usage member(whichCastmember).model(whichModel).transform.identity() member(whichCastmember).group(whichGroup).transform.identity() member(whichCastmember).camera(whichCamera).transform.identity() sprite(whichSprite).camera{(index)}.transform.identity() member(whichCastmember).light(whichLight).transform.identity() transformReference.
idleLoadDone() Usage -- Lingo syntax _movie.idleLoadDone(intLoadTag) // JavaScript syntax _movie.idleLoadDone(intLoadTag); Description Movie method; reports whether all cast members with the given tag have been loaded (TRUE) or are still waiting to be loaded (FALSE). Parameters intLoadTag Required. An integer that specifies the load tag for the cast members to test.
Example These Lingo statements leave ignoreWhiteSpace() set to the default of TRUE and parse the given XML into a list. The element has no children in the list. XMLtext = " " parserObj.parseString(XMLtext) theList = parserObj.makelist() put theList -- ["ROOT OF XML DOCUMENT": ["!ATTRIBUTES": [:], "sample": ["!ATTRIBUTES": [:]]]] These Lingo statements set ignoreWhiteSpace() to FALSE and then parse the given XML into a list.
The following table shows the return value for each type of object recognized by ilk(): Example Type of Object ilk(Object) returns ilk(Object, Type) returns 1 only if Type = linear list #list #list or #linearlist ilk ([1,2,3]) property list #proplist #list or #proplist ilk ([#his: 1234, #hers: 7890]) integer #integer #integer or #number ilk (333) float #float #float or #number ilk (123.456) string #string #string ilk ("asdf") rect #rect #rect or #list ilk (sprite(1).
Example The following ilk statement identifies the type of the object named Bids: Bids = [:] put ilk( Bids ) -- #proplist The following ilk statement tests whether the variable Total is a list and displays the result in the Message window: Total = 2+2 put ilk( Total, #list ) -- 0 In this case, since the variable Total is not a list, the Message window displays 0, which is the numeric equivalent of FALSE.
Type of object ilk(object) returns ilk(object, Type) if only Type = vector #vector #vector transform #transform #transform Parameters object Required. Specifies the object to test. Optional. Specifies the type to which object is compared. If the object is of the specified type, the ilk() function returns TRUE. It the object is not of the specified type, the ilk() function returns FALSE. type Example This statement shows that MyObject is a motion object: put MyObject.
When you create a new image object, the background color defaults to white (color(255,255,255)), and the alpha channel is completely opaque (color(0,0,0)). The alpha channel color for 100% transparency is white (color(255,255,255)); the alpha channel color for 100% opaque is black (color(0,0,0)). To see an example of image() used in a completed movie, see the Imaging movie in the Learning/ Lingo folder inside the Director application folder. Parameters intWidth Required.
• When downloading files from the Internet, use it to download the file at a specific URL and set the filename of linked media. Note: To import a file from a URL, it is usually more efficient to use the preloadNetThing() to download the file to a local disk first, and then import the file from the local disk. Using preloadNetThing() also minimizes any potential downloading issues. • Use it to import both RTF and HTML documents into text cast members with formatting and links intact.
See also downloadNetThing, fileName (Window), Member, preloadNetThing() insertBackdrop Usage sprite(whichSprite).camera{(index)}.insertBackdrop(index, \ texture, locWithinSprite, rotation) member(whichCastmember).camera(whichCamera).\ insertBackdrop(index, texture, locWithinSprite, rotation) Description 3D camera command; adds a backdrop to the camera’s list of backdrops at a specified position in the list. Parameters Required.
Parameters None. Example The following handler generates a frame that has the transition cast member Fog assigned in the transition channel followed by a set of empty frames. The argument numberOfFrames sets the number of frames. -- Lingo syntax on animBall(numberOfFrames) _movie.beginRecording() _movie.frameTransition = member("Fog").number _movie.go(_movie.frame + 1) repeat with i = 0 to numberOfFrames _movie.insertFrame() end repeat _movie.
Example The first line of this example creates a texture named Cedar. The second line inserts that texture at the first position in the list of overlays of the camera of sprite 5. The overlay is positioned at the point (300, 120), measured from the upper left corner of the sprite. It is rotated 45°. t1 = member("scene").texture("Cedar") sprite(5).camera.insertOverlay(1, t1, point(300, 120), 45) See also removeOverlay, overlay, bevelDepth inside() Usage point.
Parameters fieldMemberObjRef Optional. Specifies the field cast member to which a menu is installed. Example This statement installs the menu defined in field cast member 37: installMenu 37 This statement installs the menu defined in the field cast member named Menubar: installMenu member "Menubar" This statement disables menus that were installed by the installMenu command: installMenu 0 See also menu integer() Usage (numericExpression).
integerP() Usage expression.integerP (numericExpression).integerP integerP(expression) Description Function (Lingo only); indicates whether a specified expression can be evaluated to an integer (1 or TRUE) or not (0 or FALSE). P in integerP stands for predicate. Parameters expression Required. The expression to test. Example This statement checks whether the number 3 can be evaluated to an integer and then displays 1 (TRUE) in the Message window: put(3).
interpolate() Usage transform1.interpolate(transform2,percentage) Description 3D transform method; returns a copy of transform1 created by interpolating from the position and rotation of transform1 to the position and rotation of transform2 by the specified percentage. The original transform1 is not affected. To interpolate transform1, use interpolateTo(). To interpolate by hand, multiply the difference of two numbers by the percentage. For example, interpolation from 4 to 8 by 50 percent yields 6.
intersect() Usage rectangle1. Intersect(rectangle2) intersect(rectangle1, rectangle2) Description Function; determines the rectangle formed where two rectangles intersect. Parameters rectangle2 Required. Specifies the second rectangle in the intersection test. Example This statement assigns the variable newRectangle to the rectangle formed where rectangle toolKit intersects rectangle Ramp: newRectangle = toolKit.intersect(Ramp) See also map(), rect(), union() inverse() Usage member(whichCastmember).
invert() Usage member(whichCastmember).model(whichModel).transform.invert() member(whichCastmember).group(whichGroup).transform.invert() member(whichCastmember).camera(whichCamera).transform.invert() sprite(whichSprite).camera{(index)}.transform.invert() member(whichCastmember).light(whichLight).transform.invert() transformReference.invert() Description 3D transform method; inverts the position and rotation properties of the transform. This method changes the original transform.
Example The following statement checks whether a sound is playing in sound channel 1 and loops in the frame if it is. This allows the sound to finish before the playhead goes to another frame. -- Lingo syntax if (sound(1).isBusy()) then _movie.go(_movie.frame) end if // JavaScript syntax if (sound(1).isBusy()) { _movie.go(_movie.frame); } See also status, Sound Channel isInWorld() Usage member(whichCastmember).model(whichModel).isInWorld() member(whichCastmember).camera(whichCamera).
isPastCuePoint() Usage -- Lingo syntax spriteObjRef.isPastCuePoint(cuePointID) // JavaScript syntax spriteObjRef.isPastCuePoint(cuePointID); Description Function; determines whether a sprite or sound channel has passed a specified cue point in its media. This function can be used with sound (WAV, AIFF, SND, SWA, AU), QuickTime, or Xtra files that support cue points. Replace spriteNum or channelNum with a sprite channel or a sound channel.
The following example displays information in cast member “field 2” about the music playing in sound channel 1. If the music is not yet past cue point “climax”, the text of “field 2” is “This is the beginning of the piece.” Otherwise, the text reads “This is the end of the piece.” -- Lingo syntax if not sound(1).isPastCuePoint("climax") then member("field 2").text = "This is the beginning of the piece." else member("field 2").text = "This is the end of the piece.
Example The following statement checks whether the user pressed the Enter key in Windows or the Return key on a Macintosh and runs the handler updateData if the key was pressed: -- Lingo syntax if (_key.keyPressed(RETURN)) then updateData end if // JavaScript syntax if (_key.keyPressed(36)) { updateData(); } This statement uses the keyCode for the a key to test if it’s down and displays the result in the Message window: -- Lingo syntax if (_key.
Parameters stringMarkerName Required. A string that specifies the name of the marker label associated with a frame. Example This statement sends the playhead to the tenth frame after the frame labeled Start: -- Lingo syntax _movie.go(_movie.label("Start") + 10) // JavaScript syntax _movie.go(_movie.
lastClick() Usage the lastClick Description Function; returns the time in ticks (1 tick = 1/60 of a second) since the mouse button was last pressed. This function can be tested but not set. Parameters None.
length() Usage string.length length(string) Description Function; returns the number of characters in the string specified by string, including spaces and control characters such as TAB and RETURN. Parameters None. Example This statement displays the number of characters in the string “Macro”&“media”: put ("Macro" & "media").
Example This example shows the two ways of referring to a light. The first line uses a string in parentheses and the second line uses the a number in brackets. The string is the light’s name and the number is the position of the light in the cast member’s list of lights. thisLight = member("3D World").light("spot01") thisLight = member("3D World").light[2] See also newLight, deleteLight lineHeight() Usage -- Lingo syntax memberObjRef.lineHeight(lineNumber) // JavaScript syntax memberObjRef.
Example This statement measures the distance, in pixels, from the second line of the field cast member Today’s News to the top of the field cast member and assigns the result to the variable startOfString: --Lingo syntax startOfString = member("Today's News").linePosToLocV(2) // JavaScript syntax var startOfString = member("Today's News").linePosToLocV(2); linkAs() Usage castMember.
When creating a list using the syntax [], with or without parameters, the index of list values begins with 0. The maximum length of a single line of executable script is 256 characters. Large lists cannot be created using list(). To create a list with a large amount of data, enclose the data in square brackets ([]), put the data into a field, and then assign the field to a variable. The variable’s content is a list of the data. Parameters strigValue1, stringValue2 ... Optional.
loadFile() Usage member(whichCastmember).loadFile(fileName {, overwrite, \ generateUniqueNames}) Description 3D cast member command; imports the assets of a W3D file into a cast member. The cast member’s state property must be either -1 (error) or 4 (loaded) before the loadFile command is used. Parameters fileName Required. Specifies the W3D file that contains the assets to import. overwrite Optional. Indicates whether the member (TRUE) or are added to the assets of overwrite is TRUE.
Description Function; returns a number that identifies which character in a specified field cast member is closest to a point within the field. The value 1 corresponds to the first character in the string, the value 2 corresponds to the second character in the string, and so on. Parameters location Required. A point within the field cast member. The value for location is a point relative to the upper left corner of the field cast member.
log() Usage log(number) Description Math function (Lingo only); calculates the natural logarithm of a specified number. In JavaScript syntax, use the Math object’s log() function. Parameters Required. A number from which the natural logarithm is calculated. This number must be a decimal number greater than 0. number Example This statement assigns the natural logarithm of 10.5 to the variable Answer. Answer = log(10.
end if return parsedList end // JavaScript syntax function ConvertToList(xmlString) { parserObject = new Xtra("xmlparser"); // check syntax errorCode = parserObject.parseString(xmlString); errorString = parserObject.getError(); if (voidP(errorString)) { parsedList = parserObject.makeList(); } else { alert("Sorry, there was an error" + errorString); return false; } return parsedList; } See also makeSubList() makeScriptedSprite() Usage -- Lingo syntax spriteChannelObjRef.
makeSubList() Usage XMLnode.makeSubList() Description Function; returns a property list from a child node the same way that makeList() returns the root of an XML document in list format. Parameters None. Example Beginning with the following XML: element 2 element 3 This statement returns a property list made from the contents of the first child of the tag : put gparser.child[ 1 ].child[ 1 ].
Example In this behavior, all of the sprites have already been set to draggable. Sprite 2b contains a small bitmap. Sprite 1s is a rectangular shape sprite large enough to easily contain sprite 2b. Sprite 4b is a larger version of the bitmap in sprite 2b. Sprite 3s is a larger version of the shape in sprite 1s. Moving sprite 2b or sprite 1s will cause sprite 4b to move. When you drag sprite 2b, its movements are mirrored by sprite 4b. When you drag sprite 1s, sprite 4b moves in the opposite direction.
If the specified point on the Stage is not within the sprite, a VOID is returned. Parameters whichPointInMember Required. A point from which an equivalent point is returned. See also map(), mapStageToMember() mapStageToMember() Usage sprite(whichSpriteNumber). mapStageToMember(whichPointOnStage) mapStageToMember(sprite whichSpriteNumber, whichPointOnStage) Description Function; uses the specified sprite and point to return an equivalent point inside the dimensions of the cast member.
• • marker(-1)—Returns the frame number of the first marker before the marker(0). marker(-2)—Returns the frame number of the second marker before the marker(0). If the parameter markerNameOrNum is a string, marker() returns the frame number of the first frame whose marker label matches the string. Parameters markerNameOrNum Required. A string that specifies a marker label, or an integer that specifies a marker number.
-- Lingo syntax on findWinner Bids Winner = Bids.max() member("Congratulations").text = \ "You have won, with a bid of $" & Winner &"!" end // JavaScript syntax function findWinner(Bids) { Winner = Bids.max(); member("Congratulations").text = "You have won, with a bid of $" + \ Winner + "!"); } maximize() Usage -- Lingo syntax windowObjRef.maximize() // JavaScript syntax windowObjRef.maximize(); Description Window method; maximizes a window. Use this method when making custom titlebars. Parameters None.
mci Usage mci "string" Description Command; for Windows only, passes the strings specified by string to the Windows Media Control Interface (MCI) for control of multimedia extensions. Note: Microsoft no longer recommends using the 16-bit MCI interface. Consider using third-party Xtra extensions for this functionality instead. Parameters string Required. A string that is passed to the MCI.
Optional. A string that specifies the cast library name to which the member belongs, or an integer that specifies the index position of the cast library to which the member belongs. If omitted, member() searches all cast libraries until a match is found. castNameOrNum Example This statements sets the variable memWings to the cast member named Planes, which is in the cast library named Transportation.
mergeProps() Usage -- Lingo syntax windowObjRef.mergeProps(propList) // JavaScript syntax windowObjRef.mergeProps(propList); Description Windows method. Merges an arbitrary number of window properties, all at once, into the existing set of window properties. Parameters Required. A set of window properties to merge into the existing set of window properties. The properties are specified by the appearanceOptions and titlebarOptions properties.
• • • • • allows you to get or set the list of normal vectors used by the specified mesh. textureCoordinateList allows you to get or set the texture coordinates used by the first texture layer of the specified mesh. To get or set the texture coordinates for any other texture layers in the specified mesh, use meshdeform.mesh[index].texturelayer[index].textureCoordinateList. textureLayer[index] allows you get and set access to the properties of the specified texture layer.
• mesh[index] allows access to the properties of the specified mesh. Parameters None. Example The following statement displays the number of faces in the model named gbFace: put member("3D World").model("gbFace").meshDeform.face.count -- 432 The following statement displays the number of meshes in the model named gbFace: put member("3D World").model("gbFace").meshDeform.mesh.
minimize() Usage -- Lingo syntax windowObjRef.minimize() // JavaScript syntax windowObjRef.minimize(); Description Window method; minimizes a window. Use this method when making custom titlebars. Parameters None. Example These statements minimize the window named Artists if it is not already minimized. -- Lingo syntax if (window("Artists").sizeState <> #minimized) then window("Artists").minimize() end if // JavaScript syntax if (window("Artists").sizeState != symbol("minimized")) { window("Artists").
Parameters whichModel Optional. A string that specifies the name of the model to return. Example This statement stores a reference to the model named Player Avatar in the variable thismodel: thismodel = member("3DWorld").model("Player Avatar") This statement stores a reference to the eighth model of the cast member named 3DWorld in the variable thismodel. thismodel = member("3DWorld").model[8] This statement shows that there are four models in the member of sprite 1. put sprite(1).member.model.
modelsUnderLoc Usage member(whichCastmember).camera(whichCamera).modelsUnderLoc\ (pointWithinSprite, optionsList) Description 3D command; returns a list of models found under a specified point within the rect of a sprite using the referenced camera. The list of models can also be compared to a set of optional parameters before being returned. Within the returned list, the first model listed is the one closest to the viewer and the last model listed is the furthest from the viewer.
modelList Optional. A list of model references that are included if they are found under the specified ray. Model references not included in this list are ignored, even if they are under the specified ray. Use the model references, not the string names of the models. Specify each model you want to include. Adding a parent model reference does not automatically include its child model references. Example This statement creates a list of ten models: tModelList = [member("3D").model("foo"),member("3D").
Parameters locationVector Required. A vector from which a ray is drawn and under which a list of models is found. directionVector Required. A vector that specifies the direction the ray is pointing. Optional. A list that specifies the maximum number of models to return, the level of information detail, a list of models among which to cast, and the maximum distance to draw the ray. All of these properties are optional. optionsList maxNumberOfModels Optional.
This statement builds a list of options that would return a maximum of ten models, include simple detail, draw results from tModelList, and have a maximum ray distance of 50: tOptionsList = [#maxNumberOfModels: 10, #levelOfDetail: #simple, #modelList: tModelList, #maxDistance: 50] After the option list is built, this statement includes it under a ray drawn from the position vector (0, 0, 300) and pointing down the -z axis: put member("3d").
motion() Usage member(whichCastmember).motion(whichMotion) member(whichCastmember).motion[index] member(whichCastmember).motion.count Description 3D command; returns the motion found within the referenced cast member that has the name specified by whichMotion, or is found at the index position specified by the index. As motion.count, this property returns the total number of motions found within the cast member. Object name string comparisons are not case-sensitive.
Example This statement moves cast member Shrine to the first empty location in the Cast window: -- Lingo syntax member("shrine").move() // JavaScript syntax member("shrine").move(); This statement moves cast member Shrine to location 20 in the Bitmaps Cast window: -- Lingo syntax member("shrine").move(20, "Bitmaps") // JavaScript syntax member("shrine").move(20, "Bitmaps"); See also Member moveToBack() Usage -- Lingo syntax windowObjRef.moveToBack() // JavaScript syntax windowObjRef.
moveToFront() Usage -- Lingo syntax windowObjRef.moveToFront() // JavaScript syntax windowObjRef.moveToFront(); Description Window method; moves a window in front of all other windows. Parameters None. Example These statements move the first window in windowList in front of all other windows: -- Lingo syntax myWindow = _player.windowList[1] myWindow.moveToFront() // JavaScript syntax var myWindow = _player.windowList[1]; myWindow.
Parameters vertexIndex Required. Specifies the index position of the vertex to move. xChange Required. Specifies the amount to move the vertex horizontally. yChange Required. Specifies the amount to move the vertex vertically. Example This statement shifts the first vertex point in the vector shape Archie 25 pixels to the right and 10 pixels down from its current position: -- Lingo syntax member("Archie").moveVertex(1, 25, 10) // JavaScript syntax member("Archie").
See also addVertex(), deleteVertex(), originMode, vertexList multiply() Usage transform.multiply(transform2) Description 3D command; applies the positional, rotational, and scaling effects of transform2 after the original transform. Parameters transform2 Required. Specifies the transform that contains the effects to apply to another transform. Example This statement applies the positional, rotational, and scaling effects of the model Mars’s transform to the transform of the model Pluto.
netAbort Usage netAbort(URL) netAbort(netID) Description Command; cancels a network operation without waiting for a result. Using a network ID is the most efficient way to stop a network operation. The ID is returned when you use a network function such as getNetText() or postNetText(). In some cases, when a network ID is not available, you can use a URL to stop the transmission of data for that URL. The URL must be identical to that used to begin the network operation.
Parameters netID Optional. Specifies the ID of the network operation to test. Example The following handler uses the netDone function to test whether the last network operation has finished. If the operation is finished, text returned by netTextResult is displayed in the field cast member Display Text. -- Lingo syntax on exitFrame if netDone() = 1 then member("Display Text").text = netTextResult() end if end // JavaScript syntax function exitFrame() { if (netDone() == 1) { member("Display Text").
netError() Usage netError() netError(netID) Description Function; determines whether an error has occurred in a network operation and, if so, returns an error number corresponding to an error message. If the operation was successful, this function returns a code indicating that everything is okay. If no background loading operation has started, or if the operation is in progress, this function returns an empty string. • Use netError() to test the last network operation.
Example This statement passes a network ID to netError to check the error status of a particular network operation: --Lingo syntax on exitFrame global mynetID if netError(mynetID)<>"OK" then beep end // JavaScript syntax function exitFrame() { global mynetID; if (netError(mynetID) != "OK") { _sound.beep(); } } netLastModDate() Usage netLastModDate() Description Function; returns the date last modified from the HTTP header for the specified item.
// JavaScript syntax if (netDone()) { theDate = netLastModDate(); if (theDate.char[6..11] != "Jan 30") { alert("The file is outdated"); } } See also netDone(), netError() netMIME() Usage netMIME() Description Function; provides the MIME type of the Internet file that the last network operation returned (the most recently downloaded HTTP or FTP item). The netMIME function can be called only after netDone and netError report that the operation is complete and successful.
break; case "application/x-director": goToNetMovie(theURL); break; case "text/html": goToNetPage(theURL); break; default: alert("Please choose a different item."); } } else { _movie.go(_movie.frame); } } See also netDone(), netError(), getNetText(), postNetText, preloadNetThing() netStatus Usage netStatus msgString Description Command; displays the specified string in the status area of the browser window. The netStatus command doesn’t work in projectors. Parameters msgString Required.
If the specified network operation was getNetText(), the text is the text of the file on the network. If the specified network operation was postNetText, the result is the server’s response. After the next operation starts, Director discards the results of the previous operation to conserve memory. When a movie plays back as an applet, this function returns valid results for the last 10 requests.
For cast members, the type parameter sets the cast member’s type. Possible predefined values correspond to the existing cast member types: #bitmap, #field, and so on. The new function can also create Xtra cast member types, which can be identified by any name that the author chooses. It’s also possible to create a new color cursor cast member using the Custom Cursor Xtra. Use new(#cursor) and set the properties of the resulting cast member to make them available for use.
After the line has been executed, newMember will contain the member reference to the cast member just created: put newMember -- (member 1 of castLib 1) If you are using JavaScript syntax to create a new cast members, use the movie object's newMember() method. This statement creates a new bitmap cast member: var tMem = _movie.
The following statements create two child objects called myBird1 and myBird2. They are given different starting speeds: 15 and 25, respectively. When the fly handler is called for each child object, the speed of the object is displayed in the Message window. myBird1 = script("Bird").new(15) myBird2 = script("Bird").new(25) myBird1.fly() myBird2.
newCurve() Usage -- Lingo syntax memberObjRef.newCurve(positionInVertexList) // JavaScript syntax memberObjRef.newCurve(positionInVertexList); Description Function; adds a #newCurve symbol to the vertexList of vectorCastMember, which adds a new shape to the vector shape. You can break apart an existing shape by calling newCurve() with a position in the middle of a series of vertices. Parameters positionInVertexList Required. #newCurve symbol is added.
newLight Usage member(whichCastmember).newLight(newLightName, #typeIndicator) Description 3D command; creates a new light with a specified type, and adds it to the light palette. Parameters newLightName Required. Specifies the name of the new light. The name of the new light must be unique within the light palette. typeIndicator Required. A symbol that specifies the type of the new light. Valid values include the following: • • • • is a generalized light in the 3D world.
When the argument for the new() function is a parent script, the new function creates a child object. The parent script should include an on new handler that sets the child object’s initial state or property values and returns the me reference to the child object. The child object has all the handlers of the parent script. The child object also has the same property variable names that are declared in the parent script, but each child object has its own values for these properties.
newMesh Usage member(whichCastmember).newMesh(name,numFaces, numVertices, numNormals,numColors,numTextureCoordinates) Description 3D command; creates a new mesh model resource. After creating a mesh, you must set values for at least the vertexList and face[index].vertices properties of the new mesh, followed by a call to its build() command, in order to actually generate the geometry. Parameters meshName Required. Specifies the name of the new mesh model resource. numFaces Required.
Line 17 calls the build command to construct the mesh. nm = member("Shapes").newMesh("pyramid",6 , 5, 0, 3) nm.vertexList = [ vector(0,0,0), vector(40,0,0), \ vector(40,0,40), vector(0,0,40), vector(20,50,20) ] nm.colorList = [ rgb(255,0,0), rgb(0,255,0), rgb(0,0,255) ] nm.face[1].vertices = [ 4,1,2 ] nm.face[2].vertices = [ 4,2,3 ] nm.face[3].vertices = [ 5,2,1 ] nm.face[4].vertices = [ 5,3,2 ] nm.face[5].vertices = [ 5,4,3 ] nm.face[6].vertices = [ 5,1,4 ] nm.face[1].colors = [3,2,3] nm.face[2].
newModelResource Usage member(whichCastmember).newModelResource(newModelResourceName \ { ,#type, #facing }) Description 3D command; creates a new model resource, optionally of a give type and facing, and adds it to the model resource palette. If you do not choose to specify the facing parameter and specify #box, #sphere, #particle or #cylinder for the type parameter, only the front faces are generated. If you specify #plane, both the front and back faces are generated.
This statement creates a box-shaped model resource called hatbox4. member("Shelf").newModelResource("hatbox4", #box) See also primitives newMotion() Usage member(whichCastmember).newMotion(name) Description 3D command; creates a new motion within a referenced cast member, and returns a reference to the new motion. A new motion can be used to combine several previously existing motions from the member’s motion list via the map() command. Parameters name Required. Specifies the name of the new motion.
Parameters objectType Required. Specifies the type of new object to create. arg1, arg2, ... Optional. Specifies any initialization arguments required by the object. Each argument must be separated by a comma. Example This Lingo sets the variable tLocalConObject to a reference to a new LocalConnection object in the Flash movie in sprite 3: -- Lingo syntax tLocalConObject = sprite(3).newObject("LocalConnection") // JavaScript syntax var tLocalConObject = sprite(3).
Parameters Required. Specifies the name of the new shader. The name of the new shader must be unique in the shader list. newShaderName Required. A symbol that determines the style in which the shader is applied.
Optional. Specifies the type of the new texture. If omitted, the new texture is created with no specific type. Valid values include the following: typeIndicator • • #fromCastMember (a cast member) (a Lingo image object) #fromImageObject sourceObjectReference Optional. Specifies a reference to the source cast member or Lingo image object. If omitted, the new texture is created from no specific source.
nothing Usage nothing Description Command; does nothing. This command is useful for making the logic of an if...then statement more obvious. A nested if...then...else statement that contains no explicit command for the else clause may require else nothing, so that Lingo does not interpret the else clause as part of the preceding if clause. Parameters None. Example The nested if...then...
nudge() Usage -- Lingo syntax spriteObjRef.nudge(#direction) // JavaScript syntax spriteObjRef.nudge(#direction); Description QuickTime VR command; nudges the view perspective of the specified QuickTime VR sprite in a specified direction. Nudging to the right causes the image of the sprite to move to the left. The nudge command has no return value. Parameters Required. Specifies the direction to nudge the view perspective.
numToChar() Usage numToChar(integerExpression) Description Function; displays a string containing the single character whose ASCII number is the value of a specified expression. This function is useful for interpreting data from outside sources that are presented as numbers rather than as characters. ASCII values up to 127 are standard on all computers. Values of 128 or greater refer to different characters on different computers. Parameters integerExpression Required.
objectP() Usage objectP(expression) Description Function; indicates whether a specified expression is an object produced by a parent script, Xtra, or window (TRUE) or not (FALSE). The P in objectP stands for predicate. It is good practice to use objectP to determine which items are already in use when you create objects by parent scripts or Xtra instances.
Parameters stringExpression1 Required. Specifies the sub-string to search for in stringExpression2. stringExpression2 Required. stringExpression1. Specifies the string that contains the sub-string Example This statement displays in the Message window the beginning position of the string “media” within the string “Macromedia”: put offset("media","Macromedia") The result is 6.
offset() (rectangle function) Usage rectangle.offset(horizontalChange, verticalChange) offset (rectangle, horizontalChange, verticalChange) Description Function; yields a rectangle that is offset from the rectangle specified by rectangle. Parameters horizontalChange horizontalChange horizontalChange Required. Specifies the horizontal offset, in pixels. When is greater than 0, the offset is toward the right of the Stage; when is less than 0, the offset is toward the left of the Stage.
Parameters stringDocPath Optional. A string that specified by stringAppPath opens. stringAppPath specifies the document to open when the application Required. A string that specifies the path to the application to open. Example This statement opens the TextEdit application, which is in the folder Applications on the drive HD (Macintosh), and the document named Storyboards: -- Lingo syntax _player.open("Storyboards", "HD:Applications:TextEdit") // JavaScript syntax _player.
Example This statement opens the window Control Panel and brings it to the front: -- Lingo syntax window("Control Panel").open() // JavaScript syntax window("Control Panel").open(); See also close(), downloadNetThing, fileName (Window), preLoadMovie(), Window openFile() Usage -- Lingo syntax fileioObjRef.openFile(stringFileName, intMode) // JavaScript syntax fileioObjRef.openFile(stringFileName, intMode) Description Fileio method; Opens a specified file with a specified mode.
In Windows, the .dll extension is optional. Note: This command is not supported in Shockwave Player. Parameters whichFile Required. Specifies the Xlibrary file to open. If the file is not in the folder containing the current movie, whichFile must include the pathname.
You would use it by passing in the values you wanted to add: put AddNumbers(3, 4, 5, 6) -- 18 put AddNumbers(5, 5) -- 10 See also getAt, param(), paramCount(), return (keyword) paramCount() Usage the paramCount Description Function; indicates the number of parameters sent to the current handler. Parameters None. Example This statement sets the variable counter to the number of parameters that were sent to the current handler: set counter = the paramCount parseString() Usage parserObject.
parseURL() Usage parserObject.parseURL(URLstring {,#handlerToCallOnCompletion} {, objectContainingHandler}) Description Function; parses an XML document that resides at an external Internet location. The first parameter is the parser object containing an instance of the XML Parser Xtra. This function returns immediately, so the entire URL may not yet be parsed. It is important to use the doneParsing() function in conjunction with parseURL() to determine when the parsing operation is complete.
The movie script contains the on parseDone handler: on parseDone global gParserObject if voidP(gParserObject.getError()) then put "Successful parse" else put "Parse error:" put " " & gParserObject.getError() end if end This JavaScript syntax parses the file sample.xml and calls the parseDone function. Because no script object is given with the doneParsing() function, the parseDone function is assumed to be in a movie script. errorCode = _global.gParserObject.parseURL("http://- www.MyCompany.com/ sample.
This JavaScript syntax parses the document sample.xml at MyCompany.com and calls the parseDone function in the object testObject, which is an instance of the defined TestScript class: parserObject = new xtra("XMLParser"); testObject = new TestScript(parserObject); errorCode = parserObject .parseURL("http://www.MyCompany.com/sam- ple.xml", symbol("parseDone"), testObject) Here is the TestScript class definition: TestScript = function (aParser) { this.myParserObject = aParser; } TestScript.prototype.
end // JavaScript syntax function keyDown() { legalCharacters = "1234567890"; if (legalCharacters.indexOf(_key.key) >= 0) { pass(); } else { _sound.beep(); } } See also stopEvent() pasteClipBoardInto() Usage -- Lingo syntax memberObjRef.pasteClipBoardInto() // JavaScript syntax memberObjRef.pasteClipBoardInto(); Description Member method; pastes the contents of the Clipboard into a specified cast member, and erases the existing cast member.
pause() (DVD) Usage -- Lingo syntax dvdObjRef.pause() // JavaScript syntax dvdObjRef.pause(); Description DVD method; pauses playback. Parameters None. Example This statement pauses playback: -- Lingo syntax member(1).pause() // JavaScript syntax member(1).pause(); See also DVD pause() (Sound Channel) Usage -- Lingo syntax soundChannelObjRef.pause() // JavaScript syntax soundChannelObjRef.pause(); Description Sound Channel method; suspends playback of the current sound in a sound channel.
pause() (3D) Usage member(whichCastmember).model(whichModel).bonesPlayer.pause() member(whichCastmember).model(whichModel).keyframePlayer.pause() Description 3D #keyframePlayer and #bonesPlayer modifier command; halts the motion currently being executed by the model. Use the play() command to unpause the motion. When a model’s motion has been paused by using this command, the model’s bonesPlayer.playing property will be set to FALSE. Parameters None.
// JavaScript syntax sprite(2).pause(); member("Real").pause(); See also mediaStatus (RealMedia, Windows Media), play() (RealMedia, SWA, Windows Media), seek(), stop() (RealMedia, SWA, Windows Media) perpendicularTo Usage vector1.perpendicularTo(vector2) Description 3D vector command; returns a vector perpendicular to both the original vector and a second vector. This command is equivalent to the vector crossProduct command. Parameters vector2 Required. Specifies the second vector.
Example The first statement in this example assigns the value of the picture member property for the cast member Shrine, which is a bitmap, to the variable pictureValue. The second statement checks whether Shrine is a picture by checking the value assigned to pictureValue. -- Lingo syntax pictureValue = member("Shrine").picture put pictureP(pictureValue) // JavaScript syntax var pictureValue = member("Shrine").
endTime Optional. Measured in milliseconds from the beginning of the motion. When looped is FALSE, the motion begins at offset and ends at endTime. When looped is TRUE, the first iteration of the loop begins at offset and ends at endTime with all subsequent repetitions beginning at startTime and end at endTime. Set endTime to -1 if you want the motion to play to the end. Optional. Specifies the actual speed of the motion’s playback.
Without parameters, this method resumes playback if paused, or, if stopped, starts playback at the top of a disc or at the value specified by the startTimeList property. Playback continues until the value specified by the stopTimeList property, if set. With the beginTitle, beginChapter, and endTitle, endChapter parameters, this method starts playback at a given title, chapter. Playback continues until the specified endTitle, endChapter parameters, if set.
These statements start playing 10 seconds into chapter 2 and finish playing at 17 seconds: member(15).play([#title:2, #seconds:10], [#title:2, #seconds:17]) See also DVD, startTimeList, stopTimeList play() (Sound Channel) Usage -- Lingo syntax soundChannelObjRef.play() soundChannelObjRef.play(memberObjRef) soundChannelObjRef.play(propList) // JavaScript syntax soundChannelObjRef.play(); soundChannelObjRef.play(memberObjRef); soundChannelObjRef.
Property Description #loopEndTime The time within the sound to end a loop, in milliseconds. See loopEndTime. #preloadTime The amount of the sound to buffer before playback, in milliseconds. See preloadTime. Example This statement plays cast member introMusic in sound channel 1: -- Lingo syntax sound(1).play(member("introMusic")) // JavaScript syntax sound(1).play(member("introMusic")); The following statement plays cast member creditsMusic in sound channel 2.
play() (RealMedia, SWA, Windows Media) Usage -- Lingo syntax windowsMediaObjRef.play() realMediaObjRef.play() // JavaScript syntax windowsMediaObjRef.play(); realMediaObjRef.play(); Description Windows Media or RealMedia cast member or sprite method; plays the Windows Media or RealMedia cast member or plays the sprite on the Stage. For cast members, only audio is rendered if present in the movie. If the cast member is already playing, calling this method has no effect. Parameters None.
playFile() Usage -- Lingo syntax soundChannelObjRef.playFile(stringFilePath) // JavaScript syntax soundChannelObjRef.playFile(stringFilePath); Description Sound Channel method; plays the AIFF, SWA, AU, or WAV sound in a sound channel. For the sound to be played properly, the correct MIX Xtra must be available to the movie, usually in the Xtras folder of the application. When the sound file is in a different folder than the movie, stringFilePath must specify the full path to the file.
playFromToTime() Usage -- Lingo syntax windowsMediaObjRef.playFromToTime(intStartTime, intEndTime) // JavaScript syntax windowsMediaObjRef.playFromToTime(intStartTime, intEndTime); Description Windows Media sprite method. Starts playback from a specified start time and plays to a specified end time. Parameters intStartTime Required. An integer that specifies the time, in milliseconds, at which playback begins. intEndTime Required.
Example This statement plays the next queued sound in sound channel 2: -- Lingo syntax sound(2).playNext() // JavaScript syntax sound(2).playNext(); See also pause() (Sound Channel), play() (Sound Channel), Sound Channel,stop() (Sound Channel) playNext() (3D) Usage member(whichMember).model(whichModel).bonesPlayer.playNext() member(whichMember).model(whichModel).keyframePlayer.
playerParentalLevel() Usage -- Lingo syntax dvdObjRef.playerParentalLevel() // JavaScript syntax dvdObjRef.playerParentalLevel(); Description DVD method; returns the parental level of the player. Possible parental levels range from 1 to 8. Parameters None. See also DVD point() Usage -- Lingo syntax point(intH, intV) // JavaScript syntax point(intH, intV); Description Top level function and data type. Returns a point that has specified horizontal and vertical coordinates.
Parameters intH Required. An integer that specifies the horizontal coordinate of the point. intV Required. An integer that specifies the vertical coordinate of the point. Example This statement sets the variable lastLocation to the point (250, 400): -- Lingo syntax lastLocation = point(250, 400) // JavaScript syntax var lastLocation = point(250, 400); This statement adds 5 pixels to the horizontal coordinate of the point assigned to the variable myPoint: -- Lingo syntax myPoint.locH = myPoint.
Parameters vectorPosition Required. Specifies the world relative position. This value can also be a node reference. Optional. Specfies a world relative vector that hints at where the object’s up vector should point. If this parameter isn’t specified, then pointAt defaults to using the world’s y axis as the up hinting vector. If you attempt to point the object at a position such that the object’s forward vector is parallel to the world’s y axis, then the world’s x axis is used as the up hinting vector.
Parameters point Required. Specifies the point to test. See also cursor(), mouseLoc pointToChar() Usage -- Lingo syntax spriteObjRef.pointToChar(pointToTranslate) // JavaScript syntax spriteObjRef.pointToChar(pointToTranslate); Description Function; returns an integer representing the character position located within the text or field sprite at a specified screen coordinate, or returns -1 if the point is not within the text. This function can be used to determine the character under the cursor.
pointToItem() Usage -- Lingo syntax spriteObjRef.pointToItem(pointToTranslate) // JavaScript syntax spriteObjRef.pointToItem(pointToTranslate); Description Function; returns an integer representing the item position in the text or field sprite at a specified screen coordinate, or returns -1 if the point is not within the text. Items are separated by the itemDelimiter property, which is set to a comma by default. This function can be used to determine the item under the cursor.
pointToLine() Usage -- Lingo syntax spriteObjRef.pointToLine(pointToTranslate) // JavaScript syntax spriteObjRef.pointToLine(pointToTranslate); Description Function; returns an integer representing the line position in the text or field sprite at a specified screen coordinate, or returns -1 if the point is not within the text. Lines are separated by carriage returns in the text or field cast member. This function can be used to determine the line under the cursor. Parameters pointToTranslate Required.
pointToParagraph() Usage -- Lingo syntax spriteObjRef.pointToParagraph(pointToTranslate) // JavaScript syntax spriteObjRef.pointToParagraph(pointToTranslate); Description Function; returns an integer representing the paragraph number located within the text or field sprite at a specified at screen coordinate, or returns -1 if the point is not within the text. Paragraphs are separated by carriage returns in a block of text. This function can be used to determine the paragraph under the cursor.
pointToWord() Usage -- Lingo syntax spriteObjRef.pointToWord(pointToTranslate) // JavaScript syntax spriteObjRef.pointToWord(pointToTranslate); Description Function; returns an integer representing the number of a word located within the text or field sprite at a specified screen coordinate, or returns -1 if the point is not within the text. Words are separated by spaces in a block of text. This function can be used to determine the word under the cursor. Parameters pointToTranslate Required.
postNetText Usage postNetText(url, propertyList {,serverOSString} {,serverCharSetString}) postNetText(url, postText {,serverOSString} {,serverCharSetString}) Description Command; sends a POST request to a URL, which is an HTTP URL, with specified data. This command is similar to getNetText(). As with getNetText(), the server’s response is returned by netTextResult(netID) once netDone(netID) becomes 1, and if netError(netID) is 0, or okay. The optional parameters may be omitted without regard to position.
Example This statement omits the serverCharSetString parameter: netID = postNetText("www.mydomain.com\database.cgi", "Bill Jones", "Win") This example generates a form from user-entry fields for first and last name, along with a Score. Both serverOSString and serverCharSetString have been omitted: lastName = member("Last Name").text firstName = member("First Name").text totalScore = member("Current Score").text infoList = ["FName":firstName, "LName":lastName, "Score":totalScore] netID = postNetText("www.
Example This statement reports in the Message window whether the QuickTime movie Rotating Chair can be preloaded into memory: -- Lingo syntax put(member("Rotating Chair").preload()) // JavaScript syntax put(member("Rotating Chair").preload()); This startMovie handler sets up a Flash movie cast member for streaming and then sets its bufferSize property: -- Lingo syntax on startMovie member("Flash Demo").preload = FALSE member("Flash Demo").
Parameters frameNameOrNum Optional. A string that specifies the specific frame to preload, or an integer that specifies the number of the specific frame to preload. fromFrameNameOrNum Required if preloading a range of frames. A string that specifies the name of the label of the first frame in the range of frames to preload, or an integer that specifies the number of the first frame in the range of frames to preload. Required if preloading a range of frames.
Example This statement loads the cast member Mel Torme into memory: -- Lingo syntax member("Mel Torme").preLoadBuffer() // JavaScript syntax member("Mel Torme").preLoadBuffer(); See also preLoadTime preLoadMember() Usage -- Lingo syntax _movie.preLoadMember({memberObjRef}) _movie.preLoadMember(fromMemNameOrNum, toMemNameOrNum) // JavaScript syntax _movie.preLoadMember({memberObjRef}); _movie.
preLoadMovie() Usage -- Lingo syntax _movie.preLoadMovie(stringMovieName) // JavaScript syntax _movie.preLoadMovie(stringMovieName); Description Movie method; preloads the data and cast members associated with the first frame of the specified movie. Preloading a movie helps it start faster when it is started by the go() or play() methods.
The preloadNetThing() function does not parse a Director file’s links. Thus, even if a Director file is linked to casts and graphic files, preloadNetThing() downloads only the Director file. You still must preload other linked objects separately. Parameters url Required. Specifies the name of any valid Internet file, such as a Director movie, graphic, or FTP server location.
preRotate Usage transformReference.preRotate( xAngle, yAngle, zAngle ) transformReference.preRotate( vector ) transformReference.preRotate( positionVector, directionVector, \ angle ) member( whichCastmember ).node.transform.preRotate( xAngle, \ yAngle, zAngle ) member( whichCastmember ).node.transform.preRotate( vector ) member( whichCastmember ).node.transform.
The above is equivalent to: member("scene").model("bip01").rotate(20,20,20). Generally preRotate() is only useful when dealing with transform variables. This line will orbit the camera about the point (100, 0, 0) in space, around the y axis, by 180°. t = transform() t.position = member("scene").camera[1].transform.position t.preRotate(vector(100, 0, 0), vector(0, 1, 0), 180) member("scene").camera[1].transform = t See also rotate preScale() Usage transformReference.
Line 4 assigns this new transform to Moon2. t = member("scene").model("Moon1").transform.duplicate() t.preScale(2,2,2) t.rotate(180,0,0) member("scene").model("Moon2").transform = t preTranslate() Usage transformReference.preTranslate( xIncrement, yIncrement, \ zIncrement ) transformReference.preTranslate( vector ) member( whichCastmember ).node.transform.preTranslate\ (xIncrement, yIncrement, zIncrement) member( whichCastmember ).node.transform.
Example t = transform() t.transform.identity() t.transform.rotate(0, 90, 0) t.transform.preTranslate(100, 0, 0) gbModel = member("scene").model("mars") gbModel.transform = t put gbModel.transform.position -- vector(0.0000, 0.0000, -100.0000) print() Usage -- Lingo syntax spriteObjRef.print({targetName, #printingBounds}) // JavaScript syntax spriteObjRef.print({targetName, #printingBounds}); Description Command; calls the corresponding print ActionScript command, which was introduced in Flash 5.
printFrom() Usage -- Lingo syntax _movie.printFrom(startFrameNameOrNum {, endFrameNameOrNum, redux}) // JavaScript syntax _movie.printFrom(startFrameNameOrNum {, endFrameNameOrNum, redux}); Description Movie method; prints whatever is displayed on the Stage in each frame, whether or not the frame is selected, starting at the frame specified by startFrame. Optionally, you can supply endFrame and a reduction (redux) value (100%, 50%, or 25%). The frame being printed need not be currently displayed.
propList() Usage -- Lingo syntax propList() [:] propList(string1, value1, string2, value2, ...) propList(#symbol1, value1, #symbol2, value2, ...) [#symbol1:value1, #symbol2:value2, ...] // JavaScript syntax propList(); propList(string1, value1, string2, value2, ...); Description Top level function; creates a property list, where each element in the list consists of a name/value pair.
proxyServer Usage proxyServer serverType, "ipAddress", portNum proxyServer() Description Command; sets the values of an FTP or HTTP proxy server. Without parameters, proxyServer() returns the settings of an FTP or HTTP proxy server. Parameters serverType Optional. #ftp or #http. ipAddress portNum A symbol that specifies the type of proxy server. The value can be either Optional. A string that specifies the IP address. Optional. An integer that specifies the port number.
puppetPalette() Usage -- Lingo syntax _movie.puppetPalette(palette {, speed} {, frames}) // JavaScript syntax _movie.puppetPalette(palette {, speed} {, frames}); Description Movie method; causes the palette channel to act as a puppet and lets script override the palette setting in the palette channel of the Score and assign palettes to the movie. The puppetPalette() method sets the current palette to the palette cast member specified by palette.
puppetSprite() Usage -- Lingo syntax _movie.puppetSprite(intSpriteNum, bool) // JavaScript syntax _movie.puppetSprite(intSpriteNum, bool); Description Movie method; determines whether a sprite channel is a puppet and under script control (TRUE) or not a puppet and under the control of the Score (FALSE). While the playhead is in the same sprite, turning off the sprite channel’s puppetting using the syntax puppetSprite(intSpriteNum, FALSE) resets the sprite’s properties to those in the Score.
This statement removes the puppet condition from the sprite in the channel numbered i + 1: -- Lingo syntax _movie.puppetSprite(i + 1, FALSE) // JavaScript syntax _movie.puppetSprite(i + 1, false); See also makeScriptedSprite(), Movie, Sprite Channel puppetTempo() Usage -- Lingo syntax _movie.puppetTempo(intTempo) // JavaScript syntax _movie.puppetTempo(intTempo); Description Movie method; causes the tempo channel to act as a puppet and sets the tempo to a specified number of frames.
puppetTransition() Usage -- Lingo syntax _movie.puppetTransition(memberObjRef) _movie.puppetTransition(int {, time} {, size} {, area}) // JavaScript syntax _movie.puppetTransition(memberObjRef); _movie.puppetTransition(int {, time} {, size} {, area}); Description Movie method; performs the specified transition between the current frame and the next frame. To use an Xtra transition cast member, use the puppetTransition(memberObjRef) syntax.
Code Transition Code Transition 20 Reveal down, left 46 Strips on top, build right 21 Reveal left 47 Zoom open 22 Reveal up, left 48 Zoom close 23 Dissolve, pixels fast* 49 Vertical blinds 24 Dissolve, boxy rectangles 50 Dissolve, bits fast* 25 Dissolve, boxy squares 51 Dissolve, pixels* 26 Dissolve, patterns 52 Dissolve, bits* Transitions marked with an asterisk (*) do not work on monitors set to 32 bits.
This statement performs a wipe left transition that lasts 1 second, has a chunk size of 20, and occurs over the entire Stage: -- Lingo syntax _movie.puppetTransition(2, 4, 20, FALSE) // JavaScript syntax _movie.puppetTransition(2, 4, 20, false); See also Movie put() Usage -- Lingo syntax put(value) // JavaScript syntax put(value); Description Top level function; evaluates an expression and displays the result in the Message window.
qtRegisterAccessKey() Usage -- Lingo syntax qtRegisterAccessKey(categoryString, keyString) // JavaScript syntax qtRegisterAccessKey(categoryString, keyString); Description Command; allows registration of a key for encrypted QuickTime media. The key is an application-level key, not a system-level key. After the application unregisters the key or shuts down, the media will no longer be accessible. Note: For security reasons, there is no way to display a listing of all registered keys.
Once a sound has been queued, it can be played immediately with the play() method. This is because Director preloads a certain amount of each sound that is queued, preventing any delay between the play() method and the start of playback. The default amount of sound that is preloaded is 1500 milliseconds. This parameter can be modified by passing a property list containing one or more parameters with the queue() method. These parameters can also be passed with the setPlayList() method.
See also endTime, loopCount, loopEndTime, loopStartTime, pause() (Sound Channel), play() (Sound Channel), preLoadTime, setPlayList(), Sound Channel, startTime, stop() (Sound Channel) queue() (3D) Usage member(whichCastmember).model(whichModel).bonesPlayer.queue\ (motionName {, looped, startTime, endTime, scale, offset}) member(whichCastmember).model(whichModel).keyframePlayer.
The following Lingo adds the motion named Kick to the end of the bonesPlayer playlist of the model named Walker. When all motions before Kick in the playlist have been executed, a section of Kick will play in a continuous loop. The first iteration of the loop will begin 2000 milliseconds from the motion’s beginning. All subsequent iterations of the loop will begin 1000 milliseconds from Kick’s beginning and will end 5000 milliseconds from Kick’s beginning.
Parameters None. Example This statement tells the computer to exit to the Windows desktop or Macintosh Finder when the user presses Control+Q in Windows or Command+Q on the Macintosh: -- Lingo syntax if (_key.key = "q" and _key.commandDown) then _player.quit() end if // JavaScript syntax if (_key.key == "q" && _key.commandDown) { _player.quit(); } See also Player ramNeeded() Usage -- Lingo syntax _movie.ramNeeded(intFromFrame, intToFrame) // JavaScript syntax _movie.
This statement determines whether the memory needed to display frames 100 to 125 is more than the available memory, and, if it is, branches to the section using cast members that have lower color depth: -- Lingo syntax if (_movie.ramNeeded(100, 125) > _system.freeBytes) then _movie.go("8-bit") end if // JavaScript syntax if (_movie.ramNeeded(100, 125) > _system.freeBytes) { _movie.
This handler randomly chooses which of two movie segments to play: -- Lingo syntax on SelectScene if (random(2) = 2) then _movie.go("11a") else _movie.go("11b") end if end // JavaScript syntax function SelectScene() { if (random(2) == 1) { _movie.go("11a"); } else { _movie.
Example These statements create and display two randomly defined unit vectors in the Message window: -- Lingo syntax vec1 = randomVector() vec2 = randomVector() put(vec1 & RETURN & vec2) // JavaScript syntax var vec1 = randomVector(); var vec2 = randomVector(); put(vec1 + "\n" + vec2); See also vector() randomVector Usage randomVector() Description 3D command; returns a unit vector describing a randomly chosen point on the surface of a unit sphere. This method differs from vector( random(10)/10.
Parameters None. Example This statement creates a child object called RedCar from the parent script CarParentScript without initializing its properties: RedCar = script("CarParentScript").rawNew() This statement initializes the properties of the child object RedCar: RedCar.new() See also new(), script() readChar() Usage -- Lingo syntax fileioObjRef.readChar() // JavaScript syntax fileioObjRef.
See also Fileio, openFile() readLine() Usage -- Lingo syntax fileioObjRef.readLine() // JavaScript syntax fileioObjRef.readLine(); Description Fileio method; Reads the next line of a file, including the next RETURN, and returns it as a string. You must first open a file by calling openFile() before using readLine() to read a line. Parameters None. See also Fileio, openFile() readToken() Usage -- Lingo syntax fileioObjRef.readToken(stringSkip, stringBreak) // JavaScript syntax fileioObjRef.
readWord() Usage -- Lingo syntax fileioObjRef.readWord() // JavaScript syntax fileioObjRef.readWord(); Description Fileio method; Reads the next word of a file and returns it as a string. You must first open a file by calling openFile() before using readWord() to read a word. Parameters None.
Example The following code shows that the realPlayerNativeAudio() function is set to FALSE, which means that audio in the RealMedia cast member will be processed by Director: -- Lingo syntax put(realPlayerNativeAudio()) -- 0 // JavaScript syntax trace(realPlayerNativeAudio()); // 0 The following code sets the realPlayerNativeAudio() function to TRUE, which means that audio in the RealMedia stream will be processed by RealPlayer and all Lingo control of the sound channel will be ignored: -- Lingo syntax re
Example The following code shows that the realPlayerPromptToInstall() function is set to TRUE, which means users who do not have RealPlayer will be prompted to install it: -- Lingo syntax put(realPlayerPromptToInstall()) -- 1 // JavaScript syntax -- Lingo syntax trace(realPlayerPromptToInstall()); // 1 The following code sets the realPlayerPromptToInstall() function to FALSE, which means that users will not be prompted to install RealPlayer unless you have created a detection and alert system: -- Lingo sy
To view the RealPlayer build number in Windows: 1 Launch RealPlayer. 2 Choose About RealPlayer from the Help menu. In the window that appears, the build number appears at the top of the screen in the second line. To view the RealPlayer build number on the Macintosh: 1 Launch RealPlayer. 2 Choose About RealPlayer from the Apple menu. The About RealPlayer dialog box appears. Ignore the build number listed in the second line at the top of the screen; it is incorrect. 3 Click the Version Info button.
face Optional. Specifies a list of symbols indicating the face of the original font. Possible values are #plain, #bold, #italic. If you do not provide a value for this parameter, #plain is used. bitmapSizes Optional. Specifies a list of integers specifying the sizes for which bitmaps are to be recorded. This parameter can be empty. If you omit this parameter, no bitmaps are generated. These bitmaps typically look better at smaller point sizes (below 14 points) but take up more memory.
var myRectWidth1 = myRect.right - myRect.left; // 50 var myRectWidth2 = myRect[3] - myRect[1]; // 50 To see an example of rect() used in a completed movie, see the Imaging movie in the Learning/ Lingo folder inside the Director application folder. Parameters intLeft Required. An integer that specifies the number of pixels that the left side of the rectangle is from the left edge of the Stage. intTop Required.
registerForEvent() Usage member(whichCastmember).registerForEvent(eventName, \ handlerName, scriptObject {, begin, period, repetitions}) Description 3D command; declares the specified handler as the handler to be called when the specified event occurs within the specified cast member. The following parameter descriptions apply to both the registerForEvent() and the registerScript() commands.
• • duration is the total number of milliseconds that will elapse between the registerForEvent call and the last #timeMS event. For example, if there are five iterations with a period of 500 ms, the duration is 2500 ms. For tasks with unlimited iterations, the duration is 0. systemTime is the absolute time in milliseconds since the Director movie started. scriptObject Required. Specifies the script object that contains the handler handlerName.
Parameters Required. Specifies the name of the event. The event can be any of the following predefined events, or any custom event that you define: eventName • • #collideAny • #animationStarted and #animationEnded are notification events that occur when a bones or keyframe animation starts or stops playing. The handler will receive three arguments: eventName, motion, and time. The eventName argument is either #animationStarted or #animationEnded.
Example This statement registers the messageReceived event handler found in a movie script to be called when the model named Player receives the custom user defined event named #message: member("Scene").model("Player").
Example This command removes the model named gbCyl from the 3D world of the cast member named Scene: member("Scene").model("gbCyl").removeFromWorld() removeLast() member(whichCastmember).model(whichModel).bonesPlayer.removeLast() member(whichCastmember).model(whichModel).keyframePlayer.\ removeLast() Description 3D keyframePlayer and bonesPlayer modifier command; removes the last motion from the modifier’s playlist. Parameters None.
removeOverlay Usage member(whichCastmember).camera(whichCamera).removeOverlay(index) Description 3D command; removes the overlay found in a specified position from the camera’s list of overlays to display. Parameters index Required. Specifies the index position of the overlay in the list of overlays. Example The following statement removes the third overlay from the list of overlays for the camera being used by sprite 5. The overlay disappears from the Stage. sprite(5).camera.
resetWorld Usage member(whichCastmember).resetWorld() member(whichTextCastmember).resetWorld() Description 3D command; resets the member’s properties of the referenced 3D cast member to the values stored when the member was first loaded into memory. The member’s state property must be either 0 (unloaded), 4 (media loaded), or -1 (error) before this command can be used, otherwise a script error will occur.
resolveB Usage collisionData.resolveB(bResolve) Description 3D collision method; overrides the collision behavior set by the collision.resolve property for collisionData.modelB. Call this function only if you wish to override the behavior set for modelB using collision.resolve. Parameters Required. Specifies whether the collision for modelB is resolved. If bResolve is TRUE, then the collision for the modelB is resolved; if bResolve is FALSE the collision for modelB is not resolved.
restore() Usage -- Lingo syntax windowObjRef.restore() // JavaScript syntax windowObjRef.restore(); Description Window method; restores a window after it has been maximized. Use this method when making custom titlebars for movies in a window (MIAW). Parameters None. Example This statement restores the maximized window named Control Panel: -- Lingo syntax window("Control Panel").restore() // JavaScript syntax window("Control Panel").
In the following example, the two statements diceRoll roll = the result are equivalent to this statement: set roll = diceRoll() The statement set roll = diceRoll would not call the handler because there are no parentheses following diceRoll; diceRoll here is considered a variable reference. See also return (keyword) resume() Usage -- Lingo syntax animGifSpriteRef.resume() // JavaScript syntax animGifSpriteRef.
Example This statement resumes playback after a menu has been displayed: -- Lingo syntax member(1).returnToTitle() // JavaScript syntax member(1).returnToTitle(); See also DVD revertToWorldDefaults Usage member(whichCastmember).revertToWorldDefaults() Description 3D command; reverts the properties of the specified 3D cast member to the values stored when the member was first created.
Parameters None. Example This statement restarts playback of the sound cast member playing in sound channel 1 from the beginning: -- Lingo syntax sound(1).rewind() // JavaScript syntax sound(1).rewind(); See also Sound Channel, startTime rewind() (Windows Media) Usage -- Lingo syntax windowsMediaObjRef.rewind() // JavaScript syntax windowsMediaObjRef.rewind(); Description Windows Media cast member or sprite method. Rewinds to the first frame of a Windows Media cast member or sprite.
Example The following frame script checks whether the Flash movie sprite in the sprite the behavior was placed in is playing and, if so, continues to loop in the current frame. When the movie is finished, the sprite rewinds the movie (so the first frame of the movie appears on the Stage) and lets the playhead continue to the next frame. -- Lingo syntax property spriteNum on exitFrame if sprite(spriteNum).playing then _movie.go(_movie.frame) else sprite(spriteNum).rewind() _movie.
Example This statement changes the content of the field cast member Message to “This is the place.” when the pointer is over sprite 6: -- Lingo syntax if (_movie.rollOver(6)) then member("Message").text = "This is the place." end if // JavaScript syntax if (_movie.rollOver(6)) { member("Message").text = "This is the place."; } The following handler sends the playhead to different frames when the pointer is over certain sprites on the Stage. It first assigns the rollOver value to a variable.
Parameters None. Example This statement displays the root menu: -- Lingo syntax member(1).rootMenu() // JavaScript syntax member(1).rootMenu(); See also DVD rotate Usage member(whichCastmember).node(whichNode).rotate(xAngle, yAngle, \ zAngle {, relativeTo}) member(whichCastmember).node(whichNode).rotate(rotationVector \ {, relativeTo}) member(whichCastmember).node(whichNode).rotate(position, axis, \ angle {, relativeTo}) transform.rotate(xAngle, yAngle, zAngle {, relativeTo}) transform.
Required if applying a rotation about an arbitrary axis passing through a point in space. Specifies the amount of rotation about the axis axis. angle relativeTo Optional. Specifies which coordinate system axes are used to apply the desired rotational changes. The relativeTo parameter can have any of the following values: • • • • #self applies the increments relative to the node’s local coordinate system (the X, Y and Z axes specified for the model during authoring).
Parameters None. Example This statement determines whether or not external parameters are available and obtains them if they are: --Lingo syntax if the runMode contains "Plugin" then -- decode the embed parameter if externalParamName(swURL) = swURL then put externalParamValue(swURL) into myVariable end if end if // JavaScript syntax if (_movie.runMode.
saveMovie() Usage -- Lingo syntax _movie.saveMovie({stringFilePath}) // JavaScript syntax _movie.saveMovie({stringFilePath}); Description Movie method; saves the current movie. Including the optional stringFilePath parameter saves the movie to the file specified. This method does not work with compressed files. The specified filename must include the .dir file extension. The saveMovie() method doesn’t support URLs as file references. Parameters stringFilePath Optional.
Parameters xScale Required if specifying three scalings. Specifies the scale along the x-axis. yScale Required if specifying three scalings. Specifies the scale along the y-axis. zScale Required if specifying three scalings. Specifies the scale along the z-axis. uniformScale Required if specifying a single, uniform scaling. Specifies the uniform scaling. Example This example first displays the transform.
Example In Lingo only, these statements check whether a child object is an instance of the parent script Warrior Ant: -- Lingo syntax if (bugObject.script = script("Warrior Ant")) then bugObject.attack() end if This statement sets the variable actionMember to the script cast member Actions: -- Lingo syntax actionMember = script("Actions") // JavaScript syntax var actionMember = script("Actions"); scrollByLine() Usage -- Lingo syntax memberObjRef.scrollByLine(amount) // JavaScript syntax memberObjRef.
scrollByPage() Usage -- Lingo syntax memberObjRef.scrollByPage(amount) // JavaScript syntax memberObjRef.scrollByPage(amount); Description Command; scrolls the specified field or text cast member up or down by a specified number of pages. A page is equal to the number of lines of text visible on the screen. Parameters Required. Specifies the number of pages to scroll. When amount is positive, the field scrolls down. When amount is negative, the field scrolls up.
If the seek command is called when mediaStatus is #paused, the stream rebuffers and returns to #paused at the new location specified by seek. If seek is called when mediaStatus is #playing, the stream rebuffers and automatically begins playing at the new location in the stream. If seek is called when mediaStatus is #closed, nothing happens. If you attempt to seek beyond the stream’s duration value, the integer argument you specify is clipped to the range from 0 to the duration of the stream.
Example This statement moves focus to the button under a specified point: -- Lingo syntax member(10).selectAtLoc(point(50, 75)) // JavaScript syntax member(10).selectAtLoc(point(50, 75)); See also DVD selectButton() Usage -- Lingo syntax dvdObjRef.selectButton(intButton) // JavaScript syntax dvdObjRef.selectButton(intButton); Description DVD method; selects a specified button. This method returns 0 if successful. Parameters intButton Required. An integer that specifies the button that is given focus.
Parameters Required. A symbol (Lingo) or a string (JavaScript syntax) that specifies the direction to move from the current button position. Valid values are left or right. direction Example This statement specifies the button to the left of the current button: -- Lingo syntax member(12).member.selectButtonRelative(#left) // JavaScript syntax member(12).member.
For best results, send the message only to those sprites that will properly handle the message through the sendSprite() method. No error will occur if the message is sent to all the sprites, but performance may decrease. There may also be problems if different sprites have the same handler in a behavior, so avoid conflicts by using unique names for messages that will be broadcast.
Example The first line in this example creates an instance of a parent script named "tester". The second line sets the handler of the script instance, jumpPluto, as the handler to be called when the #jump event is sent. The third line registers a movie script handler named jumpMars as another handler to be called when the #jump event is sent. The fourth line sends the #jump event.
See also Movie setAlpha() Usage imageObject.setAlpha(alphaLevel) imageObject.setAlpha(alphaImageObject) Description Function; sets the alpha channel of an image object to a flat alphaLevel or to an existing alphaImageObject. The alphaLevel must be a number from 0–255. Lower values cause the image to appear more transparent. Higher values cause the image to appear more opaque. The value 255 has the same effect as a value of zero.
• The setaProp command can also set ancestor properties. Parameters listProperty Required. A symbol (Lingo only) or a string that specifies the name of the property whose value is changing. newValue Required. The new value for the listProperty property.
When the handler runs, the Message window displays the following: [12, 34, 6, 10, 45] You can perform this same operation may be done using bracket access to the list in the following manner: on enterFrame set vNumbers = [12, 34, 6, 7, 45] vnumbers[4] = 10 put vNumbers end enterFrame When the handler runs, the Message window displays the following: [12, 34, 6, 10, 45] See also [ ] (bracket access) setCallback() Usage -- Lingo syntax spriteObjRef.
Example This statement sets a the Lingo handler named myOnStatus in the Lingo script object me to be called when an onStatus event is generated by the ActionScript object tLocalConObject in the Flash movie in sprite 3: -- Lingo syntax sprite(3).setCallback(tLocalConObject, "onStatus", #myOnStatus, me) // JavaScript syntax sprite(3).
This command is a shorter alternative to using the registerScript command for collisions, but there is no difference in the overall result. This command can be considered to perform a small subset of the registerScript command functionality. Parameters handlerName Required. Specifies the handler called when a model is involved in a collision. scriptInstance handlerName. Required.
Parameters stringAttrs Required. A string that specifies the finder information. See also Fileio setFlashProperty() Usage -- Lingo syntax spriteObjRef.setFlashProperty(targetName, #property, newValue) // JavaScript syntax spriteObjRef.setFlashProperty(targetName, #property, newValue); Description Function; allows Lingo to call the Flash action script function setProperty() on the given Flash sprite. Use the setFlashProperty() function to set the properties of movie clips or levels within a Flash movie.
setNewLineConversion() Usage -- Lingo syntax fileioObjRef.setNewLineConversion(intOnOff) // JavaScript syntax fileioObjRef.setNewLineConversion(intOnOff) Description Fileio method (Macintosh only); Specifies whether automatic conversion of new line characters is on or off. Parameters Required. An integer that specifies whether automatic conversion is on or off. Valid values include 0 (off ) or 1 (on). intOnOff See also Fileio setPixel() Usage -- Lingo syntax imageObjRef.
colorObjOrIntValue Required if setting the color to a color object or an integer value. A reference to a color object that specifies the color of the pixel, or an integer that specifies the color value of the pixel. Example This Lingo statement draws a horizontal black line 50 pixels from left to right in cast member 5: See also color(), draw(), fill(), getPixel(), image() setPlayList() Usage -- Lingo syntax soundChannelObjRef.setPlayList(linearListOfPropLists) // JavaScript syntax soundChannelObjRef.
Example This handler queues and plays the cast member introMusic, starting at its 3-second point, with a loop repeated 5 times from the 8-second point to the 8.9-second point, and stopping at the 10second point. -- Lingo syntax on playMusic sound(2).queue([#member:member("introMusic"), #startTime:3000, \ #endTime:10000, #loopCount:5, #loopStartTime:8000, #loopEndTime:8900]) sound(2).play() end playMusic // JavaScript syntax function playMusic() { sound(2).
After setPref() runs, if the movie is playing in a browser, a folder named Prefs is created in the Plug-In Support folder. The setPref() method can write only to that folder. If the movie is playing in a projector or Director, a folder is created in the same folder as the application. The folder receives the name Prefs. Do not use this method to write to read-only media. Depending on the platform and version of the operating system, you may encounter errors or other problems.
This command is similar to the setaProp command, except that setProp returns an error when the property is not already in the list. Parameters Required. A symbol (Lingo only) or a string that specifies the property whose value is replaced by newValue. property newValue Required. The new value for the property specified by property.
Description Flash sprite command; invokes the Flash Settings dialog box to the specified panel index. This is the same dialog box that can be opened by right-clicking (Windows) or Control-clicking (Macintosh) on a Flash movie playing in a browser. The Settings dialog box will not be displayed if the Flash sprite’s rectangle is not large enough to accommodate it.
If the movie is playing in a projector or Director, a folder is created in the same folder as the application. The folder receives the name Prefs. Do not use this method to write to read-only media. Depending on the platform and version of the operating system, you may encounter errors or other problems. This method does not perform any sophisticated manipulation of the string data or its formatting.
trueOrFalse not (FALSE). Required. Specifies whether the track in the digital video is enabled (TRUE) or Example This statement enables track 3 of the digital video assigned to sprite channel 8: -- Lingo syntax sprite(8).setTrackEnabled(3, TRUE) // JavaScript syntax sprite(8).setTrackEnabled(3, 1); See also trackEnabled setVariable() Usage -- Lingo syntax spriteObjRef.setVariable(variableName, newValue) // JavaScript syntax spriteObjRef.
shader() Usage member(whichCastmember).shader(whichShader) member(whichCastmember).shader[index] member(whichCastmember).model(whichModel).shader member(whichCastmember).modelResource(whichModelResource).\ face[index].shader Description 3D element, model property, and face property; the object used to define the appearance of the surface of the model. The shader is the “skin” which is wrapped around the model resource used by the model. The shader itself is not an image.
showLocals() Usage -- Lingo syntax showLocals() Description Top level function (Lingo only); displays all local variables in the Message window. This command is useful only within handlers or parent scripts that contain local variables to display. All variables used in the Message window are automatically global. Local variables in a handler are no longer available after the handler executes.
end // JavaScript syntax function ShowCastProperties(whichCast) { i = 1; while( i < (castLib(whichCast).member.count) +1 ) { castType = member(i, whichCast).type; if ((castType = "flash") || (castType = "vectorShape")) { trace (castType + " cast member " + i + ": " + member(i, whichCast).name) + \n; member(i ,whichCast).showProps(); i++; } } } See also queue(), setPlayList() showGlobals() Usage -- Lingo syntax _global.showGlobals() // JavaScript syntax _global.showGlobals(); Parameters None.
shutDown() Usage -- Lingo syntax _system.shutDown() // JavaScript syntax _system.shutDown(); Description System method; closes all open applications and turns off the computer. Parameters None. Example This statement checks whether the user has pressed Control+S (Windows) or Command+S (Macintosh) and, if so, shuts down the computer: See also System sin() Usage sin(angle) Description Math function (Lingo only); calculates the sine of the specified angle.
sort Usage list.sort() sort list Description Command; puts list items into alphanumeric order. • When the list is a linear list, the list is sorted by values. • When the list is a property list, the list is sorted alphabetically by properties. After a list is sorted, it maintains its sort order even when you add new variables using the command. add Parameters None. Example The following statement puts the list Values, which consists of [#a: 1, #d: 2, #c: 3], into alphanumeric order.
See also channel() (Sound), Sound Channel sprite() Usage -- Lingo syntax sprite(nameOrNum) // JavaScript syntax sprite(nameOrNum); Description Top level function; returns a reference to a given sprite in the Score. If the movie scriptExecutionStyle property is set to a value of 9, calling sprite("foo") where no sprite with that name exists returns a reference to sprite 1.
Parameters loc Required. Specifies the location in the referenced sprite. This location should be a point relative to the sprite’s upper-left corner. Example This statement shows that the point (50, 50) within sprite 5 is equivalent to the vector (-1993.6699, 52.0773, 2263.7446) on the projection plane of the camera of sprite 5: put sprite(5).camera.spriteSpaceToWorldSpace(point(50, 50)) -- vector(-1993.6699, 52.0773, 2263.
stageBottom Usage the stageBottom Description Function; along with stageLeft, stageRight, and stageTop, indicates where the Stage is positioned on the desktop. It returns the bottom vertical coordinate of the Stage relative to the upper left corner of the main screen. The height of the Stage in pixels is determined by the stageBottom - the stageTop. When the movie plays back as an applet, the stageBottom property is the height of the applet in pixels. This function can be tested but not set.
Example This statement checks whether the left edge of the Stage is beyond the left edge of the screen and calls the handler leftMonitorProcedure if it is: if the stageLeft < 0 then leftMonitorProcedure See also stageBottom, stageRight, stageTop, locH, locV stageRight Usage the stageRight Description Function; along with stageLeft, stageTop, and stageBottom, indicates where the Stage is positioned on the desktop.
Flash movie coordinates are measured in Flash movie pixels, which are determined by the original size of the movie when it was created in Flash. Point (0,0) of a Flash movie is always at its upper left corner. (The cast member’s originPoint property is not used to calculate movie coordinates; it is used only for rotation and scaling.
Parameters None. Example This statement checks whether the top of the Stage is beyond the top of the screen and calls the handler upperMonitorProcedure if it is: if the stageTop < 0 then upperMonitorProcedure See also stageLeft, stageRight, stageBottom, locH, locV status() Usage -- Lingo syntax fileioObjRef.status() // JavaScript syntax fileioObjRef.status(); Description Fileio method; Returns the error code of the last method called. Parameters None.
Example This statement stops playback: -- Lingo syntax member(1).stop() // JavaScript syntax member(1).stop(); See also DVD stop() (Sound Channel) Usage -- Lingo syntax soundChannelObjRef.stop() // JavaScript syntax soundChannelObjRef.stop(); Description Sound Channel method; stops the currently playing sound in a sound channel. Issuing a play() method begins playing the first sound of those that remain in the queue of the given sound channel.
stop() (Flash) Usage -- Lingo syntax spriteObjRef.stop() // JavaScript syntax spriteObjRef.stop(); Description Flash command; stops a Flash movie sprite that is playing in the current frame. Parameters None. Example This frame script stops the Flash movie sprites playing in channels 5 through 10: -- Lingo syntax on enterFrame repeat with i = 5 to 10 sprite(i).stop() end repeat end // JavaScript syntax function enterFrame() { var i = 5; while (i < 11) { sprite(i).
Example The following examples stop sprite 2 and the cast member Real from playing: -- Lingo syntax sprite(2).stop() member("Real").stop() // JavaScript syntax sprite(2).stop(); member("Real").stop(); See also RealMedia, Windows Media stopEvent() Usage -- Lingo syntax _movie.stopEvent() // JavaScript syntax _movie.stopEvent(); Description Movie method; prevents scripts from passing an event message to subsequent locations in the message hierarchy. This method also applies to sprite scripts.
// JavaScript syntax _global.grandTotal; function mouseUp() { if (_global.grandTotal == 500) { _movie.stopEvent(); } } Neither subsequent scripts nor other behaviors on the sprite receive the event if it is stopped in this manner. See also Movie stream() Usage -- Lingo syntax memberObjRef.stream(numberOfBytes) // JavaScript syntax memberObjRef.stream(numberOfBytes); Description Command; manually streams a portion of a specified Flash movie cast member into memory.
-- Lingo syntax on exitFrame if member(10).percentStreamed < 100 then bytesReceived = member(10).stream(32000) if bytesReceived < 32000 then member("Message Line").text = "Received only" && bytesReceived \ && "of 32,000 bytes requested." _movie.updateStage() else member("Message Line").text = "Received all 32,000 bytes." end if _movie.go(_movie.frame) end if end // JavaScript syntax function exitFrame() { var pctStm = member(10).percentStreamed; if (pctStm < 100) { var bytesReceived = member(10).
stringP() Usage stringP(expression) Description Function; determines whether an expression is a string (TRUE) or not (FALSE). The P in stringP stands for predicate. Parameters expression Required. The expression to test. Example This statement checks whether 3 is a string: put stringP("3") The result is 1, which is the numeric equivalent of TRUE. This statement checks whether the floating-point number 3.0 is a string: put stringP(3.0) Because 3.
Example This statement returns the sub-picture type in stream 2: -- Lingo syntax member(12).member.subPictureType(2) // JavaScript syntax member(12).member.subPictureType(2); See also DVD substituteFont Usage TextMemberRef.substituteFont(originalFont, newFont) substituteFont(textMemberRef, originalFont, newFont) Description Text cast member command; replaces all instances of one font with another font in a text cast member. Parameters originalFont newFont Required. The font to replace. Required.
swing() Usage -- Lingo syntax spriteObjRef.swing(pan, tilt, fieldOfView, speedToSwing) // JavaScript syntax spriteObjRef.swing(pan, tilt, fieldOfView, speedToSwing); Description QuickTime VR sprite function; swings a QuickTime 3 sprite containing a VR Pano around to the new view settings. The swing is a smooth “camera dolly” effect. whichQTVRSprite is the sprite number of the sprite with the QuickTime VR member.
symbol() Usage -- Lingo syntax symbol(stringValue) // JavaScript syntax symbol(stringValue); Description Top level function; takes a string and returns a symbol. Parameters stringValue Required. The string to convert to a symbol.
Example This statement checks whether the variable myVariable is a symbol: put myVariable.symbolP See also ilk() tan() Usage tan(angle) Description Math function; yields the tangent of the specified angle expressed in radians as a floating-point number. In JavaScript syntax, use the Math object’s tan() function. Parameters angle Required. Specifies the angle from which a tangent is yielded. Example The following function yields the tangent of pi/4: tan (PI/4.
Example This on prepareMovie handler turns the on streamStatus handler on when the movie starts: -- Lingo syntax on prepareMovie tellStreamStatus(TRUE) end // JavaScript syntax function prepareMovie() { tellStreamStatus(TRUE); } This statement determines the status of the stream status handler: -- Lingo syntax on mouseDown put tellStreamStatus() end // JavaScript syntax function mouseDown() { put(tellStreamStatus()); } See also on streamStatus tellTarget() Usage -- Lingo syntax spriteObjRef.
Example This command sets the movie clip as the target: -- Lingo syntax sprite(1).tellTarget("\myMovieClip") // JavaScript syntax sprite(1).tellTarget("\myMovieClip"); This command stops the movie clip: -- Lingo syntax sprite(1).stop() // JavaScript syntax sprite(1).stop(); This command causes the movie clip to play: -- Lingo syntax sprite(1).play() // JavaScript syntax sprite(1).play(); This command switches the focus back to the main Timeline: -- Lingo syntax sprite(1).
texture() Usage member(whichCastmember).texture(whichTexture) member(whichCastmember).texture[index] member(whichCastmember).shader(whichShader).texture member(whichCastmember).model(whichModel).shader.texture member(whichCastmember).model(whichModel).shaderList.texture member(whichCastmember).model(whichModel).shaderList[index].texture member(whichCastmember).modelResource(whichParticleSystemModel\ Resource).
time() (System) Usage -- Lingo syntax _system.time() // JavaScript syntax _system.time(); Description System method; returns the current time in the system clock as a string. The returned time is formatted as follows: 1:30 PM Parameters None. Example The following handler outputs the current time to a text field. -- Lingo syntax on exitFrame member("clock").text = _system.time() end // JavaScript syntax function exitFrame() { member("clock").text = _system.
Example This handler deletes the timeout object named Random Lightning: -- Lingo syntax on exitFrame timeout("Random Lightning").forget() end // JavaScript syntax function exitFrame() { timeout("Random Lightning").forget(); } See also new(), timeoutList, timeoutHandler, time (timeout object), name (timeout), period, persistent, target titleMenu() Usage -- Lingo syntax dvdObjRef.titleMenu() // JavaScript syntax dvdObjRef.titleMenu(); Description DVD method; displays the title menu. Parameters None.
Parameters None. Example This statement sets the top property of the model resource Gift box to FALSE, meaning the top of this box will be open: member("3D World").modelResource("Gift box").top = FALSE See also back, bottom (3D), front topCap Usage modelResourceObjectReference.topCap Description 3D command; when used with a model resource whose type is #cylinder, allows you to both get and set the topCap property of the model resource.
Example The following statement sets the topRadius property of the model resource Tube to 0.0. If the bottom radius has a value greater than 0, models using Tube will be conical. member("3D World").modelResource("Tube").topRadius = 0.0 trace() Usage -- Lingo syntax trace(value) // JavaScript syntax trace(value); Description Top level function; evaluates an expression and displays the result in the Message window.
Parameters None. Example This statement creates an identity transform and stores it in the variable tTransform: tTransform = transform() See also transform (property), preRotate, preTranslate(), preScale(), rotate, translate, scale (command) translate Usage member(whichCastmember).node(whichNode).translate(xIncrement, \ yIncrement, zIncrement {, relativeTo}) member(whichCastmember).node(whichNode).translate\ (translateVector {, relativeTo}) transform.
• • applies the increments relative to the world coordinate system. If a model’s parent is the world, than this is equivalent to using #parent. nodeReference allows you to specify a node to base your translation upon, the command applies the translations relative to the coordinate system of the specified node.
unLoad() (Member) Usage -- Lingo syntax memberObjRef.unLoad({toMemberObjRef}) // JavaScript syntax memberObjRef.unLoad({toMemberObjRef}); Description Member method; forces Director to clear the specified cast members from memory. Director automatically unloads the least recently used cast members to accommodate preLoad() methods or normal cast library loading. • When used without a parameter, unLoad() clears from memory the cast members in all the • frames of a movie.
unLoad() (Movie) Usage -- Lingo syntax _movie.unLoad({intFromFrameNum} {, intToFrameNum}) // JavaScript syntax _movie.unLoad({intFromFrameNum} {, intToFrameNum}); Description Movie method; removes the specified preloaded movie from memory. This command is useful in forcing movies to unload when memory is low. You can use a URL as the file reference. If the movie isn’t already in RAM, the result is -1. Parameters intFromFrameNum Optional.
• When used with one argument, memberObjRef, the unLoadMember() method clears from memory the cast members in that frame. • When used with two arguments, fromMemberNameOrNum and toMemberNameOrNum, the unLoadMember() method unloads all cast members in the range specified. You can specify a range of cast members by frame numbers or frame labels. Parameters memberObjRef Optional. A reference to the cast member to unload from memory. Required if clearing a range of cast members.
Parameters stringMovieName Required. A string that specifies the name of the movie to unload from memory. Example This statement checks whether the largest contiguous block of free memory is less than 100K and unloads the movie Parsifal if it is: -- Lingo syntax if (_system.freeBlock < (100*1024)) then _movie.unLoadMovie("Parsifal") end if // JavaScript syntax if (_system.freeBlock < (100*1024)) { _movie.unLoadMovie("Parsifal"); } This statement unloads the movie at http://www.cbDemille.com/SunsetBlvd.
update Usage -- Lingo syntax member(whichCastmember).model(whichModel).update // JavaScript syntax member(whichCastMember).model(whichModel).update(); Description 3D command; causes animations on the model to update without rendering. Use this command to find the exact position of an animating model in Lingo. Parameters None. updateFrame() Usage -- Lingo syntax _movie.updateFrame() // JavaScript syntax _movie.
// JavaScript syntax function animBall(numberOfFrames) { _movie.beginRecording(); var horizontal = 0; var vertical = 100; for (var i = 1; i <= numberOfFrames; i++) { _movie.go(1); sprite(20).member = member("Ball"); sprite(20).locH = horizontal; sprite(20).locV = vertical; sprite(20).foreColor = 255; horizontal = horizontal + 3; vertical = vertical + 2; _movie.updateFrame(); } _movie.
URLEncode Usage URLEncode(proplist_or_string {, serverOSString} {, characterSet}) Description Function; returns the URL-encoded string for its first argument. Allows CGI parameters to be used in other commands. The same translation is done as for postNetText and getNetText() when they are given a property list. Parameters propListOrString Required. Specifies the property list or string to be URL-encoded. serverOSString Optional. Encodes any return characters in propListOrString.
These two Lingo statements are also equivalent: x = (the mouseH - 10) / (the mouseV + 10) x = value("(the mouseH - 10) / (the mouseV + 10)") Expressions that Lingo cannot parse will produce unexpected results, but will not produce Lingo errors. The result is the value of the initial portion of the expression up to the first syntax error found in the string.
vector() Usage -- Lingo syntax vector() vector(intX, intY, intZ) // JavaScript syntax vector(); vector(intX, intY, intZ); Description Top level function and data type. Describes a point in 3D space according to three parameters, which are the specific distances from the reference point along the x-axis, y-axis, and z-axis, respectively. If the vector is in world space, the reference point is the world origin, vector(0, 0, 0).
Parameters None. See also Fileio voiceCount() Usage voiceCount() Description Function: returns the number of installed voices available to the text-to-speech engine. The return value is an integer. This number of voices can be used with voiceSet() and voiceGet() to specify a particular voice to be active. Parameters None.
Example This statement sets the variable oldVoice to the property list describing the current text-tospeech voice: oldVoice = voiceGet() This statement displays the property list of the current text-to-speech voice: put voiceGet() -- [#name: "Mary", #age: "teen", #gender: "female", #index: 5] See also voiceInitialize(), voiceCount(), voiceSet(), voiceGet() voiceGetAll() Usage voiceGetAll() Description Function; returns a list of the available voices installed on the computer.
voiceGetPitch() Usage voiceGetPitch() Description Function; returns the current pitch for the current voice as an integer. The valid range of values depends on the operating system platform and text-to-speech software. Parameters None.
See also voiceSpeak(), voicePause(), voiceResume(), voiceStop(), voiceSetRate(), voiceGetPitch(), voiceSetPitch(), voiceGetVolume(), voiceSetVolume(), voiceState(), voiceWordPos() voiceGetVolume() Usage voiceGetVolume() Description Function: returns the current volume of the text-to-speech synthesis. The value returned is an integer. The valid range of values depends on the operating system platform. Parameters None.
Example These statements load the computer’s text-to-speech engine and then test for whether the text-tospeech engine has completed loading before using the voiceSpeak() command to speak the phrase “Welcome to Shockwave.”: -- Lingo syntax err = voiceInitialize() if err = 1 then voiceSpeak("Welcome to Shockwave") else alert "Text-to-speech software failed to load.
voiceResume() Usage voiceResume() Description Command; resumes the speech output to the text-to-speech engine. The command returns a value of 1 if it is successful, or 0 if it is not. Parameters None.
voiceSetPitch() Usage voiceSetPitch(integer) Description Command; sets the pitch for the current voice of the text-to-speech engine to the specified value. The return value is the new pitch value that has been set. Parameters integer Required. An integer that specifies the pitch for the text-to-speech voice. The valid range of values depends on the operating system platform and text-to-speech software.
voiceSetVolume() Usage voiceSetVolume(integer) Description Command; sets the volume of the text-to-speech synthesis. Parameters integer Required. An integer that specifies the volume of text-to-speech synthesis. The range of valid values depends on the operating system platform. If successful, the command returns the new value that was set. If an invalid value is specified, the volume is set to the nearest valid value.
voiceState() Usage -- Lingo syntax voiceState() // JavaScript syntax voiceState(); // documentation n/a Description Function; returns the current status of the voice as a symbol. The possible return values are #playing, #paused, and #stopped. Parameters None.
Example These statements stop the speech when the playhead moves to the next frame in the Score: -- Lingo syntax on exitFrame voiceStop() end exitFrame // JavaScript syntax function exitFrame() { voiceStop(); } See also voiceSpeak(), voicePause(), voiceResume(), voiceGetRate(), voiceSetRate(), voiceGetPitch(), voiceSetPitch(), voiceGetVolume(), voiceSetVolume(), voiceState(), voiceWordPos(), voiceSpeak() voiceWordPos() Usage -- Lingo syntax voiceWordPos() // JavaScript syntax voiceWordPos(); // documentat
voidP() Usage -- Lingo syntax voidP(variableName) // JavaScript syntax variableName == null Description Function; determines whether a specified variable has any value. If the variable has no value or is VOID, this function returns TRUE. If the variable has a value other than VOID, this function returns FALSE. Parameters variableName Required. Specifies the variable to test.
Example This statement sets the variable myWindow to the window named Collections: -- Lingo syntax myWindow = window("Collections") // JavaScript syntax var myWindow = window("Collections"); See also Window windowPresent() Usage -- Lingo syntax _player.windowPresent(stringWindowName) // JavaScript syntax _player.windowPresent(stringWindowName); Description Player method; indicates whether the object specified by stringWindowName is running as a movie in a window (TRUE) or not (FALSE).
worldSpaceToSpriteSpace Usage -- Lingo syntax member(whichCastmember).camera(whichCamera).worldSpaceToSpriteSpace(vector) // JavaScript syntax member(whichCastmember).camera(whichCamera).worldSpaceToSpriteSpace(vector); Description 3D command; returns the point within the camera’s rect at which a specified world-relative position would appear. The position returned by this command is relative to the upper left corner of the camera’s rect.
writeReturn() Usage -- Lingo syntax fileioObjRef.writeReturn() // JavaScript syntax fileioObjRef.writeReturn(); Description Fileio method; Inserts a line return in a file. Parameters None. See also Fileio writeString() Usage -- Lingo syntax fileioObjRef.writeString(string) // JavaScript syntax fileioObjRef.writeString(string) Description Fileio method; Writes a null-terminated string to a file. Parameters string Required. The string to write to a file.
Parameters xtraNameOrNum Required. A string that specifies the name of the Xtra to return, or an integer that specifies the index position of the Xtra to return. String names are not case sensitive.
Chapter 12: Methods
CHAPTER 13 Operators This section provides an alphabetical list of all the operators available in Macromedia Director MX 2004. The majority of these operators apply only to Lingo. JavaScript syntax does contain some operators that are either similar or identical to the Lingo operators listed here; therefore, where appropriate, JavaScript syntax usage and examples are provided to help you map the functionality of Lingo operators with their closest counterparts in JavaScript syntax.
• Symbols use the 128 ASCII characters, and letters with diacritical or accent marks are treated as their base letter. • Periods may not be used in symbols. All symbols, global variables, and names of parameters passed to global variables are stored in a common lookup table. Example This statement sets the state variable to the symbol #Playing: -- Lingo syntax state = #Playing // JavaScript syntax var state = symbol("Playing"); See also ilk(), string(), symbol(), symbolP() .
- (minus) Usage -- Lingo syntax (Negation): -expression (Subtraction): expression1 - expression2 // JavaScript syntax (Negation): -expression (Subtraction): expression1 - expression2 Description Math operator; when used for negation, - (minus) reverses the sign of the value of expression; when used for subtraction, - (minus) performs an arithmetic subtraction on two numerical expressions, subtracting expression2 from expression1.
-- (comment) Usage -- Lingo syntax -- comment // JavaScript syntax // comment Description Comment delimiter; indicates the beginning of a script comment. On any line, anything that appears between the comment delimiter (double hyphen) and the end-of-line return character is interpreted as a comment rather than a Lingo statement. Example This handler uses a double hyphen to make the second, fourth, and sixth lines comments: -- Lingo syntax on resetColors -- This handler resets the sprite’s colors.
Avoid this problem by placing parentheses around the entire phrase that includes an operator. The parentheses clear up Lingo’s confusion by changing the precedence by which Lingo deals with the operator, causing Lingo to treat the two parts of the argument as one complete argument.
This statement concatenates the strings “Today is” and today’s date in the long format and inserts a space between the two: -- Lingo syntax put("Today is" && date()) // JavaScript syntax put("Today is " + Date()); () (parentheses) Usage -- Lingo syntax (expression) // JavaScript syntax (expression) Description Grouping operator; performs a grouping operation on an expression to control the order of execution of the operators in an expression.
// JavaScript syntax put((2 + 3) * (4 + 5)); // 45 put(2 + (3 * (4 + 5))); // 29 put(2 + 3 * 4 + 5); // 19 * (multiplication) Usage -- Lingo syntax expression1 * expression2 // JavaScript syntax expression1 * expression2 Description Math operator; performs an arithmetic multiplication on two numerical expressions. If both expressions are integers, the product is an integer. If either or both expressions are floating-point numbers, the product is a floating-point number.
+ (addition) Usage -- Lingo syntax expression1 + expression2 // JavaScript syntax expression1 + expression2 Description Math operator; performs an arithmetic sum on two numerical expressions. If both expressions are integers, the sum is an integer. If either or both expressions are floating-point numbers, the sum is a floating-point number. This is an arithmetic operator with a precedence level of 4.
- (subtraction) Usage -- Lingo syntax vector1 - vector2 vector - scalar // JavaScript syntax vector1 - vector2 vector - scalar Description 3D vector operator; subtracts the components of vector2 from the corresponding components of vector1, or subtracts the scalar value from each of the components and returns a new vector. vector1 vector1 - vector2 subtracts the values of vector2 from the corresponding components in and returns a new vector.
/ (division) Usage -- Lingo syntax expression1 / expression2 // JavaScript syntax expression1 / expression2 Description Math operator; performs an arithmetic division on two numerical expressions, dividing expression1 by expression2. If both expressions are integers, the quotient is an integer. If either or both expressions are floating-point numbers, the quotient is a floating-point number. This is an arithmetic operator with a precedence level of 4.
< (less than) Usage -- Lingo syntax expression1 < expression2 // JavaScript syntax expression1 < expression2 Description Comparison operator; compares two expressions and determines whether expression1 is less than expression2 (TRUE), or whether expression1 is greater than or equal to expression2 (FALSE). This operator can compare strings, integers, floating-point numbers, rects, and points.
This operator can compare strings, integers, floating-point numbers, rects, and points. Be aware that comparisons performed on rects or points are handled as if the terms were lists, with each element of the first list compared to the corresponding element of the second list. This is a comparison operator with a precedence level of 1.
>= (greater than or equal to) Usage -- Lingo syntax expression1 >= expression2 // JavaScript syntax expression1 >= expression2 Description Comparison operator; compares two expressions and determines whether expression1 is greater than or equal to expression2 (TRUE), or whether expression1 is less than expression2 (FALSE). This operator can compare strings, integers, floating-point numbers, rects, and points.
Each entry in a linear list is a single value that has no other property associated with it. Each entry in a property list consists of a property and a value. The property appears before the value and is separated from the value by a colon. You cannot store a property in a linear list. When using strings as entries in a list, enclose the string in quotation marks. For example, [6, 3, 8] is a linear list. The numbers have no properties associated with them.
This handler sorts the list aList and then displays the result in the Message window: -- Lingo syntax on sortList aList alist.sort() put(aList) end sortList // JavaScript syntax function sortList(aList) { aList.sort(); put(aList); } If the movie issues the statement sortList machinery, where machinery is the list in the preceding example, the result is [#balls:3, #gears:6, #ramps:8].
Be sure to use only the @ symbol when navigating between Director movies or changing the source of a linked media cast member. The @ symbol does not work when the Fileio Xtra extension or other functions are used outside those available within Director. You can build on this pathname to specify folders that are one or more levels above or below the current movie’s folder. Keep in mind that the @ portion represents the current movie’s location, not necessarily the location of the projector.
and Usage -- Lingo syntax logicalExpression1 and logicalExpression2 // JavaScript syntax logicalExpression1 && logicalExpression2 Description Logical operator; determines whether both logicalExpression1 and logicalExpression2 are TRUE (1), or whether either or both expressions are FALSE (0). The precedence level of this logical operator is 4.
The contains comparison operator is useful for checking whether the user types a specific character or string of characters. You can also use the contains operator to search one or more fields for specific strings of characters.
// JavaScript syntax put(7 % 4); The result is 3. The following handler sets the ink effect of all odd-numbered sprites to copy, which is the ink effect specified by the number 0. First the handler checks whether the sprite in the variable mySprite is an odd-numbered sprite by dividing the sprite number by 2 and then checking whether the remainder is 1. If the remainder is 1, the result for an odd-numbered number, the handler sets the ink effect to copy.
not Usage -- Lingo syntax not logicalExpression // JavaScript syntax ! logicalExpression Description Operator; performs a logical negation on a logical expression. This is the equivalent of making a TRUE value FALSE, and making a FALSE value TRUE. It is useful when testing to see if a certain known condition is not the case. This logical operator has a precedence level of 5.
or Usage -- Lingo syntax logicalExpression1 or logicalExpression2 // JavaScript syntax logicalExpression1 || logicalExpression2 Description Operator; performs a logical OR operation on two or more logical expressions to determine whether any expression is TRUE. This is a logical operator with a precedence level of 4.
starts Usage -- Lingo syntax string1 starts string2 // JavaScript syntax string1.indexOf(string2) == 0; Description Operator; compares to determines whether string1 starts with string2 (TRUE or 1) or not (FALSE or 0). The string comparison is not sensitive to case or diacritical marks; a and Å are considered to be the same. This is a comparison operator with a precedence level of 1.
CHAPTER 14 Properties This section provides an alphabetical list of all the properties available in Macromedia Director MX 2004. _global Usage -- Lingo syntax _global // JavaScript syntax _global; Description Top-level property; provides a reference to the Global object, which stores all global variables. Read-only. All global variables are accessible to both Lingo and JavaScript syntax.
Description Top-level property; provides a reference to the Key object, which is used to monitor a user’s keyboard activity. Read-only. Example This statement sets the variable objKey to the _key property: -- Lingo syntax objKey = _key // JavaScript syntax var objKey = _key; This statement uses the _key property directly to access the value of the key property: -- Lingo syntax theKey = _key.key // JavaScript syntax var theKey = _key.
_movie Usage -- Lingo syntax _movie // JavaScript syntax _movie; Description Top-level property; provides a reference to the Movie object, which represents the currently active movie within the Director player, and provides access to properties and methods that are available on a movie level. Read-only.
_player Usage -- Lingo syntax _player // JavaScript syntax _player; Description Top-level property; provides a reference to the Player object, which manages and executes all movies, including movies in a window (MIAWs). Read-only.
This statement uses the _sound property directly to access the soundLevel property: -- Lingo syntax theLevel = _sound.soundLevel // JavaScript syntax var theLevel = _sound.soundLevel; See also Sound _system Usage -- Lingo syntax _system // JavaScript syntax _system; Description Top-level property; provides a reference to the System object, which provides access to system and environment information, including system level methods. Read-only.
Example These statements display movie information in the Message window. -- Lingo syntax trace(_movie.aboutInfo) // JavaScript syntax trace(_movie.aboutInfo); See also copyrightInfo (Movie), Movie actionsEnabled Usage -- Lingo syntax memberOrSpriteObjRef.actionsEnabled // JavaScript syntax memberOrSpriteObjRef.actionsEnabled; Description Cast member property and sprite property; controls whether the actions in Macromedia Flash content are enabled (TRUE, default) or disabled (FALSE).
active3dRenderer Usage -- Lingo syntax _movie.active3dRenderer // JavaScript syntax _movie.active3dRenderer; Description Movie property; Indicates the renderer currently in use by the movie for drawing 3D sprites. This property is equivalent to the getRendererServices().renderer property. Read-only. The possible values of the active3dRenderer property are #openGL, #directX7_0, #directX5_2, and #software.
Example These statements assign the selected cast members in the most recently selected cast to the variable selectedMembers: -- Lingo syntax castLibOfInterest = _player.activeCastLib selectedMembers = castLib(castLibOfInterest).selection // JavaScript syntax var castLibOfInterest = _player.activeCastLib; var selectedMembers = castLib(castLibOfInterest).selection; See also Player, selection activeWindow Usage -- Lingo syntax _player.activeWindow // JavaScript syntax _player.
} } See also Player actorList Usage -- Lingo syntax _movie.actorList // JavaScript syntax _movie.actorList; Description Movie property; a list of child objects that have been explicitly added to this list. Read/write. Objects in actorList receive a stepFrame message each time the playhead enters a frame. To add an object to the actorList, use _movie.actorList.append(newScriptObjRef). The object’s stepFrame handler in its parent or ancestor script will then be called automatically at each frame advance.
alertHook Usage -- Lingo syntax _player.alertHook // JavaScript syntax _player.alertHook; Description Player property; specifies a parent script that contains the alertHook handler. Read/write. Use alertHook to control the display of alerts about file errors or script errors. When an error occurs and a parent script is assigned to alertHook, Director runs the alertHook handler in the parent script.
// JavaScript syntax function prepareMovie() { _player.alertHook = alert("Error type", "Error message"); } // alert handler function alert(err, msg) { member("Output").text = err + " " + msg; return 1; } See also alertHook, Player, safePlayer alignment Usage -- Lingo syntax memberObjRef.alignment // JavaScript syntax memberObjRef.alignment; Description Cast member property; determines the alignment used to display characters within the specified cast member.
allowCustomCaching Usage -- Lingo syntax _movie.allowCustomCaching // JavaScript syntax _movie.allowCustomCaching; Description Movie property; will contain information regarding a private cache in future versions of Director. Read/write. This property defaults to TRUE. See also allowGraphicMenu, allowSaveLocal, allowTransportControl, allowVolumeControl, allowZooming, Movie allowGraphicMenu Usage -- Lingo syntax _movie.allowGraphicMenu // JavaScript syntax _movie.
This property defaults to TRUE. See also allowCustomCaching, allowGraphicMenu, allowTransportControl, allowVolumeControl, allowZooming, Movie allowTransportControl Usage -- Lingo syntax _movie.allowTransportControl // JavaScript syntax _movie.allowTransportControl; Description Movie property; this property is provided to allow for enhancements in future versions of Shockwave Player. Read/write. This property defaults to TRUE.
allowZooming Usage -- Lingo syntax _movie.allowZooming // JavaScript syntax _movie.allowZooming; Description Movie property; determines whether the movie may be stretched or zoomed by the user when playing back in Shockwave Player and ShockMachine. Read/write. Set this property to FALSE to prevent users from changing the size of the movie in browsers and ShockMachine. The property defaults to TRUE.
For example, if the color of the ambient light is rgb(255, 255, 255) and the value of the ambient property of the shader is rgb(255, 0, 0), the shader will reflect all of the red component of the light that the shader’s colors can reflect. However, it will reflect none of the blue and green components of the light, regardless of the colors of the shader. In this case, if there are no other lights in the scene, the blue and green colors of the shader will reflect no light, and will appear black.
For child objects, the ancestor property is usually assigned in the on new handler within the parent script. Sending a message to a child object that does not have a defined handler forwards that message to the script defined by the ancestor property. If a behavior has an ancestor, the ancestor receives mouse events such as mouseDown and mouseWithin. The ancestor property lets you change behaviors and properties for a large group of objects with a single command.
angle (3D) Usage member(whichCastmember).modelResource(whichModelResource).\ emitter.angle Description 3D emitter property; describes the area into which the particles of a particle system are emitted. A particle system is a model resource whose type is #particle. The primary direction of particle emission is the vector set by the emitter’s direction property.
angleCount Usage -- Lingo syntax dvdObjRef.angleCount // JavaScript syntax dvdObjRef.angleCount; Description DVD property; returns the number of available camera angles in the current title. Read-only. The returned value is an integer that can range from 1 to 9. Example This statement returns the number of available camera angles: -- Lingo syntax put(member(12).angleCount) // JavaScript syntax put(member(12).angleCount); -- 2 // 2 See also DVD animationEnabled Usage member(whichCastmember).
Description Cast member property; controls whether a text, Vector shape, or Flash cast member is rendered using anti-aliasing to produce high-quality rendering, but possibly slower playback of the movie. The antiAlias property is TRUE by default. For vector shapes, TRUE is the equivalent of the #high quality setting for a Flash asset, and FALSE is the equivalent of #low. The antiAlias property may also be used as a sprite property only for Vector shape sprites. This property can be tested and set.
Example This Lingo checks whether the currently running 3D renderer for sprite 2 supports anti-aliasing with the antiAliasingSupported property. If anti-aliasing is supported, the second statement turns on anti-aliasing for the sprite with the antiAliasingEnabled property. if sprite(2).antiAliasingSupported = TRUE then sprite(2).antiAliasingEnabled = TRUE end if See also antiAliasingSupported, renderer, rendererDeviceList antiAliasingSupported Usage sprite(whichSprite).
appearanceOptions Usage -- Lingo syntax windowObjRef.appearanceOptions // JavaScript syntax windowObjRef.appearanceOptions; Description Window property; specifies a list of properties that stores the appearance options of a window. Read/write. The property list contains the following properties. Property Description #mask Specifies the 1-bit cast member to use as a mask for the window. #border Specifies the type of border for the window. This property can be one of three values: • #none.
See also displayTemplate, titlebarOptions, visible, Window applicationName Usage -- Lingo syntax _player.applicationName // JavaScript syntax _player.applicationName; Description Player property; specifies the name of the running copy of the Director application during authoring, or the name of a projector file during runtime. Read-only. The property value is a string. Shockwave Player does not support this property. Example This statement displays the name of the Director application, Director.exe.
Example This statement displays the pathname for the folder that contains the Director application. -- Lingo syntax put(_player.applicationPath) // JavaScript syntax put(_player.applicationPath); This statement opens the movie Sunset Boulevard in a window (on a Windows machine): -- Lingo syntax window(_player.applicationPath & "\Film Noir\Sunset Boulevard").open() // JavaScript syntax window(_player.applicationPath + "\Film Noir\\Sunset Boulevard").
The default value for this property is vector(1.0, 0.0, 0.0). Example This statement sets the attenuation property of the light named HouseLight to the vector (.5, 0, 0), darkening it slightly. member("3d world").light("HouseLight").attenuation = \ vector(.5, 0, 0) See also color (light) attributeName Usage XMLnode.attributeName[ attributeNumber ] Description XML property; returns the name of the specified child node of a parsed XML document. Example Beginning with the following XML:
here is some text This Lingo returns the value of the first attribute of the tag called tagName: put gParserObject.child[1].child[1].attributeValue[1] -- "val1" See also attributeName audio (DVD) Usage -- Lingo syntax dvdObjRef.audio // JavaScript syntax dvdObjRef.audio; Description DVD property. Determines whether audio is enabled (TRUE, default) or not (FALSE). Read/write. Example This statement disables audio: -- Lingo syntax member(14).audio = 0 // JavaScript syntax member(14).
Example The following examples show that the audio properties for sprite 2 and the cast member Real is set to TRUE, which means that the audio portion of the RealMedia stream will be played. -- Lingo syntax put(sprite(2).audio) -- 1 put(member("Real").audio) -- 1 // JavaScript syntax put(sprite(2).audio); // 1 put(member("Real").
audioChannelCount Usage -- Lingo syntax dvdObjRef.audioChannelCount // JavaScript syntax dvdObjRef.audioChannelCount; Description DVD property; returns the number of audio channels. Read-only. Example This statement returns the number of audio channels: -- Lingo syntax member(1).audioChannelCount // JavaScript syntax member(1).audioChannelCount; See also DVD audioExtension Usage -- Lingo syntax dvdObjRef.audioExtension // JavaScript syntax dvdObjRef.audioExtension; Description DVD property.
audioFormat Usage -- Lingo syntax dvdObjRef.audioFormat // JavaScript syntax dvdObjRef.audioFormat; Description DVD property. Returns a symbol that indicates the format (encoding mode) of an audio stream. Read-only. Possible returned values are as follows: Symbol Description #AC3 The audio format is Dolby AC-3. #MPEG1 The audio format is MPEG-1. #MPEG1DRC The audio format is MPEG-1 with dynamic range control. #MPEG2 The audio format is MPEG-2.
audioStream Usage -- Lingo syntax dvdObjRef.audioStream // JavaScript syntax dvdObjRef.audioStream; Description DVD property. Returns the currently active audio stream. Read/write. Valid values range from 1 to 8. See also DVD audioStreamCount Usage -- Lingo syntax dvdObjRef.audioStreamCount // JavaScript syntax dvdObjRef.audioStreamCount; Description DVD property; returns the number of available audio streams in the current title. Read-only. The number of available audio streams ranges from 1 to 8.
Example This statement sets the auto property of the lod modifier of the model named Spaceship to TRUE. The modifier will automatically set the model’s level of detail. member("3D World").model("Spaceship").lod.auto = TRUE See also lod (modifier), bias, level autoblend Usage member(whichCastmember).model(whichModel).\ keyframePlayer.autoblend member(whichCastmember).model(whichModel).bonesPlayer.
Example This statement sets the autoCameraPosition property of the cast member named Headline to FALSE. When the cast member is displayed in 3D mode, the camera will not be positioned automatically. member("Headline").autoCameraPosition = FALSE See also displayMode autoMask Usage member(whichCursorCastMember).
autoTab Usage -- Lingo syntax memberObjRef.autoTab // JavaScript syntax memberObjRef.autoTab; Description Cast member property; determines the effect that pressing the Tab key has on the editable field or text cast member specified by whichCastMember. The property can be made active (TRUE) or inactive (FALSE). Tabbing order depends on sprite number order, not position on the Stage.
back Usage member(whichCastmember).modelResource(whichModelResource).back Description 3D #box model resource property; indicates whether the side of the box intersected by its +Z axis is sealed (TRUE) or open (FALSE). The default value for this property is TRUE. Example This statement sets the back property of the model resource named Crate to FALSE, meaning the back of this box will be open. member("3D World").modelResource("Crate").
Example The following statement sets the variable oldColor to the background color of sprite 5: -- Lingo syntax oldColor = sprite(5).backColor // JavaScript syntax var oldColor = sprite(5).backColor; The following statement randomly changes the background color of a random sprite between sprites 11 and 13 to color number 36: -- Lingo syntax sprite(10 + random(3)).backColor = 36 // JavaScript syntax sprite(10 + random(3)).backColor = 36; See also Sprite backdrop Usage sprite(whichSprite).camera{(index)}.
rotation (backdrop and overlay) is the amount by which the backdrop is rotated about its regPoint. regPoint (3D) indicates the registration point of the backdrop. blend (3D) indicates the opacity of the backdrop. count (3D) indicates the number of items in the camera’s list of backdrops. Use the following commands to create and remove backdrops: addBackdrop creates a backdrop from a texture and adds it to the end of the camera’s list of backdrops.
Description Movie property; determines whether the computer automatically beeps when the user clicks on anything except an active sprite (TRUE), or not (FALSE, default). Read/write. Scripts that set beepOn should be placed in frame or movie scripts. Example This statement sets beepOn to TRUE: -- Lingo syntax _movie.beepOn = TRUE // JavaScript syntax _movie.beepOn = true; This statement sets beepOn to the opposite of its current setting: -- Lingo syntax _movie.beepOn = not(_movie.
See also bevelType, extrude3D, displayMode bevelType Usage member(whichTextCastmember).bevelType member(which3DCastmember).modelResource(whichModelResource).\ bevelType Description 3D text property; indicates the style of beveling applied to the 3D text. For text cast members, this is a member property. For extruded text in a 3D cast member, this is a model resource property.
// JavaScript syntax window("Animals").bgColor = color(255, 153, 0); See also Window bgColor (Sprite, 3D Member) Usage sprite(whichSpriteNumber).bgColor the bgColor of sprite whichSpriteNumber the bgColor of the stage (the stage).bgColor member(which3dMember).bgcolor Description Sprite property, system property, and 3D cast member property; determines the background color of the sprite specified by whichSprite, the color of the Stage, or the background color of the 3D cast member.
The #lod modifier can only be added to models created outside of Director in 3D modeling programs. The value of the type property of the model resources used by these models is #fromFile. The modifier cannot be added to primitives created within Director. Example This statement sets the bias property of the lod modifier of the model named Spaceship to 10.
Example This behavior outputs the bit rate of an SWA cast member when the sprite is first encountered. -- Lingo syntax property spriteNum on beginSprite (me) memName = sprite(spriteNum).member.name put("The bitRate of member"&&memName&&"is"&&member(memName).bitRate) end // JavaScript syntax function beginSprite() { var memName = sprite(spriteNum).member.name; put("The bitRate of member " + memName +" is " + member(memName).bitRate); } bitsPerSample Usage -- Lingo syntax memberObjRef.
Description 3D backdrop, overlay, and #standard shader property; indicates the opacity of the backdrop, overlay, or shader. Setting the blend property of a shader will have no effect unless the shader’s transparent property is set to TRUE. The range of this property is 0 to 100, and the default value is 100. Example This statement sets the blend property of the shader for the model named Window to 80. If the transparent property of Window’s shader is set to TRUE, the model will be slightly transparent.
blendConstant Usage member(whichCastmember).shader(whichShader).blendConstant member(whichCastmember).model(whichModel).shader.blendConstant member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendConstant Description 3D #standard shader property; indicates the blending ratio used for the first texture layer of the shader. If the shader’s useDiffuseWithTexture property is set to TRUE, the texture blends with the color set by the shader’s diffuse property.
The blendConstantList property works only when the blendSource property of the corresponding texture layer is set to #constant. The range of this property is 0 to 100; the default is 50. Example In this example, the shader list of the model named MysteryBox contains six shaders. This statement shows the blendConstant property of each of the textures used by the second shader. This property is affected by the settings of the blendFunction, blendFunctionList, blendSource, and blendSourceList properties.
blendFunction Usage member(whichCastmember).shader(whichShader).blendFunction member(whichCastmember).model(whichModel).shader.blendFunction member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendFunction Description 3D #standard shader property; indicates the type of blending used by the first texture layer of the shader. If the shader’s useDiffuseWithTexture property is set to TRUE, the texture blends with the color set by the shader’s diffuse property.
blendFunctionList Usage member(whichCastmember).shader(whichShader).\ blendFunctionList{[index]} member(whichCastmember).model(whichModel).shader.\ blendFunctionList{[index]} member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendFunctionList{[index]} Description 3D #standard shader property; a linear list that indicates the manner in which each texture layer blends with the texture layer below it. The shader’s texture list and blend function list both have eight index positions.
blendLevel Usage sprite(whichSpriteNumber).blendLevel the blendLevel of sprite whichSpriteNumber Description Sprite property; allows the current blending value of a sprite to be set or accessed. The possible range of values is from 0 to 255. This differs from the Sprite Inspector, which shows values in the range 0 to 100. The results are the same, the scales simply differ. This property is the equivalent of the blend sprite property. Example sprite(3).
blendSource Usage member(whichCastmember).shader(whichShader).blendSource member(whichCastmember).model(whichModel).shader.blendSource member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendSource Description 3D #standard shader property; indicates whether blending of the first texture layer in the shader’s texture list is based on the texture’s alpha information or a constant ratio.
Description 3D #standard shader property; indicates whether blending of a texture layer with the texture layers below it is based on the texture’s alpha information or a constant ratio. The shader’s texture list and the blend source list both have eight index positions. Each index position in the blend source list controls blending for the texture at the corresponding index position in the texture list.
Example This statement sets the length of the transition between motions in the playlist of the modifier for the model named Alien5 to 1200 milliseconds. member("newaliens").model("Alien5").keyframePlayer.\ blendTime = 1200 See also autoblend, blendFactor bone Usage member(whichCastmember).modelResource(whichModelResource).\ bone.count member(whichCastmember).model(whichModel).bonesPlayer.\ bone[index].transform member(whichCastmember).model(whichModel).bonesPlayer.\ bone[index].
playRate (3D) is a number that is multiplied by the scale parameter of the play() or queue() command to determine the playback speed of the motion. playlist.count (3D) rootLock returns the number of motions currently queued in the playlist. indicates whether the translational component of the motion is used or ignored. currentLoopState indicates whether the motion plays once or repeats continuously.
border Usage -- Lingo syntax memberObjRef.border // JavaScript syntax memberObjRef.border; Description Field cast member property; indicates the width, in pixels, of the border around the specified field cast member. Example This statement makes the border around the field cast member Title 10 pixels wide. --Lingo syntax member("Title").border = 10 // JavaScript syntax member("Title").border = 10; bottom Usage -- Lingo syntax spriteObjRef.bottom // JavaScript syntax spriteObjRef.
bottom (3D) Usage member(whichCastmember).modelResource(whichModelResource).bottom Description 3D #box model resource property; indicates whether the side of the box intersected by its -Y axis is sealed (TRUE) or open (FALSE). The default value for this property is TRUE. Example This statement sets the bottom property of the model resource named GiftBox to TRUE, meaning the bottom of this box will be closed. member("3D World").modelResource("GiftBox").
Example This statement sets the bottomRadius property of the model resource named Tube to 38.5. member("3D World").modelResource("Tube").bottomRadius = 38.5 See also topRadius, bottomCap bottomSpacing Usage -- Lingo syntax chunkExpression.bottomSpacing // JavaScript syntax chunkExpression.bottomSpacing; Description Text cast member property; enables you to specify additional spacing applied to the bottom of each paragraph in the chunkExpression portion of the text cast member.
Example This statement sets the boundary property of the inker modifier applied to the model named Box to TRUE. Lines will be drawn at the edges of the surface of the model. member("shapes").model("Box").inker.boundary = TRUE See also lineColor, lineOffset, silhouettes, creases boundingSphere Usage member(whichCastmember).model(whichModel).boundingSphere member(whichCastmember).group(whichGroup).boundingSphere member(whichCastmember).light(whichLight).boundingSphere member(whichCastmember).
Example This statement makes the drop shadow of field cast member Title 10 pixels wide. --Lingo syntax member("Title").boxDropShadow = 10 // JavaScript syntax member("Title").boxDropShadow = 10; boxType Usage -- Lingo syntax memberObjRef.boxType // JavaScript syntax memberObjRef.boxType; Description Cast member property; determines the type of text box used for the specified cast member. The possible values are #adjust, #scroll, #fixed, and #limit.
broadcastProps Usage -- Lingo syntax memberObjRef.broadcastProps // JavaScript syntax memberObjRef.broadcastProps; Description Cast member property; controls whether changes made to a Flash or Vector shape cast member are immediately broadcast to all of its sprites currently on the Stage (TRUE) or not (FALSE). When this property is set to FALSE, changes made to the cast member are used only as defaults for new sprites and don’t affect sprites on the Stage.
Example This startMovie handler sets up a Flash movie cast member for streaming and then sets its bufferSize property. -- Lingo syntax on startMovie member.("Flash Demo").preload = FALSE member.("Flash Demo").bufferSize = 65536 end // JavaScript syntax function startMovie() { member.("Flash Demo").preload = 0; member.("Flash Demo").bufferSize = 65536; } See also bytesStreamed, preLoadRAM, stream(), streamMode buttonCount Usage -- Lingo syntax dvdObjRef.buttonCount // JavaScript syntax dvdObjRef.
Example This handler accepts a sprite reference and toggles the sprite’s buttonsEnabled property on or off. -- Lingo syntax on ToggleButtons(whichSprite) sprite(whichSprite).buttonsEnabled = \ not(sprite(whichSprite).buttonsEnabled) end // JavaScript syntax function ToggleActions(whichSprite) { sprite(whichSprite).buttonsEnabled = !(sprite(whichSprite).buttonsEnabled); } See also actionsEnabled buttonStyle Usage -- Lingo syntax _movie.buttonStyle // JavaScript syntax _movie.
This statement remembers the current setting of the buttonStyle property by putting the current buttonStyle value in the variable buttonStyleValue: -- Lingo syntax buttonStyleValue = _movie.buttonStyle // JavaScript syntax var buttonStyleValue = _movie.buttonStyle; See also Movie buttonType Usage member(whichCastMember).buttonType the buttonType of member whichCastMember Description Button cast member property; indicates the specified button cast member’s type.
-- Lingo syntax on fetchMovie(whichFlashMovie) repeat while member(whichFlashMovie).percentStreamed < 100 stream(member(whichFlashMovie)) put("Number of bytes streamed:" && member(whichFlashMovie).bytesStreamed) end repeat end // JavaScript syntax function fetchMovie(whichFlashMovie) var i = member(whichFlashMovie).percentStreamed; while(i < 100) { stream(member(whichFlashMovie)); trace( "Number of bytes streamed: " + member(whichFlashMovie).
Cameras are stored in the camera palette of the cast member. Use the newCamera and deleteCamera commands to create and delete cameras in a 3D cast member. The camera property of a sprite is the first camera in the list of cameras of the sprite. The camera referred to by sprite(whichSprite).camera is the same as sprite(whichSprite).camera(1). Use the addCamera and deleteCamera commands to build the list of cameras in a 3D sprite.
cameraRotation Usage member(whichCastMember).cameraRotation sprite(whichSprite).cameraRotation Description 3D cast member and sprite property; indicates the position of the default camera. The default value of this property is vector(0, 0, 0). This is the rotation of the default camera in a newly created 3D cast member. Example This statement shows that the rotation of the default camera of the cast member named Babyland is the vector (82.6010, -38.8530, -2.4029). member("babyland").
castLibNum Usage -- Lingo syntax memberObjRef.castLibNum // JavaScript syntax memberObjRef.castLibNum; Description Member property; determines the number of the cast library that a cast member belongs to. Read-only. Example This statement determines the number of the cast to which cast member Jazz is assigned. -- Lingo syntax put(member("Jazz").castLibNum) // JavaScript syntax put(member("Jazz").
Example This command sets a series of four cast members for the animated color cursor cast member named myCursor. -- Lingo syntax member("myCursor").castmemberList = \ [member(1), member(2), member(1, 2), member(2, 2)] // JavaScript syntax member("myCursor").castmemberList = list(member(1), member(2), member(1, 2), member(2, 2)); center Usage member(whichCastMember).center the center of member whichCastMember Description Cast member property; interacts with the crop cast member property.
centerRegPoint Usage -- Lingo syntax memberObjRef.centerRegPoint // JavaScript syntax memberObjRef.centerRegPoint; Description Flash, vector shape, and bitmap cast member property; automatically centers the registration point of the cast member when you resize the sprite (TRUE, default); or repositions the registration point at its current point value when you resize the sprite, set the defaultRect property, or set the regPoint property (FALSE). This property can be tested and set.
Place the statement that includes this property in the movie that precedes the movie you want it to affect. This property is useful for checking the Stage location before a movie plays from a projector. Note: Be aware that behavior while playing back in a projector differs between Windows and Macintosh systems. Settings selected during creation of the projector may override this property. Example This statement sends the movie to a specific frame if the Stage is not centered: -- Lingo syntax if (_movie.
channelCount Usage -- Lingo syntax soundChannelObjRef.channelCount // JavaScript syntax soundChannelObjRef.channelCount; Description Sound Channel property; determines the number of channels in the currently playing or paused sound in a given sound channel. Read-only. This property is useful for determining whether a sound is in monaural or in stereo. Example This statement determines the number of channels in the sound cast member, Jazz. -- Lingo syntax put(member("Jazz").
See also DVD 684 Chapter 14: Properties
chapterCount Usage -- Lingo syntax dvdObjRef.chapterCount // JavaScript syntax dvdObjRef.chapterCount; Description DVD property; returns the number of available chapters in a title. Read-only. Example This statement returns the number of chapters in the current title: -- Lingo syntax trace (member(1).chapterCount) -- 17 // JavaScript syntax trace (member(1). chapterCount); // 17 See also chapterCount(), DVD characterSet Usage -- Lingo syntax memberObjRef.
charSpacing Usage -- Lingo syntax chunkExpression.charSpacing // JavaScript syntax chunkExpression.charSpacing; Description Text cast member property; enables specifying any additional spacing applied to each letter in the chunkExpression portion of the text cast member. A value less than 0 indicates less spacing between letters. A value greater than 0 indicates more spacing between letters. The default value is 0, which results in default spacing between letters.
Example This handler turns off any items that are checked in the custom menu specified by the argument theMenu. For example, unCheck ("Format") turns off all the items in the Format menu. on unCheck theMenu set n = the number of menuItems of menu theMenu repeat with i = 1 to n set the checkMark of menuItem i of menu theMenu to FALSE end repeat end unCheck See also installMenu, enabled, name (menu item property), number (menu items), script, menu child (3D) Usage member(whichCastmember).
Example Beginning with the following XML: element 2 element 3 here is some text This Lingo returns the name of the first child node of the preceding XML: put gParserObject.child[1].name -- "e1" chunkSize Usage member(whichCastMember).
Example This statement prevents Director from erasing past images of the view from the camera. Models in motion will appear to smear across the stage. sprite(1).camera.colorBuffer.clearAtRender = 0 See also clearValue clearValue Usage member(whichCastmember).camera(whichCamera).colorBuffer\ .clearValue sprite(whichSprite).camera{(index)}.colorBuffer.clearValue Description 3D property; specifies the color used to clear out the color buffer if colorBuffer.clearAtRender is set to TRUE.
// JavaScript syntax function mouseDown() { put(_mouse.clickLoc); } If the click were 50 pixels from the left end of the Stage and 100 pixels from the top of the Stage, the Message window would display the following: point(50, 100) See also clickOn, Mouse clickMode Usage -- Lingo syntax memberOrSpriteObjRef.clickMode // JavaScript syntax memberOrSpriteObjRef.
Example This script checks to see if the sprite, which is specified with an ink effect of Background Transparent, is currently set to be rendered direct to Stage. If the sprite is not rendered direct to Stage, the sprite’s clickMode is set to #opaque. Otherwise (because ink effects are ignored for Flash movie sprites that are rendered direct to Stage), the sprite’s clickMode is set to #boundingBox. -- Lingo syntax property spriteNum on beginSprite me if sprite(spriteNum).
Example This statement checks whether sprite 7 was the last active sprite clicked: -- Lingo syntax if (_mouse.clickOn = 7) then _player.alert("Sorry, try again.") end if // JavaScript syntax if (_mouse.clickOn = 7) { _player.alert("Sorry, try again."); } This statement sets the foreColor property of the last active sprite that was clicked to a random color: -- Lingo syntax sprite(_mouse.clickOn).foreColor = (random(255) - 1) // JavaScript syntax sprite(_mouse.clickOn).
Example These statements try to set closedCaptions to TRUE, and display an alert if they cannot be enabled: -- Lingo syntax member(3).closedCaptions = TRUE if (member(3).closedCaptions = FALSE) then _player.alert("Closed captions cannot be enabled.") end if // JavaScript syntax member(3).closedCaptions = true if (member(3).closedCaptions == false) { _player.alert("Closed captions cannot be enabled."); } Currently unsupported on Macintosh. See also DVD collision (modifier) Usage member(whichCastmember).
collisionData Usage on myHandlerName me, collisionData Description 3D data object; sent as an argument with the #collideWith and #collideAny events to the handler specified in the registerForEvent, registerScript, and setCollisionCallback commands. The collisionData object has these properties: modelA is one of the models involved in the collision. modelB is the other model involved in the collision. pointOfContact is the world position of the collision.
collisionNormal Usage collisionData.collisionNormal Description 3D collisionData property; a vector indicating the direction of the collision. The collisionData object is sent as an argument with the #collideWith and #collideAny events to the handler specified in the registerForEvent, registerScript, and setCollisionCallback commands. The #collideWith and #collideAny events are sent when a collision occurs between models to which collision modifiers have been added.
color() Usage color(#rgb, redValue, greenValue, blueValue) color(#paletteIndex, paletteIndexNumber) rgb(rgbHexString) rgb(redValue, greenValue, blueValue) paletteIndex(paletteIndexNumber) Description Function and data type; determines an object’s color as either RGB or 8-bit palette index values. These are the same values as those used in the color member and color sprite properties, the bgColor member and bgColor sprite properties, and the bgColor Stage property.
put newColorObj -- paletteIndex(45) This statement changes the color of the fourth through the seventh characters of text member myQuotes: member("myQuotes").char[4..7].color = rgb(200, 150, 75) This Lingo displays the color of sprite 6 in the Message window, and then sets the color of sprite 6 to a new RGB value: put sprite(6).color -- rgb( 255, 204, 102 ) sprite(6).color = rgb(122, 98, 210) Note: Setting the paletteIndex value of an RGB color type changes colorType to paletteIndex.
See also fog colorBufferDepth Usage getRendererServices().colorBufferDepth Description 3D rendererServices property; indicates the color precision of the hardware output buffer of the user’s system. The value is either 16 or 32, depending on the user’s hardware settings. This property can be tested but not set. Example This statement shows that the colorBufferDepth value of the user’s video card is 32. put getRendererServices().
If you try to set a monitor’s color depth to a value that monitor does not support, the monitor’s color depth doesn’t change. On computers with more than one monitor, the colorDepth property refers to the monitor displaying the Stage. If the Stage spans more than one monitor, the colorDepth property indicates the greatest depth of those monitors; colorDepth tries to set all those monitors to the specified depth.
colorList Usage member(whichCastmember).modelResource(whichModelResource).\ colorList member(whichCastmember).modelResource(whichModelResource).\ colorList[index] member(whichCastmember).model(whichModel).meshdeform.mesh\ [meshIndex].colorList member(whichCastmember).model(whichModel).meshdeform.mesh\ [meshIndex].colorList[index] Description 3D property; allows you to get or set every color used in a mesh. This command is accessible only for model resources of the type #mesh.
member(8,2).modelResource("ThermoSystem").colorRange.start = \ rgb(255,0,0) member(8,2).modelResource("ThermoSystem").colorRange.end = \ rgb(0,0,255) See also emitter, blendRange, sizeRange colors Usage member(whichCastmember).modelResource(whichModelResource).\ face[faceIndex].colors Description 3D face property; a linear list of three integers indicating which index positions of the model resource’s color list to use for the three vertices of the face. The color list is a linear list of rgb values.
See also face, vertices, vertices, flat 702 Chapter 14: Properties
colorSteps Usage member(whichCastmember).model(whichModel).toon.colorSteps member(whichCastmember).model(whichModel).shader.colorSteps member(whichCastmember).shader(whichShader).colorSteps Description 3D toon modifier and painter shader property; the maximum number of colors available for use by the toon modifier or painter shader. The value of this property can be 2, 4, 8, or 16. If you set the value of colorSteps to any other number, it will be rounded to one of these. The default value is 2.
Example These statements pause a projector when the playhead enters a frame and the user is pressing Control+A (Windows) or Command+A (Macintosh). -- Lingo syntax on enterFrame if (_key.commandDown and _key.key = "a") then _movie.go(_movie.frame) end if end // JavaScript syntax function enterFrame() { if (_key.commandDown && _key.key == "a") { _movie.go(_movie.frame); } } See also Key, key comments Usage -- Lingo syntax memberObjRef.comments // JavaScript syntax memberObjRef.
compressed Usage member(whichCastmember).texture(whichTexture).compressed Description 3D texture property; indicates whether the source cast member of the texture is compressed (TRUE) or not (FALSE). The value of the compressed property changes automatically from TRUE to FALSE when the texture is needed for rendering. It can be set to FALSE to decompress the texture at an earlier time. It can be set to TRUE to release the decompressed representation from memory.
Example This statement removes a constraint sprite property: -- Lingo syntax sprite(5).constraint = 0 // JavaScript syntax sprite(5).constraint = 0; This statement constrains sprite (i + 1) to the boundary of sprite 14: -- Lingo syntax sprite(i + 1).constraint = 14 // JavaScript syntax sprite(i + 1).constraint = 14; This statement checks whether sprite 3 is constrained and activates the handler showConstraint if it is: -- Lingo syntax if (sprite(3).
Example This on keyDown handler checks whether the pressed key is the Control key, and if it is, the handler activates the on doControlKey handler. The argument (_key.key) identifies which key was pressed in addition to the Control key. -- Lingo syntax on keyDown if (_key.controlDown) then doControlKey(_key.key) end if end on doControlKey(theKey) trace("The " & theKey & " key is down") end // JavaScript syntax function keyDown() { if (_key.controlDown) { doControlKey(_key.
Example This statement causes the QuickTime cast member Demo to display its controller. Dot syntax: member("Demo").controller = 1 Verbose syntax: set the controller of member "Demo" to 1 See also directToStage copyrightInfo (Movie) Usage -- Lingo syntax _movie.copyrightInfo // JavaScript syntax _movie.copyrightInfo; Description Movie property; enters a string during authoring in the Movie Properties dialog box. This property is provided to allow for enhancements in future versions of Shockwave Player.
Example This statement tells Director to display the copyright information for the Shockwave Audio file SWAfile in a field cast member named Info Display. -- Lingo syntax whatState = member("SWAfile").state if whatState > 1 AND whatState < 9 then put(member("Info Display") = member("SWAfile").copyrightInfo) end if // JavaScript syntax var whatState = member("SWAfile").state; if (whatState > 1 && whatState < 9) { put(member("Info Display") = member("SWAfile").copyrightInfo); } count Usage list.
count (3D) Usage member(whichCastmember).light.count member(whichCastmember).camera.count member(whichCastmember).modelResource(whichModelResource).\ bone.count member(whichCastmember).model.count member(whichCastmember).group.count member(whichCastmember).shader.count member(whichCastmember).texture.count member(whichCastmember).modelResource.count member(whichCastmember).motion.count member(whichCastmember).light.child.count member(whichCastmember).camera.child.count member(whichCastmember).model.child.
This statement shows that the model named Ear is composed of three meshes. put member("Scene").model("Ear").meshdeform.mesh.count -- 3 This statement shows that the first mesh of the model named Ear has two texture layers. put member("Scene").model("Ear").meshdeform.mesh[1].\ textureLayer.
The creases property of the modifier must be set to TRUE for the creaseAngle property to have an effect. CreaseAngle has a range of -1.0 to +1.0. The default setting is 0.01. Example This statement sets the creaseAngle property of the inker modifier applied to the model named Teapot to 0.10. A line will be drawn at all creases in the model that exceed this threshold. This setting will only take effect if the inker modifier’s creases property is set to TRUE. member("shapes").model("Teapot").inker.
Example Although you typically inspect the creationDate property using the Property inspector or the Cast window list view, you can check it in the Message window: -- Lingo syntax put(member(1).creationDate) // JavaScript syntax put(member(1).creationDate); See also Member crop Usage member(whichCastMember).
This property is supported by SoundEdit cast members, QuickTime digital video cast members, and Xtra extension cast members that contain cue points. Xtra extensions that generate cue points at run time may not be able to list cue point names. Example This statement obtains the name of the third cue point of a cast member. -- Lingo syntax put member("symphony").cuePointNames[3] // JavaScript syntax put(member("symphony").
currentLoopState Usage member(whichCastmember).model(whichModel).keyframePlayer.\ currentLoopState member(whichCastmember).model(whichModel).bonesPlayer.\ currentLoopState Description 3D keyframePlayer and bonesPlayer modifier property; indicates whether the motion being executed by the model repeats continuously (TRUE) or plays to the end and is replaced by the next motion in the modifier’s playlist (FALSE).
Example The following handler in a cast member or movie script switches the cast member assigned to the sprite involved in the mouseDown event: -- Lingo syntax on mouseDown sprite(_player.currentSpriteNum).member = member("DownPict") end // JavaScript syntax function mouseDown() { sprite(_player.currentSpriteNum).member = member("DownPict"); } See also Player, spriteNum currentTime (3D) Usage member(whichCastmember).model(whichModel).keyframePlayer.\ currentTime member(whichCastmember).model(whichModel).
currentTime (DVD) Usage -- Lingo syntax dvdObjRef.currentTime // JavaScript syntax dvdObjRef.currentTime; Description DVD property; returns the elapsed time, in milliseconds. Read/write. Example This statement returns the elapsed time: -- Lingo syntax trace (member(1).currentTime) // JavaScript syntax trace (member(1).currentTime); -- 11500 // 11500 This statement sets currentTime to a specific point in the current title: -- Lingo syntax member(1).currentTime = 22000 // JavaScript syntax member(1).
// JavaScript syntax put(sprite(9).currentTime); This statement sets the current time of the QuickTime movie in channel 9 to the value in the variable Poster: -- Lingo syntax sprite(9).currentTime = Poster // JavaScript syntax sprite(9).currentTime = Poster; See also duration (Member) currentTime (RealMedia) Usage -- Lingo syntax memberOrSpriteObjRef.currentTime // JavaScript syntax memberOrSpriteObjRef.
-- Lingo syntax sprite(2).currentTime = 20000 member("Real").currentTime = 20000 // JavaScript syntax sprite(2).currentTime = 20000 member("Real").currentTime = 20000 See also duration (RealMedia, SWA), seek(), mediaStatus (RealMedia, Windows Media) currentTime (Sprite) Usage -- Lingo syntax spriteObjRef.currentTime // JavaScript syntax spriteObjRef.
cursor Usage -- Lingo syntax spriteObjRef.cursor // JavaScript syntax spriteObjRef.cursor; Description Sprite property; determines the cursor used when the pointer is over a sprite. Read/write. This property stays in effect until you turn it off by setting the cursor to 0. Use the cursor property to change the cursor when the mouse pointer is over specific regions of the screen and to indicate regions where certain actions are possible when the user clicks on them.
Value Description 258 Select 259 Bucket 260 Hand 261 Rectangle tool 262 Rounded rectangle tool 263 Circle tool 264 Line tool 265 Rich text tool 266 Text field tool 267 Button tool 268 Check box tool 269 Radio button tool 270 Placement tool 271 Registration point tool 272 Lasso 280 Finger 281 Dropper 282 Wait mouse down 1 283 Wait mouse down 2 284 Vertical size 285 Horizontal size 286 Diagonal size 290 Closed hand 291 No-drop hand 292 Copy (closed hand) 293
Value Description 301 Air brush 302 Zoom in 303 Zoom out 304 Zoom cancel 305 Start shape 306 Add point 307 Close shape 308 Zoom camera 309 Move camera 310 Rotate camera 457 Custom To use custom cursors, set the cursor property to a list containing the cast member to be used as a cursor or to the number that specifies a system cursor.
cursorSize Usage -- Lingo syntax memberObjRef.cursorSize // JavaScript syntax memberObjRef.cursorSize; Description Cursor cast member property; specifies the size of the animated color cursor cast member whichCursorCastMember. Specify size: For cursors up to: 16 16 by 16 pixels 32 32 by 32 pixels Bitmap cast members smaller than the specified size are displayed at full size, and larger ones are scaled proportionally to the specified size. The default value is 32 for Windows and 16 for the Macintosh.
Example This statement displays a sample list of vertices of the third curve of vector shape member SimpleCurves: -- Lingo syntax put(member("SimpleCurves").curve[3]) -- [[#vertex: point(113.0000, 40.0000), #handle1: point(32.0000, 10.0000), \ #handle2: point(-32.0000, -10.0000)], [#vertex: point(164.0000, 56.0000)]] // JavaScript syntax put(member("SimpleCurves").curve[3]); // [[#vertex: point(113.0000, 40.0000), #handle1: point(32.0000, 10.0000), #handle2: point(-32.0000, -10.0000)], [#vertex: point(164.
debugPlaybackEnabled Usage -- Lingo syntax _player.debugPlaybackEnabled // JavaScript syntax _player.debugPlaybackEnabled; Description Player property; in Windows, opens a Message window for debugging purposes in Shockwave and projectors. On the Macintosh, a log file is generated to allow put statements to output data for debugging purposes. Read/write. In Windows, this property does not have any effect when used in the Director application.
Example This statement sets the decayMode property of the fog of the camera Defaultview to #linear. If the fog’s enabled property is set to TRUE, the density of the fog will steadily increase between the distances set by the fog’s near and far properties. If the near property is set to 100 and the far property is set to 1000, the fog will begin 100 world units in front of the camera and gradually increase in density to a distance of 1000 world units in front of the camera. member("3d world").
// JavaScript syntax function setDefaultFlashRect(whichCast, whichRect) { var i = 1; while( i < (castLib(whichCast).member.count) + 1) var tp = member(i, whichCast).type; if (tp = "flash") { member(i, whichCast).defaultRect = whichRect; i++; } } } See also defaultRectMode, flashRect defaultRectMode Usage -- Lingo syntax memberObjRef.defaultRectMode // JavaScript syntax memberObjRef.
-- Lingo syntax on setDefaultRectSize(whichCast) repeat with i = 1 to castLib(whichCast).member.count if member(i, whichCast).type = #flash then member(i, whichCast).defaultRectMode = #fixed member(i, whichCast).defaultRect = rect(0,0,320,240) end if end repeat end // JavaScript syntax function setDefaultRectSize(whichCast) { var i = 1; while( i < (castLib(whichCast).member.count) + 1) var tp = member(i, whichCast).type; if (tp = "flash") { member(i, whichCast).
depth (3D) Usage member(whichCastmember).model(whichModel).sds.depth Description 3D subdivision surfaces (sds) modifier property; specifies the maximum number of levels of resolution that the model can display when using the sds modifier. If the sds modifier’s error and tension settings are low, increasing the depth property will have a more pronounced effect on the model’s geometry.
// JavaScript syntax trace(newImage.depth); This statement displays the color depth of the cast member Shrine in the Message window: -- Lingo syntax put(member("Shrine").depth) // JavaScript syntax put(member("Shrine").depth); depthBufferDepth Usage getRendererServices().depthBufferDepth Description 3D rendererServices property; indicates the precision of the hardware depth buffer of the user’s system. The value is either 16 or 24, depending on the user’s hardware settings.
Example This statement tests the size of the monitors connected to the computer and displays the result in the Message window: -- Lingo syntax put(_system.deskTopRectList) // JavaScript syntax put(_system.deskTopRectList); This handler tells how many monitors are in the current system: -- Lingo syntax on countMonitors return _system.deskTopRectList end // JavaScript syntax function countMonitors() { return _system.deskTopRectList; } See also System diffuse Usage member(whichCastmember).
diffuseColor Usage member(whichCastmember).
digitalVideoTimeScale Usage -- Lingo syntax _player.digitalVideoTimeScale // JavaScript syntax _player.digitalVideoTimeScale; Description Player property; determines the time scale, in units per second, that the system uses to track digital video cast members. Read/write. The digitalVideoTimeScale property can be set to any value you choose.
Example The following statement tests whether the cast member Today’s Events is a QuickTime or AVI (Audio-Video Interleaved) digital video and displays the result in the Message window: put member("Today's Events").digitalVideoType See also QuickTimeVersion() direction Usage member(whichCastmember).modelResource(whichModelResource).\ emitter.direction Description 3D emitter property; a vector that indicates the direction in which the particles of a particle system are emitted.
Example This statement sets the directionalColor property of the cast member named Room to rgb(0, 255, 0). The default directional light of the cast member will be green. This property can also be set in the Property inspector. member("Room").directionalcolor = rgb(0, 255, 0) See also directionalPreset directionalPreset Usage member(whichCastmember).
directToStage Usage -- Lingo syntax memberOrSpriteObjRef.directToStage // JavaScript syntax memberOrSpriteObjRef.directToStage; Description Cast member and sprite property; determines the layer where a digital video, animated GIF, vector shape, 3D, Windows Media, or Flash Asset cast member plays. If this property is TRUE (1), the cast member plays in front of all other layers on the Stage, and ink effects have no affect.
disableImagingTransformation Usage -- Lingo syntax _player.disableImagingTransformation // JavaScript syntax _player.disableImagingTransformation; Description Player property; determines whether Director automatically takes Stage scrolling or zooming into account capturing the image of the Stage. Read/write. When TRUE, this property prevents Director from automatically taking Stage scrolling or zooming into account when the image property is used to get the image of the Stage.
In this example, the model resource of the model named Slogan is extruded text. This statement sets the displayFace property of Slogan's model resource to [#back, #tunnel]. The front face of Slogan will not be drawn. member("scene").model("Slogan").resource.displayFace = \ [#back, #tunnel] See also extrude3D, displayMode displayMode Usage member(whichTextCastmember).displayMode Description Text cast member property; specifies whether the text will be rendered as 2D text or 3D text.
Example The following examples show that the displayRealLogo property for sprite 2 and the cast member Real is set to TRUE, which means that the RealNetworks logo is displayed when the movie starts to play and when it is stopped or rewound. -- Lingo syntax put(sprite(2).displayRealLogo) -- 1 put(member("Real").displayRealLogo) -- 1 // JavaScript syntax trace(sprite(2).displayRealLogo); // 1 put(member("Real").
Property Description resizable Determines whether a window is resizable. If TRUE, the window is resizable. If FALSE, the window is not resizable. The default value is TRUE. For more information, see resizable. title Returns or sets the title of the display template. For more information, see title. titlebarOptions A property list that stores title bar options for a window. The title bar options are icon, visible, closebox, minimizebox, maximizebox, and sideTitlebar.
distribution Usage member(whichCastmember).modelResource(whichModelResource).\ emitter.distribution Description 3D emitter property; indicates how the particles of a particle system are distributed across the emitter’s region at their creation. The possible values of this property are #gaussian or #linear. The default value is #linear. Example In this example, ThermoSystem is a model resource whose type is #particle.
dockingEnabled Usage -- Lingo syntax _movie.displayTemplate.dockingEnabled windowObjRef.dockingEnabled // JavaScript syntax _movie.displayTemplate.dockingEnabled; windowObjRef.dockingEnabled; Description Movie and Window property; specifies whether a movie in a window (MIAW) will be a dockable window when opened during authoring. Read/write. This property cannot be accessed directly from a Movie object; you access this property from the Movie object’s displayTemplate property.
domain Usage -- Lingo syntax dvdObjRef.domain // JavaScript syntax dvdObjRef.domain; Description DVD property; returns a symbol that indicates the current domain. Read-only. Example This statement returns the current domain: -- Lingo syntax trace (member(1).domain) // JavaScript syntax trace (member(1).domain); -- #title // #title See also DVD doubleClick Usage -- Lingo syntax _mouse.doubleClick // JavaScript syntax _mouse.
drag Usage member(whichCastmember).modelResource(whichModelResource).drag Description 3D #particle model resource property; indicates the percentage of each particle’s velocity that is lost in each simulation step. This property has a range of 0 (no velocity lost) to 100 (all velocity lost and the particle stops moving). The default value is 0. Example In this example, ThermoSystem is a model resource whose type is #particle.
// JavaScript syntax var movieRectangle = rect(10, 20, 200, 300); window("Control Panel").drawRect = movieRectangle; The following lines cause the Stage to fill the main monitor area: -- Lingo syntax _movie.stage.drawRect = _system.deskTopRectList[1] _movie.stage.rect = _system.deskTopRectList[1] // JavaScript syntax _movie.stage.drawRect = _system.deskTopRectList[1]; _movie.stage.rect = _system.deskTopRectList[1]; See also rect(), Window dropShadow Usage -- Lingo syntax memberObjRef.
duration (DVD) Usage -- Lingo syntax dvdObjRef.duration // JavaScript syntax dvdObjRef.duration; Description DVD property; returns the total title time, in milliseconds. Read-only. Example This statement returns the duration of the current title: --Lingo syntax trace (member(1).duration) // JavaScript syntax trace (member(1).duration); -- 1329566 // 1329566 See also DVD duration (Member) Usage -- Lingo syntax memberObjRef.duration // JavaScript syntax memberObjRef.
Example If the SWA cast member Louie Prima has been preloaded, this statement displays the sound’s duration in the field cast member Duration Displayer: -- Lingo syntax on exitFrame if member("Louie Prima").state = 2 then member("Duration Displayer").text = \ string(member("Louie Prima").duration) end if end // JavaScript syntax function exitFrame() { if (member("Louie Prima").state == 2) { member("Duration Displayer").text = member("Louie Prima").duration.
editable Usage -- Lingo syntax spriteObjRef.editable // JavaScript syntax spriteObjRef.editable; Description Sprite property; determines whether a specified sprite can be edited on the Stage (TRUE) or not (FALSE). Read/write. When the cast member property is set, the setting is applied to all sprites that contain the field. When this property is set, only the specified sprite is affected. You can also make a field sprite editable by using the Editable option in the Field Cast Member Properties dialog box.
editShortCutsEnabled Usage -- Lingo syntax _movie.editShortCutsEnabled // JavaScript syntax _movie.editShortCutsEnabled; Description Movie property; determines whether cut, copy, and paste operations and their keyboard shortcuts function in the current movie. Read/write. When set to TRUE, these text operations function. When set to FALSE, these operations are not allowed. The default is TRUE for movies made in Director 8 and later, FALSE for movies made in versions of Director prior to Director 8.
Example This idle handler displays the elapsed time for sound channel 4 in a field on the Stage during idles: -- Lingo syntax on idle member("time").text = string(sound(4).elapsedTime) end idle // JavaScript syntax function idle() { member("time").text = sound(4).elapsedTime.toString(); } See also currentTime (Sprite), Sound Channel emissive Usage member(whichCastmember).shader(whichShader).emissive member(whichCastmember).model(whichModel).shader.emissive member(whichCastmember).model(whichModel).
member(whichCastmember).modelResource(whichModelResource).\ emitter.distribution member(whichCastmember).modelResource(whichModelResource).\ emitter.angle member(whichCastmember).modelResource(whichModelResource).\ emitter.path member(whichCastmember).modelResource(whichModelResource).\ emitter.pathStrength member(whichCastmember).modelResource(whichModelResource).\ emitter.minSpeed member(whichCastmember).modelResource(whichModelResource).\ emitter.
enabled Usage the enabled of menuItem whichItem of menu whichMenu Description Menu item property; determines whether the menu item specified by whichItem is displayed in plain text and is selectable (TRUE, default) or appears dimmed and is not selectable (FALSE). The expression whichItem can be either a menu item name or a menu item number. The expression whichMenu can be either a menu name or a menu number. The enabled property can be tested and set. Note: Menus are not available in Shockwave Player.
enabled (fog) Usage member(whichCastmember).camera(whichCamera).fog.enabled sprite(whichSprite).camera{(index)}.fog.enabled Description 3D camera property; indicates whether the camera adds fog to the view from the camera. The default setting for this property is FALSE. Example This statement creates fog in the view from the camera named BayView: member("MyYard").camera("BayView").fog.enabled = TRUE See also fog enabled (sds) Usage member(whichCastmember).model(whichModel).sds.
enableFlashLingo Usage -- Lingo syntax _movie.enableFlashLingo // JavaScript syntax _movie.enableFlashLingo; Description Movie property; determines whether a sprite with Flash content can make any direct scripting callbacks when using the Flash getURL() method. Read/write. The Flash getURL() method loads a new URL into a blank browser window.
Example For this example, assume that the cast member named MyMember contains a model that uses the model resource named Sphere4, whose endAngle value is 310, leaving an opening of 50°. The handler closeSphere closes that opening in a way that makes it look like it is sliding shut. The repeat loop changes the endAngle value of the sphere 1° at a time. The updateStage command in the repeat loop forces the Stage to redraw after every 1° increment. on closeSphere MyAngle = member("MyMember").
This property is useful in determining the span in the Score of a particular sprite. This property is available only in a frame that contains the sprite. It cannot be applied to sprites in different frames of the movie. Example This statement output reports the ending frame of the sprite in channel 5 in the Message window: -- Lingo syntax put(sprite(5).endFrame) // JavaScript syntax put(sprite(5).endFrame); See also Sprite, startFrame endTime Usage -- Lingo syntax soundChannelObjRef.
environmentPropList Usage -- Lingo syntax _system.environmentPropList // JavaScript syntax _system.environmentPropList; Description System property; contains a list with information about the environment under which the Director content is currently running. Read-only. This design enables Macromedia to add information to the environmentPropList property in the future, without affecting existing movies. The information is in the form of property and value pairs for that area.
error Usage member(whichCastmember).model(whichModel).sds.error Description 3D #sds modifier property; indicates the percentage of error tolerated by the modifier when synthesizing geometric detail in models. This property works only when the modifier’s subdivision property is set to #adaptive. The tension and depth (3D) properties of the modifier combine with the error property to control the amount of subdivision performed by the modifier.
-- Lingo syntax on enterFrame if sprite(5).buttonsEnabled = TRUE then sprite(5).eventPassMode= #passNotButton else sprite(5).eventPassMode = #passAlways end if end // JavaScript syntax function enterFrame() { var btEn = sprite(5).buttonsEnabled; if (btEn = 1) { sprite(5).eventPassMode= symbol("passNotButton"); } else { sprite(5).eventPassMode = symbol("passAlways"); } } exitLock Usage -- Lingo syntax _movie.exitLock // JavaScript syntax _movie.
// JavaScript syntax function checkExit() { if ((_key.commandDown) && (_key.key == "." | _key.key == "q") && (_movie.exitLock == true)) { _movie.go("quit sequence"); } } See also Movie externalParamCount Usage -- Lingo syntax _player.externalParamCount // JavaScript syntax _player.externalParamCount; Description Player property; returns the number of parameters that an HTML
face Usage member(whichCastmember).modelResource(whichModelResource).\ face.count member(whichCastmember).modelResource(whichModelResource).\ face[index].colors member(whichCastmember).modelResource(whichModelResource).\ face[index].normals member(whichCastmember).modelResource(whichModelResource).\ face[index].shader member(whichCastmember).modelResource(whichModelResource).\ face[index].textureCoordinates member(whichCastmember).modelResource(whichModelResource).\ face[index].
face[ ] Usage member(whichCastmember).model(whichModel).meshdeform.\ mesh[meshIndex].face[faceIndex] Description 3D meshdeform modifier property; indicates which indices in the vertex list of the model resource were used to define the face. This property can be tested but not set. You can specify the vertices of a face of the #mesh model resource by setting its vertexList and vertices properties and calling the build command.
fieldOfView Usage -- Lingo syntax spriteObjRef.fieldOfView // JavaScript syntax spriteObjRef.fieldOfView; Description QTVR sprite property; gives the specified sprite’s current field of view in degrees. This property can be tested and set. fieldOfView (3D) Usage member(whichCastmember).camera(whichCamera).fieldOfView sprite(whichSprite).camera{(index)}.
fileFreeSize Usage -- Lingo syntax _movie.fileFreeSize // JavaScript syntax _movie.fileFreeSize; Description Movie property; returns the number of unused bytes in the current movie caused by changes to the cast libraries and cast members within a movie. Read-only. The Save and Compact and Save As commands rewrite the file to delete this free space. When the movie has no unused space, fileFreeSize returns 0.
Example This statement displays the pathname and filename of the Buttons external cast in the Message window: -- Lingo syntax trace(castLib("Buttons").fileName) // JavaScript syntax trace(castLib("Buttons").fileName); This statement sets the filename of the Buttons external cast to Content.cst: -- Lingo syntax castLib("Buttons").fileName = _movie.path & "Content.cst" // JavaScript syntax castLib("Buttons").fileName = _movie.path + "Content.cst"; The movie then uses the external cast file Content.
fileName (Member) Usage -- Lingo syntax memberObjRef.fileName // JavaScript syntax memberObjRef.fileName; Description Member property; refers to the name of the file assigned to a linked cast member. Read/write. This property is useful for switching the external linked file assigned to a cast member while a movie plays, similar to the way you can switch cast members. When the linked file is in a different folder than the movie, you must include the file’s pathname.
fileName (Window) Usage -- Lingo syntax windowObjRef.fileName // JavaScript syntax windowObjRef.fileName; Description Window property; refers to the filename of the movie assigned to a window. Read/write. When the linked file is in a different folder than the movie, you must include the file’s pathname. To be able to play the movie in a window, you must set the fileName property to the movie’s filename. The fileName property accepts URLs as a reference.
fileSize Usage -- Lingo syntax _movie.fileSize // JavaScript syntax _movie.fileSize; Description Movie property; returns the number of bytes in the current movie saved on disk. Read-only. This is the same number returned when selecting File Properties in Windows or Get Info in the Macintosh Finder. Example This statement displays the number of bytes in the current movie: -- Lingo syntax put(_movie.fileSize) // JavaScript syntax put(_movie.
fillColor Usage -- Lingo syntax memberObjRef.fillColor // JavaScript syntax memberObjRef.fillColor; Description Vector shape cast member property; the color of the shape’s fill specified as an RGB value. It’s possible to use fillColor when the fillMode property of the shape is set to #solid or #gradient, but not if it is set to #none. If the fillMode is #gradient, fillColor specifies the starting color for the gradient. The ending color is specified with endColor. This property can be tested and set.
Example This statement sets the fillCycles of member Archie to 3: -- Lingo syntax member("Archie").fillCycles = 3 // JavaScript syntax member("Archie").fillCycles = 3; See also endColor, fillColor, fillMode fillDirection Usage -- Lingo syntax memberObjRef.fillDirection // JavaScript syntax memberObjRef.fillDirection; Description Vector shape cast member property; specifies the amount in degrees to rotate the fill of the shape.
fillMode Usage -- Lingo syntax memberObjRef.fillMode // JavaScript syntax memberObjRef.fillMode; Description Vector shape cast member property; indicates the fill method for the shape, using the following possible values: • • • #none—The shape is transparent #solid—The shape uses a single fill color #gradient—The shape uses a gradient between two colors This property can be tested and set when the shape is closed; open shapes have no fill.
Example This statement changes the fill offset of the vector shape cast member miette to a horizontal offset of 33 pixels and a vertical offset of 27 pixels: -- Lingo syntax member("miette").fillOffset = point(33, 27) // JavaScript syntax member("miette").fillOffset = point(33, 27); See also defaultRect, fillMode fillScale Usage -- Lingo syntax memberObjRef.fillScale // JavaScript syntax memberObjRef.
firstIndent Usage -- Lingo syntax chunkExpression.firstIndent // JavaScript syntax chunkExpression.firstIndent; Description Text cast member property; contains the number of pixels the first indent in chunkExpression is offset from the left margin of the chunkExpression. The value is an integer: less than 0 indicates a hanging indent, 0 is no indention, and greater than 0 is a normal indention. This property can be tested and set.
fixedRate Usage -- Lingo syntax memberOrSpriteObjRef.fixedRate // JavaScript syntax memberOrSpriteObjRef.fixedRate; Description Cast member property and sprite property; controls the frame rate of a Flash movie or animated GIF. The fixedRate property can have integer values. The default value is 15. This property is ignored if the sprite’s playbackMode property is anything other than #fixed. This property can be tested and set. Example The following handler adjusts the frame rate of a Flash movie sprite.
fixStageSize Usage -- Lingo syntax _movie.fixStageSize // JavaScript syntax _movie.fixStageSize; Description Movie property; determines whether the Stage size remains the same when you load a new movie (TRUE, default), or not (FALSE), regardless of the Stage size saved with that movie, or the setting for the centerStage. Read/write. The fixStageSize property cannot change the Stage size for a movie that is currently playing.
For linked Flash cast members, the FlashRect member property returns a valid value only when the cast member’s header has finished loading into memory. This property can be tested but not set. Example This sprite script resizes a Flash movie sprite so that it is equal to the original size of its Flash movie cast member: -- Lingo syntax property spriteNum on beginSprite me sprite(spriteNum).rect = sprite(spriteNum).member.FlashRect end // JavaScript syntax function beginSprite() { sprite(this.spriteNum).
flipH Usage -- Lingo syntax spriteObjRef.flipH // JavaScript syntax spriteObjRef.flipH; Description Sprite property; indicates whether a sprite’s image has been flipped horizontally on the Stage (TRUE) or not (FALSE). Read-only. The image itself is flipped around its registration point. This means any rotation or skew remains constant; only the image data itself is flipped. Example This statement displays the flipH of sprite 5: -- Lingo syntax put(sprite(5).flipH) // JavaScript syntax put(sprite(5).
floatPrecision Usage the floatPrecision Description Movie property; rounds off the display of floating-point numbers to the number of decimal places specified. The value of floatPrecision must be an integer. The maximum value is 15 significant digits; the default value is 4. The floatPrecision property determines only the number of digits used to display floating-point numbers; it does not change the number of digits used to perform calculations.
folder Usage -- Lingo syntax dvdObjRef.folder // JavaScript syntax dvdObjRef.folder; Description DVD property. Determines the pathname of the folder from which a DVD is playing. Read/ write. The pathname must be a string. The folder property can be set either in the Property inspector or through scripting. The current implementation has the following requirements: Windows: • You must provide video_ts at the end of the file path for the targeted local DVD media.
// JavaScript syntax member(2).folder = "/Volumes/Macintosh HD/myLocalDVDContent"; Note: If a video_ts folder cannot be found when the first DVD cast member is created, an error alert will appear that says "Unable to locate DVD volume." This alert will only appear once per session. At that point, you can still name any newly created DVD member and then set the folder property to a location that contains a valid video_ts folder.
fontSize Usage -- Lingo syntax memberObjRef.fontSize // JavaScript syntax memberObjRef.fontSize; Description Field cast member property; determines the size of the font used to display the specified field cast member and requires that the cast member contain characters, if only a space. The parameter whichCastMember can be either a cast member name or number. This property can be tested and set. When tested, it returns the height of the first line in the field. When set, it affects every line in the field.
Description Cast member property; determines the styles applied to the font used to display the specified field cast member, character, line, word, or other chunk expression and requires that the field cast member contain characters, if only a space. The value of the property is a string of styles delimited by commas. Lingo uses a font that is a combination of the styles in the string.
foreColor Usage -- Lingo syntax spriteObjRef.foreColor // JavaScript syntax spriteObjRef.foreColor; Description Sprite property; returns or sets the foreground color of a sprite. Read/write. It is not recommended to apply this property to bitmap cast members deeper than 1-bit, as the results are difficult to predict. It is recommended that the newer color property be used instead of the foreColor property.
// JavaScript syntax _movie.go(_movie.frame - 1); See also go(), Movie frameCount Usage -- Lingo syntax memberObjRef.frameCount // JavaScript syntax memberObjRef.frameCount; Description Flash cast member property; indicates the number of frames in the Flash movie cast member. The frameCount member property can have integer values. This property can be tested but not set.
Example The following statement checks the label of the current frame. In this case, the current frameLabel value is Start: -- Lingo syntax put(_movie.frameLabel) // JavaScript syntax put(_movie.frameLabel); See also labelList, Movie framePalette Usage -- Lingo syntax _movie.framePalette // JavaScript syntax _movie.
frameRate Usage -- Lingo syntax memberObjRef.frameRate // JavaScript syntax memberObjRef.frameRate; Description Cast member property; specifies the playback frame rate for the specified digital video, or Flash movie cast member. The possible values for the frame rate of a digital video member correspond to the radio buttons for selecting digital video playback options. • When the frameRate member property is between 1 and 255, the digital video movie plays every frame at that frame rate.
-- Lingo syntax property spriteNum on beginSprite me if sprite(spriteNum).member.frameRate < 15 then sprite(spriteNum).playBackMode = #fixed sprite(spriteNum).fixedRate = 15 end if end // JavaScript syntax function beginSprite () { var fr = sprite(this.spriteNum).member.frameRate; if (fr < 15) { sprite(this.spriteNum).playBackMode = symbol("fixed"); sprite(this.spriteNum).
frameScript Usage -- Lingo syntax _movie.frameScript // JavaScript syntax _movie.frameScript; Description Movie property; contains the unique cast member number of the frame script assigned to the current frame. Read/write during a Score recording session only. During a Score generation session, you can also assign a frame script to the current frame by setting the frameScript property. If there is no frame script assigned to the current frame, this property returns 0.
Example As part of a Score recording session, this statement assigns the sound cast member Jazz to the first sound channel: -- Lingo syntax _movie.frameSound1 = member("Jazz").number // JavaScript syntax _movie.frameSound1 = member("Jazz").number; See also frameSound2, Movie frameSound2 Usage -- Lingo syntax _movie.frameSound2 // JavaScript syntax _movie.frameSound2; Description Movie property; determines the number of the cast member assigned to the second sound channel in the current frame. Read/write.
Example The following statement checks the tempo used in the current frame. In this case, the tempo is 15 frames per second. -- Lingo syntax put(_movie.frameTempo) // JavaScript syntax put(_movie.frameTempo); See also Movie, puppetTempo() frameTransition Usage -- Lingo syntax _movie.frameTransition // JavaScript syntax _movie.frameTransition; Description Movie property; specifies the number of the transition cast member assigned to the current frame.
Example This statement sets the front property of the model resource named Crate to FALSE, meaning the front of this box will be open: member("3D World").modelResource("Crate").front = FALSE See also back, bottom (3D), top (3D), left (3D), right (3D) frontWindow Usage -- Lingo syntax _player.frontWindow // JavaScript syntax _player.frontWindow; Description Player property; indicates which movie in a window (MIAW) is currently frontmost on the screen. Read-only.
See also DVD getBoneID Usage memberReference.modelResource.getBoneID("boneName") Description 3D model resource property; returns the index number of the bone named boneName in the model resource. This property returns 0 if no bone by that name can be found. Example This statement returns an ID number for the bone ShinL: put member("ParkScene").modelResource("LittleKid").
glossMap Usage member(whichCastmember).shader(whichShader).glossMap member(whichCastmember).model(whichModel).shader.glossMap member(whichCastmember).model(whichModel).shaderList{[index]}.\ glossMap Description 3D #standard shader property; specifies the texture to use for gloss mapping. When you set this property, the following properties are automatically set: • The fourth texture layer of the shader is set to the texture you specified. • The value of textureModeList[4] is set to #none.
gradientType Usage -- Lingo syntax memberObjRef.gradientType // JavaScript syntax memberObjRef.gradientType; Description Vector shape cast member property; specifies the actual gradient used in the cast member’s fill. Possible values are #linear or #radial. The gradientType is only valid when the fillMode is set to #gradient. This property can be tested and set. Example This handler toggles between linear and radial gradients in cast member "backdrop": -- Lingo syntax on mouseUp me if member("backdrop").
Example This statement shows that the fourth group of the cast member newAlien is the group Direct01: put member("newAlien").group[4] -- group("Direct01") See also newGroup, deleteGroup, child (3D), parent height Usage -- Lingo syntax imageObjRef.height memberObjRef.height spriteObjRef.height // JavaScript syntax imageObjRef.height; memberObjRef.height; spriteObjRef.
This statement sets the height of sprite 10 to 26 pixels: -- Lingo syntax sprite(10).height = 26 // JavaScript syntax sprite(10).height = 26; See also Member, Sprite, width height (3D) Usage member(whichCastmember).modelResource(whichModelResource).height member(whichCastmember).texture(whichTexture).height Description 3D #box model resource, #cylinder model resource, and texture property; indicates the height of the object.
Example The following statement sets the heightVertices property of the model resource named Tower to 10. Nine polygons will be used to define the geometry of the model resource along its Z axis; therefore, there will be ten vertices. member("3D World").modelResource("Tower").heightVertices = 10 See also height (3D) highlightPercentage Usage member(whichCastmember).model(whichModel).toon.highlightPercentage member(whichCastmember).model(whichModel).shader.highlight\ Percentage member(whichCastmember).
Example The following statement sets the highlightStrength property of the toon modifier for the model named Teapot to 0.5. The model’s highlights will be moderately bright. member("shapes").model("Teapot").toon.highlightStrength = 0.5 See also highlightPercentage, brightness hilite Usage -- Lingo syntax memberObjRef.hilite // JavaScript syntax memberObjRef.
Description 3D camera property; indicates the distance in world units from the camera beyond which models are drawn. Objects closer to the camera than hither are not drawn. The value of this property must be greater than or equal to 1.0 and has a default value of 5.0. Example The following statement sets the hither property of camera 1 to 1000. Models closer than 1000 world units from the camera will not be visible. member("SolarSystem").camera[1].
hotSpotEnterCallback Usage -- Lingo syntax spriteObjRef.hotSpotEnterCallback // JavaScript syntax spriteObjRef.hotSpotEnterCallback; Description QuickTime VR sprite property; contains the name of the handler that runs when the cursor enters a QuickTime VR hot spot that is visible on the Stage. The QuickTime VR sprite receives the message first. The message has two arguments: the me parameter and the ID of the hot spot that the cursor entered. To clear the callback, set this property to 0.
Description Cast member property; accesses text and tags that control the layout of the text within an HTML-formatted text cast member. This property can be tested and set. Example This statement displays in the message window the HTML formatting information embedded in the text cast member Home Page: --Lingo syntax put(member("Home Page").HTML) // JavaScript syntax trace(member("Home Page").HTML); See also importFileInto(), RTF hyperlink Usage -- Lingo syntax chunkExpression.
See also hyperlinkRange, hyperlinkState hyperlinkRange Usage -- Lingo syntax chunkExpression.hyperlinkRange // JavaScript syntax chunkExpression.hyperlinkRange; Description Text cast member property; returns the range of the hyperlink that contains the first character of the chunk expression. This property can be tested but not set. Like hyperLink and hyperLinkState, the returned range of the link contains the first character of chunkExpression.
hyperlinkState Usage -- Lingo syntax chuckExpression.hyperlinkState // JavaScript syntax chuckExpression.hyperlinkState; Description Text cast member property; contains the current state of the hyperlink. Possible values for the state are: #normal, #active, and #visited. This property can be tested and set. Like hyperLink and hyperLinkRange, the returned range of the link contains the first character of chunkExpression. Example The following handler checks to see if the hyperlink clicked is a web address.
idleHandlerPeriod Usage -- Lingo syntax _movie.idleHandlerPeriod // JavaScript syntax _movie.idleHandlerPeriod; Description Movie property; determines the maximum number of ticks that passes until the movie sends an idle message. Read/write. The default value is 1, which tells the movie to send idle handler messages no more than 60 times per second. When the playhead enters a frame, Director starts a timer, repaints the appropriate sprites on the Stage, and issues an enterFrame event.
idleLoadMode Usage -- Lingo syntax _movie.idleLoadMode // JavaScript syntax _movie.idleLoadMode; Description Movie property; determines when the preLoad() and preLoadMember() methods try to load cast members during idle periods. Read/write.
The default value for idleLoadPeriod is 0, which instructs Director to service the load queue as frequently as possible. Example This statement instructs Director to try loading every 1/2 second (30 ticks) any cast members waiting to be loaded: -- Lingo syntax _movie.idleLoadPeriod = 30 // JavaScript syntax _movie.idleLoadPeriod = 30; See also on idle, Movie idleLoadTag Usage -- Lingo syntax _movie.idleLoadTag // JavaScript syntax _movie.
Description Movie property; determines the maximum number of bytes that Director can load when it attempts to load cast members from the load queue. Read/write. The default value of idleReadChunkSize is 32K. Example This statement specifies that 500K is the maximum number of bytes that Director can load in one attempt at loading cast members in the load queue: -- Lingo syntax _movie.idleReadChunkSize = (500 * 1024) // JavaScript syntax _movie.
These statements place a reference to the image of the stage into the variable myImage and then put that image into cast member flower: -- Lingo syntax myImage = _movie.stage.image member("flower").image = myImage // JavaScript syntax var myImage = _movie.stage.image; member("flower").image = myImage; See also copyPixels(), draw(), duplicate() (Image), fill(), image(), setPixel() image (RealMedia) Usage -- Lingo syntax memberOrSpriteObjRef.image // JavaScript syntax memberOrSpriteObjRef.
If you plan to make a lot of changes to the image property, it is faster to copy the image property into a new image object using the Member object’s duplicate() method, apply your changes to the new image object, and then set the original item’s image to the new image object. For nonbitmap members, it is always faster to use the duplicate() method.
// JavaScript syntax put(_movie.imageCompression); See also imageQuality, Movie imageEnabled Usage -- Lingo syntax memberOrSpriteObjRef.imageEnabled // JavaScript syntax memberOrSpriteObjRef.imageEnabled; Description Cast member property and sprite property; controls whether a Flash movie or vector shape’s graphics are visible (TRUE, default) or invisible (FALSE). This property can be tested and set.
// JavaScript syntax function exitFrame() { var stmSp = sprite(_global.gStreamingSprite).member.percentStreamed; if (stmSp < 100) { _movie.go(_movie.frame); } else { sprite(_global.gStreamingSprite).imageEnabled = 1; _movie.updatestage(); } } imageQuality Usage -- Lingo syntax _movie.imageQuality memberObjRef.imageQuality // JavaScript syntax _movie.imageQuality; memberObjRef.
Example This statement sets the immovable property of the collision modifier attached to the first model of the cast member named Scene to TRUE: member("Scene").model[1].collision.immovable = TRUE See also collision (modifier) ink Usage -- Lingo syntax spriteObjRef.ink // JavaScript syntax spriteObjRef.ink; Description Sprite property; determines the ink effect applied to a sprite. Read/write.
This statement gives sprite (i + 1) a matte ink effect by setting the ink effect of the sprite property to 8, which specifies matte ink: -- Lingo syntax sprite(i + 1).ink = 8 // JavaScript syntax sprite(i + 1).ink = 8; See also backColor, Sprite, updateStage() inker (modifier) Syntax member(whichCastmember).modelResource(whichModelResource).\ inker.inkerModifierProperty modelResourceObjectReference.inker.
inlineImeEnabled Usage -- Lingo syntax _player.inlineImeEnabled // JavaScript syntax _player.inlineImeEnabled; Description Player property; determines whether the Director Inline IME feature is turned on. Read/write. When TRUE, this property allows the user to enter double-byte characters directly into the Director Text, Field, Script, and Message windows on Japanese systems. The default value is determined by the Enable Inline IME setting in Director General Preferences.
// JavaScript syntax function mouseEnter() { member("Butterfly").interval = 50; } function mouseLeave() { member("Butterfly").interval = 100; } invertMask Usage -- Lingo syntax memberObjRef.invertMask // JavaScript syntax memberObjRef.invertMask; Description QuickTime cast member property; determines whether Director draws QuickTime movies in the white pixels of the movie’s mask (TRUE) or in the black pixels (FALSE, default). This property can be tested and set.
isVRMovie Usage -- Lingo syntax memberOrSpriteObjRef.isVRMovie // JavaScript syntax memberOrSpriteObjRef.isVRMovie; Description QuickTime cast member and sprite property; indicates whether a cast member or sprite is a QuickTime VR movie that has not yet been downloaded (TRUE), or whether the cast member or sprite isn’t a QuickTime VR movie (FALSE). Testing for this property in anything other than an asset whose type is #quickTimeMedia produces an error message. This property can be tested but not set.
itemDelimiter Usage the itemDelimiter Description Player property; indicates the special character used to separate items. You can use the itemDelimiter to parse filenames by setting itemDelimiter to a backslash (\) in Windows or a colon (:) on the Macintosh. Restore the itemDelimiter character to a comma (,) for normal operation. This function can be tested and set. Example The following handler finds the last component in a Macintosh pathname.
kerningThreshold Usage -- Lingo syntax memberObjRef.kerningThreshold // JavaScript syntax memberObjRef.kerningThreshold; Description Text cast member property; this setting controls the size at which automatic kerning takes place in a text cast member. This has an effect only when the kerning property of the text cast member is set to TRUE. The setting itself is an integer indicating the font point size at which kerning takes place. This property defaults to 14 points.
-- Lingo syntax on prepareMovie keyDownScript = "checkKey" end on checkKey if (_key.key = "q") then _movie.go("Main Menu") end if end // JavaScript syntax function prepareMovie() { keyDownScript = checkKey(); } function checkKey() { if (_key.key == "q") { _movie.go("Main Menu"); } } This on keyDown handler checks whether the last key pressed is the z key and if it is, calls the on addNumbers handler: -- Lingo syntax on keyDown if (_key.
See also Movie keyCode Usage -- Lingo syntax _key.keyCode // JavaScript syntax _key.keyCode; Description Key property; returns the numerical code for the last key pressed. Read-only. The returned value is the key’s numerical value, not the American National Standards Institute (ANSI) value. You can use keyCode to detect when the user has pressed an arrow or function key, which cannot be specified by the key property.
125: BackUp 124: TurnRight end case end keyDown // JavaScript syntax function keyDown() { switch (_key.keyCode) { case 123: TurnLeft(); break; case 126: GoForward(); break; case 125: BackUp(); break; case 124: TurnRight(); break; } } See also Key, key keyDownScript Usage the keyDownScript Description System property; specifies the Lingo that is executed when a key is pressed. The Lingo is written as a string, surrounded by quotation marks, and can be a simple statement or a calling script for a handler.
See also on keyDown, keyUpScript, mouseDownScript, mouseUpScript keyframePlayer (modifier) Syntax member(whichCastmember).model(whichModel).\ keyframePlayer.keyframePlayerModifierProperty Description 3D modifier; manages the use of motions by models. The motions managed by the keyframePlayer modifier animate the entire model at once, unlike Bones player motions, which animate segments of the model called bones.
• • initiates playback of the next motion in the playlist. queue() adds a motion to the end of the playlist. playNext() The keyframePlayer modifier generates the following events, which are used by handlers declared in the registerForEvent() and registerScript() commands. The call to the declared handler includes three arguments: the event type (either #animationStarted or #animationEnded), the name of the motion, and the current time of the motion.
labelList Usage the labelList Description System property; lists the frame labels in the current movie as a Return-delimited string (not a list) containing one label per line. Labels are listed according to their order in the Score. (Because the entries are Return-delimited, the end of the string is an empty line after the last Return. Be sure to remove this empty line if necessary.
lastClick Usage -- Lingo syntax _player.lastClick // JavaScript syntax _player.lastClick; Description Player property; returns the time in ticks (1 tick = 1/60 of a second) since the mouse button was last pressed. Read-only. Example This statement checks whether 10 seconds have passed since the last mouse click and, if so, sends the playhead to the marker No Click: -- Lingo syntax if (_player.lastClick > (10 * 60)) then _movie.go("No Click") end if // JavaScript syntax if (_player.
Example The following examples show that the last error returned by RealPlayer for the sprite 2 and the cast member Real was #PNR_OUTOFMEMORY: -- Lingo syntax put(sprite(2).lastError) -- #PNR_OUTOFMEMORY put(member("Real").lastError) -- #PNR_OUTOFMEMORY // JavaScript syntax trace(sprite(2).lastError); // #PNR_OUTOFMEMORY put(member("Real").lastError); // #PNR_OUTOFMEMORY lastEvent Usage -- Lingo syntax _player.lastEvent // JavaScript syntax _player.
Example This statement displays the number of the last frame of the movie in the Message window: -- Lingo syntax put(_movie.lastFrame) // JavaScript syntax put(_movie.lastFrame); See also Movie lastKey Usage -- Lingo syntax _player.lastKey // JavaScript syntax _player.lastKey; Description Player property; gives the time in ticks (1 tick = 1/60 of a second) since the last key was pressed. Read-only.
Example This statement checks whether 45 seconds have passed since the mouse was last moved and, if so, sends the playhead to the marker Attract Loop: -- Lingo syntax if (_player.lastRoll > (45 * 60)) then _movie.go("Attract Loop") end if // JavaScript syntax if (_player.lastRoll > (45 * 60)) { _movie.go("Attract Loop"); } See also lastClick, lastEvent, lastKey, Player left Usage -- Lingo syntax spriteObjRef.left // JavaScript syntax spriteObjRef.
left (3D) Usage member(whichCastmember).modelResource(whichModelResource).left Description 3D #box model resource property; indicates whether the side of the box intersected by its -X axis is sealed (TRUE) or open (FALSE). The default value for this property is TRUE. Example This statement sets the left property of the model resource named Crate to FALSE, meaning the left side of this box will be open: member("3D World").modelResource("crate").
The length of a vector is its distance in world units from vector(0, 0, 0). This is the same as the magnitude of the vector. Example This statement sets the variable myBoxLength to the length of the model resource named GiftBox. myBoxLength = member("3D World").modelResource("GiftBox").length See also height (3D), width (3D), magnitude lengthVertices Usage member(whichCastmember).modelResource(whichModelResource).
The #lod modifier can only be added to models created outside of Director in 3D modeling programs. The value of the type property of the model resources used by these models is #fromFile. The modifier cannot be added to primitives created within Director. Example The following statement sets the level property of the lod modifier of the model Spaceship to 50. If the lod modifier’s auto property is set to FALSE, Spaceship will be drawn at a medium level of detail.
See also newLight, deleteLight lineColor Usage member(whichCastmember).model(whichModel).inker.lineColor member(whichCastmember).model(whichModel).toon.lineColor Description 3D toon and inker modifier property; indicates the color of the lines drawn on the model by the modifier. For this property to have an effect, either the modifier’s creases, silhouettes, or boundary property must be set to TRUE. The default value for this property is rgb(0, 0, 0).
lineDirection Usage member(whichCastMember).lineDirection Description Shape member property; this property contains a 0 or 1 indicating the slope of the line drawn. If the line is inclined from left to right, the property is set to 1; and if it is declined from left to right, the property is set to 0. This property can be tested and set. Example This handler toggles the slope of the line in cast member “theLine”, producing a see-saw effect: on seeSaw member("theLine").
lineOffset Usage member(whichCastmember).model(whichModel).toon.lineOffset member(whichCastmember).model(whichModel).inker.lineOffset Description 3D toon and inker modifier property; indicates the apparent distance from the model’s surface at which lines are drawn by the modifier. For this property to have an effect, the modifier’s useLineOffset property must be set to TRUE, and one or more of its creases, silhouettes, or boundary properties must also be set to TRUE. This range of this property is -100.
linked Usage -- Lingo syntax memberObjRef.linked // JavaScript syntax memberObjRef.linked; Description Member property; controls whether a script, Flash movie, or animated GIF file is stored in an external file (TRUE, default), or inside the Director cast library (FALSE). Read/write for script, Flash, and animated GIF members, read-only for all other member types.
Example This statement checks whether cast member Demo Movie is loaded in memory and if it isn’t, goes to an alternative movie: -- Lingo syntax if member("Demo Movie").loaded = FALSE then _movie.go(1, "Waiting.dir") end if // JavaScript syntax if (member("Demo Movie").loaded == false) { _movie.go(1, "Waiting.dir") } See also Member loc (backdrop and overlay) Usage sprite(whichSprite).camera{(index)}.backdrop[index].loc member(whichCastmember).camera(whichCamera).backdrop[index].loc sprite(whichSprite).
Example This statement puts sprite 15 at the same horizontal location as the mouse click: -- Lingo syntax sprite(15).locH = _mouse.mouseH // JavaScript syntax sprite(15).locH = _mouse.mouseH; See also bottom, height, left, locV, point(), right, Sprite, top, updateStage() lockTranslation Usage member(whichCastmember).model(whichModel).bonesPlayer.\ lockTranslation member(whichCastmember).model(whichModel).keyframePlayer.
Sprite coordinates are relative to the upper left corner of the Stage. To make the value last beyond the current sprite, make the sprite a scripted sprite. Example This statement puts sprite 15 at the same vertical location as the mouse click: -- Lingo syntax sprite(15).locV = _mouse.mouseV // JavaScript syntax sprite(15).locV = _mouse.mouseV; See also bottom, height, left, locH, point(), right, Sprite, top, updateStage() locZ Usage -- Lingo syntax spriteObjRef.locZ // JavaScript syntax spriteObjRef.
// JavaScript syntax function mouseUp() { _global.gHighestSprite; sprite(this.spriteNum).locZ = _global.gHighestSprite + 1 _global.gHighestSprite = _global.gHighestSprite + 1 } See also locH, locV, Sprite lod (modifier) Usage member(whichCastmember).model(whichModel).lod.lodModifierProperty Description 3D modifier; dynamically removes detail from models as they move away from the camera. This modifier can only be added to models created outside of Director in 3D modeling programs.
loop (3D) Usage member(whichCastmember).loop Description 3D cast member property; indicates whether motions applied to the first model in the cast member repeat continuously (TRUE) or play once and stop (FALSE). The default setting for this property is TRUE. Example This statement sets the loop property of the cast member named Walkers to TRUE. Motions being executed by the first model in Walker will repeat continuously. member("Walkers").
loop (Member) Usage -- Lingo syntax memberObjRef.loop // JavaScript syntax memberObjRef.loop; Description Cast member property; determines whether the specified digital video, sound, or Flash movie cast member is set to loop (TRUE) or not (FALSE). Example This statement sets the QuickTime movie cast member Demo to loop: -- Lingo syntax member("Demo").loop = 1 // JavaScript syntax member("Demo").loop = 1; loop (Flash) Usage sprite(whichFlashSprite).
loop (Windows Media) Usage -- Lingo syntax windowsMediaObjRef.loop // JavaScript syntax windowsMediaObjRef.loop; Description Windows Media property. Determines whether a movie loops (TRUE, default) or not (FALSE) after completion. Read/write. Example This statement specifies that the cast member Classical should loop after completion: -- Lingo syntax member("Classical").loop = TRUE // JavaScript syntax member("Classical").loop = true; See also Windows Media loopBounds Usage -- Lingo syntax spriteObjRef.
If the loop property is turned off while the movie is playing, the movie continues to play. Director stops when it reaches the end of the movie. This property can be tested and set. The default setting is [0,0]. Example This sprite script sets the starting and ending times for looping within a QuickTime sprite. The times are set by specifying seconds, which are then converted to ticks by multiplying by 60. -- Lingo syntax on beginSprite me sprite(me.spriteNum).
// JavaScript syntax function playMusic() { sound(2).queue(propList("member",member("introMusic"), "startTime",3000, "loopCount",5, "loopStartTime",8000, "loopEndTime",8900)); sound(2).queue(propList("member",member("creditsMusic"), "startTime",3000, "endTime",3000, "loopCount",3]); sound(2).play(); } See also loopEndTime, loopStartTime, queue(), setPlayList(), Sound Channel loopEndTime Usage -- Lingo syntax soundChannelObjRef.loopEndTime // JavaScript syntax soundChannelObjRef.
loopsRemaining Usage -- Lingo syntax soundChannelObjRef.loopsRemaining // JavaScript syntax soundChannelObjRef.loopsRemaining; Description Sound Channel property; specifies the number of times left to play a loop in the current sound playing in a sound channel. Read-only. If the sound had no loop specified when it was queued, this property is 0.
magnitude Usage whichVector.magnitude Description 3D property; returns the magnitude of a vector. The value is a floating-point number. The magnitude is the length of a vector and is always greater than or equal to0.0. (vector (0, 0, 0) equals 0.) Example This statement shows that the magnitude of MyVec1 is 100.0000 and the magnitude of MyVec2 is 141.4214. MyVec1 = vector(100, 0, 0) put MyVec1.magnitude -- 100.0000 MyVec2 = vector(100, 100, 0) put MyVec2.magnitude -- 141.
markerList Usage -- Lingo syntax _movie.markerList // JavaScript syntax _movie.markerList; Description Movie property; contains a script property list of the markers in the Score. Read-only. The list is of the format: frameNumber: "markerName" Example This statement displays the list of markers in the Message window: -- Lingo syntax put(_movie.markerList) // JavaScript syntax put(_movie.markerList); See also Movie mask Usage -- Lingo syntax memberObjRef.mask // JavaScript syntax memberObjRef.
Masking is an advanced feature; you may need to experiment to achieve your goal. This property can be tested and set. To remove a mask, set the mask property to 0. Example This frame script sets a mask for a QuickTime sprite before Director begins to draw the frame: -- Lingo syntax on prepareFrame member("Peeping Tom").mask = member("Keyhole") end // JavaScript syntax function prepareFrame() { member("Peeping Tom").
maxSpeed Usage member(whichCastmember).modelResource(whichModelResource).\ emitter.maxSpeed Description 3D property; when used with a model resource whose type is #particle, allows you to get and set the maximum speed at which particles are emitted. Each particle’s initial velocity is randomly selected between the emitter’s minSpeed and maxSpeed properties. The value is a floating-point number and must be greater than 0.0. Example In this example, ThermoSystem is a model resource of the type #particle.
Example This statement copies the content of the cast member Sunrise into the cast member Dawn by setting the media member property value for Dawn to the media member property value for Sunrise: -- Lingo syntax member("Dawn").media = member("Sunrise").media // JavaScript syntax member("Dawn").media = member("Sunrise").media; See also Member mediaReady Usage -- Lingo syntax memberObjRef.mediaReady // JavaScript syntax memberObjRef.
mediaStatus (DVD) Usage -- Lingo syntax dvdObjRef.mediaStatus // JavaScript syntax dvdObjRef.mediaStatus; Description DVD property; returns a symbol that indicates the current state of the DVD player. Read-only. Possible symbols include the following: Symbol Description #stopped The DVD is stopped. #playing The DVD is playing. #paused The DVD is paused. #scanning The DVD is scanning. #uninitialized The DVD is not initialized. #volumeInvalid The DVD specified is not valid.
• • • • • • • #connecting indicates that a connection to the RealMedia or Windows Media stream is being established. #opened indicates that a connection to the RealMedia or Windows Media stream has been established and is open. This is a transitory state that is very quickly followed by #buffering. #buffering indicates that the RealMedia or Windows Media stream is being downloaded into the playback buffer.
// JavaScript syntax put(_player.mediaXtraList); See also Media Types, Player, scriptingXtraList, toolXtraList, transitionXtraList, xtraList (Player) member Usage member(whichCastmember).texture(whichTexture).member member(whichCastmember).model(whichModel).shader.texture.member member(whichCastmember).model(whichModel).shaderList\ [shaderListIndex].textureList[textureListIndex].
// JavaScript syntax var myMember = castLib("Internal").member[2]; See also Cast Library member (Movie) Usage -- Lingo syntax _movie.member[memberNameOrNum] // JavaScript syntax _movie.member[memberNameOrNum]; Description Movie property; provides indexed or named access to the members of a movie’s cast library. Read-only. The memberNameOrNum argument can be a string that specifies the cast member by name or an integer that specifies the cast member by number.
-- Lingo syntax put(sound(2).member) // JavaScript syntax put(sound(2).member); See also Sound Channel member (Sprite) Usage -- Lingo syntax spriteObjRef.member // JavaScript syntax spriteObjRef.member; Description Sprite property; specifies a sprite’s cast member and cast library. Read/write. The member Sprite property differs from the spriteNum Sprite property, which specifies only the sprite’s number to identify its location in the cast library but doesn’t specify the cast library itself.
// JavaScript syntax sprite(15).
The following handler uses the mouseMember function with the sprite.member property to find if the mouse is over a particular sprite: -- Lingo syntax on exitFrame mm = _mouse.mouseMember target = sprite(1).member if (target = mm) then put("Above the hotspot.") _movie.go(_movie.frame) end if end // JavaScript syntax function exitFrame() { var mm = _mouse.mouseMember; var target = sprite(1).member; if (target = mm) { put("Above the hotspot."); _movie.go(_movie.
meshDeform (modifier) Usage member(whichCastmember).model(whichModel).meshDeform.propertyName Description 3D modifier; allows control over the various aspects of the referenced model’s mesh structure.
Example This statement converts milliseconds to seconds and minutes by dividing the number of milliseconds by 1000 and dividing that result by 60, and then sets the variable currentMinutes to the result: -- Lingo syntax currentSeconds = _system.milliseconds/1000 currentMinutes = currentSeconds/60 // JavaScript syntax var currentSeconds = _system.milliseconds/1000; var currentMinutes = currentSeconds/60; The resolution accuracy of the count is machine and operating system dependent.
missingFonts Usage member(textCastMember).missingFonts Description Text cast member property; this property contains a list of the names of the fonts that are referenced in the text, but not currently available on the system. This allows the developer to determine during run time if a particular font is available or not. This property can be tested but not set. See also substituteFont mode (emitter) Usage member(whichCastmember).modelResource(whichModelResource).\ emitter.
mode (collision) Usage member(whichCastmember).model(whichModel).collision.mode Description 3D collision modifier property; indicates the geometry to be used in the collision detection algorithm. Using simpler geometry such as the bounding sphere leads to better performance. The possible values for this property are: • #mesh uses the actual mesh geometry of the model’s resource. This gives one-triangle precision and is usually slower than #box or #sphere. • #box uses the • bounding box of the model.
This statement stores a reference to the eighth model of the cast member named 3DWorld in the variable thismodel. thismodel = member("3DWorld").model[8] This statement shows that there are four models in the member of sprite 1. put sprite(1).member.model.count -- 4 modelA Usage collisionData.modelA Description 3D collisionData property; indicates one of the models involved in a collision, the other model being modelB.
modelB Usage collisionData.modelB Description 3D collisionData property; indicates one of the models involved in a collision, the other model being modelA. The collisionData object is sent as an argument with the #collideWith and #collideAny events to the handler specified in the registerForEvent, registerScript, and setCollisionCallback commands. The #collideWith and #collideAny events are sent when a collision occurs between models to which collision modifiers have been added.
modelResource Usage member(whichCastmember).modelResource(whichModelResource) member(whichCastmember).modelResource[index] member(whichCastmember).modelResource.count member(whichCastmember).modelResource(whichModelResource).\ propertyName member(whichCastmember).modelResource[index].propertyName Description 3D command; returns the model resource found within the referenced cast member that has the name specified by whichModelResource, or is found at the index position specified by the index parameter.
Example This statement tests whether the cast member Introduction has been modified since it was read from the movie file: -- Lingo syntax if (member("Introduction").modified) then _player.alert("Introduction has been modified") else _player.alert("Introduction has not been modified") end if // JavaScript syntax if (member("Introduction").modified) { _player.alert("Introduction has been modified"); } else { _player.
modifiedDate Usage -- Lingo syntax memberObjRef.modifiedDate // JavaScript syntax memberObjRef.modifiedDate; Description Member property; indicates the date and time that the cast member was last changed, using the system time on the authoring computer. Read-only. This property is useful for tracking and coordinating Director projects. It can also be viewed in the Property inspector’s Member tab and the Cast window list view.
modifier[] Usage member(whichCastmember).model(whichModel).modifier[index] Description 3D model property; returns the type of the modifier found at the position specified by index within the model’s attached modifier list. The value returned is a symbol. If no modifier is found at the specified position then this property’s value is void. To obtain information about a model’s attached modifier list use the modifier property.
Description Sound channel and sprite property; for sound sprites, QuickTime digital video, and Xtra extensions that support cue points, indicates the number that identifies the most recent cue point passed in the sprite or sound. The value is the cue point’s ordinal number. If no cue points have been passed, the value is 0. Shockwave Audio (SWA) sounds can appear as sprites in sprite channels, but they play sound in a sound channel.
See also duration (3D), map (3D) motionQuality Usage -- Lingo syntax spriteObjRef.motionQuality // JavaScript syntax spriteObjRef.motionQuality; Description QuickTime VR sprite property; the codec quality used when the user clicks and drags the QuickTime VR sprite. The property’s value can be #minQuality, #maxQuality, or #normalQuality. This property can be tested and set. Example This statement sets the motionQuality of sprite 1 to #minQuality. -- Lingo syntax sprite(1).
Example This statement determines whether the pointer is over a field sprite and changes the content of the field cast member Instructions to “Please point to a character.” when it is not: -- Lingo syntax if (_mouse.mouseChar = -1) then member("Instructions").text = "Please point to a character." end if // JavaScript syntax if (_mouse.mouseChar == -1) { member("Instructions").text = "Please point to a character.
// JavaScript syntax function mouseEnter() { if (_mouse.mouseDown) { runMouseDownScript(); } else { runMouseUpScript(); } } See also Mouse, on mouseDown (event handler), mouseH, mouseUp, on mouseUp (event handler), mouseV mouseDownScript Usage the mouseDownScript Description System property; specifies the Lingo that is executed when the mouse button is pressed. The Lingo is written as a string, surrounded by quotation marks and can be a simple statement or a calling script for a handler.
mouseH Usage -- Lingo syntax _mouse.mouseH // JavaScript syntax _mouse.mouseH; Description Mouse property; indicates the horizontal position of the mouse pointer. Read-only. The value of mouseH is the number of pixels the cursor is positioned from the left edge of the Stage. The mouseH property is useful for moving sprites to the horizontal position of the mouse pointer and checking whether the pointer is within a region of the Stage.
mouseItem Usage -- Lingo syntax _mouse.mouseItem // JavaScript syntax _mouse.mouseItem; Description Mouse property; contains the number of the item under the pointer when the property is called and the pointer is over a field sprite. Read-only. An item is any sequence of characters delimited by the current delimiter as set by the property. Counting starts at the beginning of the field. If the mouse pointer is not over a field, the result is -1.
mouseLevel Usage -- Lingo syntax spriteObjRef.mouseLevel // JavaScript syntax spriteObjRef.mouseLevel; Description QuickTime sprite property; controls how Director passes mouse clicks on a QuickTime sprite to QuickTime. The ability to pass mouse clicks within the sprite’s bounding rectangle can be useful for interactive media such as QuickTime VR. The mouseLevel sprite property can have these values: • • • • #controller—Passes clicks only on the movie controller to QuickTime.
mouseLine Usage -- Lingo syntax _mouse.mouseLine // JavaScript syntax _mouse.mouseLine; Description Mouse property; contains the number of the line under the pointer when the property is called and the pointer is over a field sprite. Read-only. Counting starts at the beginning of the field; a line is defined by Return delimiter, not by the wrapping at the edge of the field. When the mouse pointer is not over a field sprite, the result is -1.
mouseLoc Usage -- Lingo syntax _mouse.mouseLoc // JavaScript syntax _mouse.mouseLoc; Description Mouse property; returns the current position of the mouse as a point(). Read-only. The point location is given as two coordinates, with the horizontal location first, then the vertical location. Example The following statement displays the current position of the mouse. -- Lingo syntax trace(_mouse.mouseLoc) // JavaScript syntax trace(_mouse.
Example The following statement checks whether the cast member Off Limits is the cast member assigned to the sprite under the pointer and displays an alert if it is. This example shows how you can specify an action based on the cast member assigned to the sprite. -- Lingo syntax if (_mouse.mouseMember = member("Off Limits")) then _player.alert("Stay away from there!") end if // JavaScript syntax if (_mouse.mouseMember = member("Off Limits")) { _player.
_movie.updatestage() end // JavaScript syntax function enterFrame() { switch(sprite(3).mouseOverButton) case 1: member("Message Line").text = "Click here to go to the next page."; break; case 0: member("Message Line").text = " "; break; } _movie.updatestage(); } mouseUp Usage -- Lingo syntax _mouse.mouseUp // JavaScript syntax _mouse.mouseUp; Description Mouse property; indicates whether the mouse button is released (TRUE) or is being pressed (FALSE). Read-only.
See also Mouse, mouseDown, mouseH, mouseV mouseUpScript Usage the mouseUpScript Description System property; determines the Lingo that is executed when the mouse button is released. The Lingo is written as a string, surrounded by quotation marks, and can be a simple statement or a calling script for a handler. When the mouse button is released and the mouseUpScript property is defined, Lingo executes the instructions specified for the mouseUpScript property first.
Description Mouse property; indicates the vertical position of the mouse cursor, in pixels, from the top of the Stage. Read-only. The value of this property increases as the cursor moves down and decreases as the cursor moves up. The mouseV property is useful for moving sprites to the vertical position of the mouse cursor and checking whether the cursor is within a region of the Stage. Using the mouseH and mouseV properties together, you can identify the cursor’s exact location.
Description Mouse property; contains the number of the word under the pointer when the property is called and when the pointer is over a field sprite. Read-only. Counting starts from the beginning of the field. When the mouse is not over a field, the result is -1. The value of the mouseWord property can change in a handler or loop. If a handler or loop uses this property multiple times, it’s usually a good idea to call the function once and assign its value to a local variable.
Note: For more customized control such as snapping back to the origin or animating while dragging, create a behavior to manage the additional functionality. This property can be tested and set. Example This handler makes sprites in channel 5 moveable: on spriteMove sprite(5).moveableSprite = TRUE end This statement checks whether a sprite is moveable and, if it is not, displays a message: if sprite(13).moveableSprite = FALSE then member("Notice").text = "You can’t drag this item by using the mouse.
Example This statement plays the sound file Music in sound channel 2 if the computer supports more than one sound channel: if the multiSound then sound playFile 2, "Music.wav" name Usage -- Lingo syntax castObjRef.name memberObjRef.name _movie.name windowObjRef.name // JavaScript syntax castObjRef.name; memberObjRef.name; _movie.name; windowObjRef.name; Description Cast, Member, Movie, and Window property; returns or sets the name of an object.
All names must be unique. If created through Lingo, the name returned is the name given in the constructor function. If created through a 3D-authoring program the name returned may be the name of the model. Example This statement sets the name of the fifth camera in the cast member TableScene to BirdCam: member("TableScene").camera[5].
Example This statement sets the variable itemName to the name of the eighth item in the Edit menu: set itemName = the name of menuItem(8) of menu("Edit") This statement causes a specific filename to follow the word Open in the File menu: the name of menuItem("Open") of menu("fileMenu") = "Open" && fileName See also name (menu property), number (menu items) name (Sprite) Usage -- Lingo syntax spriteObjRef.name // JavaScript syntax spriteObjRef.
// JavaScript syntax spriteChannelObjRef.name; Description Sprite Channel property; identifies the name of a sprite channel. Read/write during a Score recording session only. Set the name of a sprite channel during a Score recording session—between calls to the Movie object’s beginRecording() and endRecording() methods. Note: Starting a Score recording session using beginRecording() resets the properties of all scripted sprites and sprite channels.
See also forget() (Timeout), new(), period, persistent, target, time (timeout object), timeout(), timeoutHandler, timeoutList name (XML) Usage XMLnode.name Description XML property; returns the name of the specified XML node. Example Beginning with this XML: element 2 element 3 This Lingo returns the name of the second tag that is nested within the tag : put gParserObject.child[1].child[2].
nearFiltering Usage member(whichCastmember).texture(whichTexture).nearFiltering member(whichCastmember).shader(whichShader).\ texture(whichTexture).nearFiltering member(whichCastmember).model(whichModel).shader.texture\ (whichTexture).nearFiltering member(whichCastmember).model(whichModel).shaderList\ [shaderListIndex].texture(whichTexture).
_player.alert("Sorry, the Network Support Xtras could not be found.
netThrottleTicks Usage -- Lingo syntax _player.netThrottleTicks // JavaScript syntax _player.netThrottleTicks; Description Player property; in the Macintosh authoring environment, allows you to control the frequency of servicing to a network operation. Read/write. The default value is 15. The higher the value is set, the smoother the movie playback and animation is, but less time is spent servicing any network activity.
To avoid a performance penalty, set a callback property only when necessary. This property can be tested and set. nodeExitCallback Usage -- Lingo syntax spriteObjRef.nodeExitCallback // JavaScript syntax spriteObjRef.nodeExitCallback; Description QuickTime VR sprite property; contains the name of the handler that runs when the QuickTime VR movie is about to switch to a new active node on the Stage.
normalList Usage member(whichCastmember).modelResource(whichModelResource).\ normalList model.meshDeform.mesh[index].normalList Description 3D property; when used with a model resource whose type is #mesh, this property allows you to get or set the normalList property of the model resource. The normalList property is a linear list of vectors from which you may specify vertex normals when building the faces of your mesh.
Example This statement sets the normals property of the fifth face of the model resource named Player to a list of integer values: member(“3D”).modelResource(“Player”).face[5].normals = [2,32,14] See also face, normalList, vertices number (Cast) Usage -- Lingo syntax castObjRef.number // JavaScript syntax castObjRef.number; Description Cast library property; returns the number of a specified cast library. Read-only.
Example This statement displays the number of characters in the string “Macromedia, the Multimedia Company” in the Message window: put the number of chars in "Macromedia, the Multimedia Company" The result is 34. This statement sets the variable charCounter to the number of characters in the word i located in the string Names: charCounter = the number of chars in member("Names").word[i] You can accomplish the same thing with text cast members using the syntax: charCounter = member("Names").word[i].char.
number (lines) Usage the number of lines in chunkExpression Description Chunk expression; returns a count of the lines in a chunk expression. (Lines refers to lines delimited by carriage returns, not lines formed by line wrapping.) Chunk expressions are any character, word, item, or line in any container of characters. Containers include field cast members and variables that hold strings, and specified characters, words, items, lines, and ranges in containers.
// JavaScript syntax var whichCastMember = member("Power Switch").number; This statement assigns the cast member Red Balloon to sprite 1: -- Lingo syntax sprite(1).member = member("Red Balloon").number // JavaScript syntax sprite(1).member = member("Red Balloon").number; This verifies that a cast member actually exists before trying to switch the cast member in the sprite: -- Lingo syntax property spriteNum on mouseUp me if (member("Mike’s face").number > 0) then sprite(spriteNum).
number (menu items) Usage the number of menuItems of menu whichMenu Description Menu property; indicates the number of menu items in the custom menu specified by whichMenu. The whichMenu parameter can be a menu name or menu number. This menu property can be tested but not set. Use the installMenu command to set up a custom menu bar. Note: Menus are not available in Shockwave Player.
number (system) Usage the number of castLibs Description System property; returns the number of casts that are in the current movie. This property can be tested but not set. Example This repeat loop uses the Message window to display the number of cast members that are in each of the movie’s casts: repeat with n = 1 to the number of castLibs put castLib(n).name && "contains" && the number of \ members of castLib(n) && "cast members.
number of members Usage the number of members of castLib whichCast Description Cast member property; indicates the number of the last cast member in the specified cast. This property can be tested but not set. Example The following statement displays in the Message window the type of each cast member in the cast Central Casting. The number of members of castLib property is used to determine how many times the loop repeats.
Example This example assigns the number of sound channels of the SWA streaming cast member Duke Ellington to the field cast member Channel Display: -- Lingo syntax myVariable = member("Duke Ellington").numChannels if myVariable = 1 then member("Channel Display").text = "Mono" else member("Channel Display").text = "Stereo" end if // JavaScript syntax var myVariable = member("Duke Ellington").numChannels; if (myVariable = 1) { member("Channel Display").text = "Mono"; } else { member("Channel Display").
The smoothness of the cylinder’s surface depends upon the value specified for this property. The greater the property value the smoother the cylinder’s surface will appear. Example This statement sets the numSegments property of the model resource named Cylinder03 to 10: member("3D World").modelResource("Cylinder03").numSegments = 10 obeyScoreRotation Usage member(flashMember).
In Windows, optionDown does not work in projectors if Alt is pressed without another nonmodifier key. Avoid using optionDown if you intend to distribute a movie as a Windows projector and need to detect only the modifier key press; use controlDown or shiftDown instead. On the Macintosh, pressing the Option key changes the key value, so use keyCode instead.
member("User Info").text = displayString; } See also Player originalFont Usage -- Lingo syntax memberObjRef.originalFont // JavaScript syntax memberObjRef.originalFont; Description Font cast member property; returns the exact name of the original font that was imported when the given cast member was created. Example This statement displays the name of the font that was imported when cast member 11 was created: -- Lingo syntax put(member(11).originalFont) // JavaScript syntax put(member(11).
Example This sprite script uses the originMode property to set up a Flash movie sprite so it’s origin point can be set to a specific point. It then sets the horizontal and vertical origin points. -- Lingo syntax property spriteNum on beginSprite me sprite(spriteNum).originMode = #point sprite(spriteNum).originH = 100 sprite(spriteNum).originV = 80 end // JavaScript syntax function beginSprite() { sprite(this.spriteNum).originMode = symbol("point"); sprite(this.spriteNum).originH = 100; sprite(this.
Example This sprite script uses the originMode property to set up a Flash movie sprite so its origin point can be set to a specific point. It then sets the horizontal and vertical origin points. -- Lingo syntax property spriteNum on beginSprite me sprite(spriteNum).originMode = #point sprite(spriteNum).originH = 100 sprite(spriteNum).originV = 80 end // JavaScript syntax function beginSprite() { sprite(this.spriteNum).originMode = symbol("point"); sprite(this.spriteNum).originH = 100; sprite(this.
Example This sprite script uses the originMode property to set up a Flash movie sprite so its origin point can be set to a specific point. It then sets the origin points. -- Lingo syntax property spriteNum on beginSprite me sprite(spriteNum).scaleMode = #showAll sprite(spriteNum).originMode = #point sprite(spriteNum).originPoint = point(100, 80) end // JavaScript syntax function beginSprite() { sprite(this.spriteNum).scaleMode = symbol("showAll"); sprite(this.spriteNum).
Example This sprite script uses the originMode property to set up a Flash movie sprite so its origin point can be set to a specific point. It then sets the horizontal and vertical origin points. -- Lingo syntax property spriteNum on beginSprite me sprite(spriteNum).scaleMode = #showAll sprite(spriteNum).originMode = #point sprite(spriteNum).originH = 100 sprite(spriteNum).originV = 80 end // JavaScript syntax function beginSprite() { sprite(this.spriteNum).scaleMode = symbol("showAll"); sprite(this.
overlay Usage member(whichCastmember).camera(whichCamera).\ overlay[overlayIndex].propertyName member(whichCastmember).camera(whichCamera).overlay.count Description 3D camera property; allows both get and set access to the properties of overlays contained in the camera’s list of overlays to be displayed. When used as overlay.count this property returns the total number of overlays contained in the camera’s list of overlays to be displayed.
Example This statement returns the height of the visible portion of the field cast member Today’s News: --Lingo syntax trace(member("Today's News").pageHeight) // JavaScript syntax trace(member("Today's News").pageHeight); palette Usage -- Lingo syntax memberObjRef.palette // JavaScript syntax memberObjRef.palette; Description Cast member property; for bitmap cast members only, determines which palette is associated with the cast member specified by whichCastMember. This property can be tested and set.
The colors of the nonmatching bitmap will be close to the original colors. Remapping consumes processor time, and it’s usually better to adjust the bitmap’s palette in advance. Remapping can also produce undesirable results. If the palette changes in the middle of a sprite span, the bitmap immediately remaps to the new palette and appears in the wrong colors.
The range of values is from -100 to 100. -100 indicates only the left channel is heard. 100 indicate only the right channel is being heard. A value of 0 indicates even left/right balance, causing the sound source to appear to be centered. For mono sounds, pan affects which speaker (left or right) the sound plays through. You can change the pan of a sound object at any time, but if the sound channel is currently performing a fade, the new pan setting doesn’t take effect until the fade is complete.
See also line...of parent Usage member(whichCastmember).model(whichModel).parent member(whichCastmember).camera(whichCamera).parent member(whichCastmember).light(whichLight).parent member(whichCastmember).group(whichGroup).parent Description 3D property; when used with a model, camera, light or group reference, this property allows you to get or set the parent node of the referenced object. The parent node can be any other model, camera, light or group object.
Example The following examples show that the password has been set for the RealMedia stream in the cast member Real or sprite 2. -- Lingo syntax put(sprite(2).password) -- "********" put(member("Real").password) -- "********" // JavaScript syntax put(sprite(2).password); // "********" put(member("Real").password); // "********" The following examples show that the password has never been set for the RealMedia stream in the cast member Real or sprite 2. -- Lingo syntax put(sprite(2).
Example This statement displays the pathname for the folder containing the current movie: -- Lingo syntax trace(_movie.path) // JavaScript syntax trace(_movie.path); This statement plays the sound file Crash.aif stored in the Sounds subfolder of the current movie’s folder: -- Lingo syntax sound(1).playFile(_movie.path & "Sounds\Crash.aif") // JavaScript syntax sound(1).playFile(_movie.path + "Sounds\\Crash.aif"); See also Movie path (3D) Usage member(whichCastmember).modelResource(whichModelResource).
Setting the path of an unlinked cast member converts it to a linked cast member. This property can be tested and set. The pathName property of an unlinked member is an empty string. This property is the same as the fileName property for other member types, and you can use fileName instead of pathName.
pattern Usage member(whichCastMember).pattern the pattern of member whichCastMember Description Cast member property; determines the pattern associated with the specified shape. Possible values are the numbers that correspond to the swatches in the Tools window’s patterns palette. If the shape cast member is unfilled, the pattern is applied to the cast member’s outer edge.
pausedAtStart (RealMedia, Windows Media) Usage -- Lingo syntax memberOrSpriteObjRef.pausedAtStart // JavaScript syntax memberOrSpriteObjRef.pausedAtStart; Description RealMedia and Windows Media sprite or cast member property; allows you to get or set whether a RealMedia or Windows Media stream on the Stage automatically begins to play when buffering is complete (FALSE or 0) or remains paused (TRUE or 1). Read/write. This property can be set to an expression that evaluates to TRUE or FALSE.
The following example uses the pausedAtStart property to buffer a RealMedia sprite off the Stage, and then play it on the Stage once the buffering is complete. In this example, the RealMedia member has its pausedAtStart property set to TRUE. An instance of this member is positioned off the Stage, in sprite channel 1. The following frame script should be placed in the sprite span: -- Lingo syntax on exitFrame me if sprite(1).state sprite(1).locH = sprite(1).locV = sprite(1).
Example The following examples show that 56% of the RealMedia stream in sprite 2 and the cast member Real has been buffered. -- Lingo syntax put(sprite(2).percentBuffered) -- 56 put(member("Real").percentBuffered) -- 56 // JavaScript syntax put(sprite(2).percentBuffered); // 56 put(member("Real").percentBuffered); // 56 See also mediaStatus (RealMedia, Windows Media), pausedAtStart (RealMedia, Windows Media), state (RealMedia) percentPlayed Usage member(whichCastMember).
Example This statement shows that the cast member PartyScene has finished loading. put member("PartyScene").percentStreamed -- 100 percentStreamed (Member) Usage -- Lingo syntax memberOrSpriteObjRef.percentStreamed // JavaScript syntax memberOrSpriteObjRef.percentStreamed; Description Shockwave Audio (SWA) and Flash cast member property, and QuickTime sprite property. For SWA streaming sounds, gets the percent of a SWA file already streamed from an HTTP or FTP server.
This frame script keeps the playhead looping in the current frame so long as less than 60 percent of a Flash movie called Splash Screen has streamed into memory: -- Lingo syntax on exitFrame if member("Splash Screen").percentStreamed < 60 then _movie.go(_movie.frame) end if end // JavaScript syntax function exitFrame() { var ssStrm = member("Splash Screen").percentStreamed; if (ssStrm < 60) { _movie.go(_movie.frame); } } See also percentPlayed period Usage timeoutObject.
Setting this property to TRUE allows a timeout object to continue generating timeout events in other movies. This is useful when one movie branches to another with the go to movie command. Example This prepareMovie handler creates a timeout object that will remain active after the declaring movie stops playing: on prepareMovie -- Make a timeout object that sends an event every 60 minutes. timeout("reminder").new(1000 * 60 * 60, #handleReminder) timeout("reminder").
picture (Window) Usage -- Lingo syntax windowObjRef.picture // JavaScript syntax windowObjRef.picture; Description Window property; provides a way to get a picture of the current contents of a window—either the Stage window or a movie in a window (MIAW). Read-only. You can apply the resulting bitmap data to an existing bitmap or use it to create a new one. If no picture exists, this property returns VOID (Lingo) or null (JavaScript syntax).
Example This statement checks whether a projector was created for Windows 95 or Windows NT: on exitFrame if the platform contains "Windows,32" then castLib("Win95 Art").name = "Interface" end if end See also runMode playBackMode Usage -- Lingo syntax memberOrSpriteObjRef.playBackMode // JavaScript syntax memberOrSpriteObjRef.
playing Usage -- Lingo syntax spriteObjRef.playing // JavaScript syntax spriteObjRef.playing; Description Flash sprite property; indicates whether a Flash movie is playing (TRUE) or stopped (FALSE). This property can be tested but not set. Example This frame script checks to see if the Flash movie sprite in channel 5 is playing and, if it is not, starts the movie: -- Lingo syntax on enterFrame if not sprite(5).playing then sprite(5).
playlist Usage member(whichCastmember).model(whichModel).keyframePlayer.playlist member(whichCastmember).model(whichModel).bonesPlayer.playlist Description 3D #keyframePlayer and #bonesPlayer modifier property; returns a linear list of property lists, each representing a motion queued for playback by the modifier. Each property list will have the following properties: • • • • • is the name of the motion to be played. indicates whether the motion’s playback should be looped.
Example This statement sets the playRate property of the keyframePlayer modifier for the model named GreenAlien to 3: member("newAliens").model("GreenAlien").keyframePlayer.playRate = 3 See also play() (3D), queue() (3D), playlist, currentTime (3D) playRate (DVD) Usage -- Lingo syntax dvdObjRef.playRate // JavaScript syntax dvdObjRef.playRate; Description DVD property; specifies the rate at which a DVD plays forward or backward from the current location. Read/write.
Example This statement sets the rate for a digital video in sprite channel 9 to normal playback speed: -- Lingo syntax sprite(9).playRate = 1 // JavaScript syntax sprite(9).playRate = 1; This statement causes the digital video in sprite channel 9 to play in reverse: -- Lingo syntax sprite(9).playRate = -1 // JavaScript syntax sprite(9).playRate = -1; See also duration (Member), currentTime (QuickTime, AVI) playRate (Windows Media) Usage -- Lingo syntax windowsMediaObjRef.
pointAtOrientation Usage member(whichCastmember).model(whichModel).pointAtOrientation member(whichCastmember).group(whichGroup).pointAtOrientation member(whichCastmember).light(whichLight).pointAtOrientation member(whichCastmember).camera(whichCamera).pointAtOrientation Description 3D model, light, group and camera property; allows you to get or set how the referenced object responds to the pointAt command.
Example This example has two parts. The first part is the first line of code, which registers the #explode handler for the #collideAny event. The second part is the #explode handler. When two models in the cast member MyScene collide, the #explode handler is called and the collisionData argument is sent to it. The first nine lines of the #explode handler create the model resource named SparkSource and set its properties. This model resource is a single burst of particles.
Example The following statement displays the parent-relative position of the model named Tire. put member("scene").model("Tire").transform.position -- vector(-15.000, -2.5000, 20.0000) The following statement displays the world-relative position of the model named Tire. put member("scene").model("Tire").getWorldTransform().position -- vector(5.0000, -2.5000, -10.
posterFrame Usage -- Lingo syntax memberObjRef.posterFrame // JavaScript syntax memberObjRef.posterFrame; Description Flash cast member property; controls which frame of a Flash movie cast member is used for its thumbnail image. This property specifies an integer corresponding to a frame number in the Flash movie. This property can be tested and set. The default value is 1.
• • #software specifies the Director built-in software renderer that works with both Macintosh and Windows platforms. #auto specifies that the most suitable renderer should be chosen. This is the default value for this property. The value set for this property is used as the default for the Renderer Services object’s property.
See also state (3D) preLoad (Member) Usage -- Lingo syntax memberObjRef.preLoad // JavaScript syntax memberObjRef.preLoad; Description Cast member property; determines whether the digital video cast member specified by whichCastMember can be preloaded into memory (TRUE) or not (FALSE, default). The TRUE status has the same effect as selecting Enable Preload in the Digital Video Cast Member Properties dialog box.
Example This statement lets the user stop the preloading of cast members by pressing keys or clicking the mouse button: -- Lingo syntax _movie.preLoadEventAbort = TRUE // JavaScript syntax _movie.preLoadEventAbort = true; See also Movie preLoadMode Usage -- Lingo syntax castObjRef.preLoadMode // JavaScript syntax castObjRef.preLoadMode; Description Cast library property; determines the preload mode of a specified cast library. Read/write. Valid values of preLoadMode are: • 0.
preLoadRAM Usage the preLoadRAM Description System property; specifies the amount of RAM that can be used for preloading a digital video. This property can be set and tested. This property is useful for managing memory, limiting digital video cast members to a certain amount of memory, so that other types of cast members can still be preloaded. When preLoadRAM is FALSE, all available memory can be used for preloading digital video cast members.
Example The following handler sets the preload download time for the SWA streaming cast member Louis Armstrong to 6 seconds. The actual preload occurs when a preLoadBuffer or play command is issued. -- Lingo syntax on mouseDown member("Louis Armstrong").stop() member("Louis Armstrong").preLoadTime = 6 end // JavaScript syntax function mouseDown() { member("Louis Armstrong").stop(); member("Louis Armstrong").
Example This statement displays in the Message window the name of the Director application. -- Lingo syntax trace(_player.productName) // JavaScript syntax trace(_player.productName); See also Player productVersion Usage -- Lingo syntax _player.productVersion // JavaScript syntax _player.productVersion; Description Player property; returns the version number of the Director application. Read-only. Example This statement displays in the Message window the version of the Director application.
When projection is #orthographic, the apparent size of objects does not depend on distance from the camera, and the orthoHeight property specifies how many world units fit vertically into the sprite (which determines how much of the world you see). The orthographic projection width is determined by the aspect ratio of the camera's rect property. Example This statement sets the projection property of the camera of sprite 5 to #orthographic: sprite(5).camera.
See also Member quad Usage -- Lingo syntax spriteObjRef.quad // JavaScript syntax spriteObjRef.quad; Description Sprite property; contains a list of four points, which are floating point values that describe the corner points of a sprite on the Stage. Read/write. The points of the quad are organized in the following order: upper left, upper right, lower right, and lower left. The points themselves can be manipulated to create perspective and other image distortions.
quality Usage -- Lingo syntax memberOrSpriteObjRef.quality // JavaScript syntax memberOrSpriteObjRef.quality; Description Flash cast member and sprite property; controls whether Director uses anti-aliasing to render a Flash movie sprite, producing high-quality rendering but possibly slower movie playback. The quality property can have these values: • • • • #autoHigh—Director starts by rendering the sprite with anti-aliasing.
quality (3D) Usage member(whichCastmember).texture(whichTexture).quality member(whichCastmember).shader(whichShader).texture\ (whichTexture).quality member(whichCastmember).model(whichModel).shader.texture\ (whichTexture).quality member( whichCastmember ).model( whichModel ).\ shader.texturelist[TextureListIndex].quality member(whichCastmember).model(whichModel).shaderList\ [shaderListIndex]. texture(whichTexture).quality member( whichCastmember ).model( whichModel ).shaderList\ [ shaderListIndex ].
Example This example shows that the radius of the model resource Sphere01 is 24.0: put member("3D World").modelResource("Sphere01").radius -- 24.0 randomSeed Usage the randomSeed Description System property; specifies the seed value used for generating random numbers accessed through the random() function. Using the same seed produces the same sequence of random numbers. This property can be useful for debugging during development.
The command creates a Shock Font in whichCastMember using the font named in the font argument. The value returned from the command reports whether the operation was successful. Zero indicates success.
rect (Image) Usage -- Lingo syntax imageObjRef.rect // JavaScript syntax imageObjRef.rect; Description Image property. Returns a rectangle describing the size of a given image. Read-only. The returned rectangle coordinates are given relative to the top left corner of the image. Therefore, the left and top values of the rectangle are 0, and the right and bottom values are the width and height of the cast member.
rect (Member) Usage -- Lingo syntax memberObjRef.rect // JavaScript syntax memberObjRef.rect; Description Member property; specifies the left, top, right, and bottom coordinates, returned as a rectangle, for the rectangle of any graphic cast member, such as a bitmap, shape, movie, or digital video. Read-only for all cast members, read/write for field cast members only.
Example This statement displays the coordinates of bitmap sprite 20: -- Lingo syntax put(sprite(20).rect) // JavaScript syntax put(sprite(20).rect); See also rect(), Sprite rect (Window) Usage -- Lingo syntax windowObjRef.rect // JavaScript syntax windowObjRef.rect; Description Window property; specifies the left, top, right, and bottom coordinates, as a rectangle, of a window. Read/write.
Example Without references, you would need statements like these: member(whichTextMember).line[whichLine].word[firstWord..lastWord].font = "Palatino" member(whichTextMember).line[whichLine].word[firstWord..lastWord].fontSize = 36 member(whichTextMember).line[whichLine].word[firstWord..lastWord].fontStyle = [#bold] But with a ref property, you can refer to the same chunk as follows: myRef = member(whichTextMember).line[whichLine].word[firstWord..lastWord].
See also textureModeList, blendFunctionList, blendConstantList reflectivity Usage member(whichCastmember).reflectivity Description 3D shader property; allows you to get or set the shininess of the referenced member’s default shader. The value is a floating point value representing the percentage of light to be reflected off the surface of a model using the default shader, from 0.0 to 100.00. The default value is 0.0.
regPoint Usage -- Lingo syntax memberObjRef.regPoint // JavaScript syntax memberObjRef.regPoint; Description Member property; specifies the registration point of a cast member. Read/write. The registration point is listed as the horizontal and vertical coordinates of a point in the form point(horizontal, vertical). Nonvisual members such as sounds do not have a useful regPoint property.
regPoint (3D) Usage sprite(whichSprite).camera.backdrop[backdropIndex].regPoint member(whichCastmember).camera(whichCamera).backdrop [backdropIndex].regPoint Description 3D backdrop and overlay property; allows you to get or set the registration point of the backdrop or overlay. The registration point represents the x, y, and z coordinates of the center of the backdrop or overlay in 3D space. The default value for this property is point(0,0).
renderer Usage getRendererServices().renderer Description 3D property; allows you to get or set the current renderer in use by a movie. The range of values for this property is determined by the list of available renderers returned by the Renderer Services object’s rendererDeviceList property. Shockwave Player users have the option of specifying the renderer of their choice using the 3D Renderer context menu in Shockwave Player.
Example This statement shows the renderers available on the current system: put getRendererServices().rendererDeviceList -- [#openGL, #software] See also getRendererServices(), renderer, preferred3dRenderer, active3dRenderer renderFormat Usage member(whichCastmember).texture(whichTexture).renderFormat member(whichCastmember).texture[index].renderFormat member(whichCastmember).shader(whichShader).texture.renderFormat member(whichCastmember).model(whichModel).shader.texture\ .
See also textureRenderFormat, getHardwareInfo() renderStyle Usage member(whichCastmember).shader(whichShader).renderStyle Description 3D standard shader property; allows you to get or set the renderStyle for a shader, as determined by the geometry of the underlying model resource. This property has the following values: #fill specifies that the shader is drawn to completely fill the surface area of the model resource.
See also Window resolution (3D) Usage member(whichCastmember).modelResource(whichModelResource).resolution Description 3D property; allows you to get or set the resolution property of a model resource whose type is either #sphere or #cylinder. Resolution controls the number of polygons used to generate the geometry of the model resource. A larger value generates more polygons and thus results in a smoother surface. The default value of this property is 20.
resolve Usage member(whichCastmember).model(whichModel).collision.resolve Description 3D collision property; allows you to get or set whether collisions are resolved when two models collide. If this property is set to TRUE for both models involved in a collision, both models come to a stop at the point of collision. If only one of the models has the resolve property set to TRUE, that model comes to a stop, and the model with the property not set, or set to FALSE, continues to move.
right Usage -- Lingo syntax spriteObjRef.right // JavaScript syntax spriteObjRef.right; Description Sprite property; indicates the distance, in pixels, of a sprite’s right edge from the left edge of the Stage. Read/write. Sprite coordinates are expressed relative to the upper left corner of the Stage. Example This statement returns the distance of a sprite’s right edge: -- Lingo syntax put(sprite(6).right) // JavaScript syntax put(sprite(6).
rightIndent Usage chunkExpression.rightIndent Description Text cast member property; contains the offset distance, in pixels, of the right margin of chunkExpression from the right side of the text cast member. The value is an integer greater than or equal to 0. This property can be tested and set. See also firstIndent, leftIndent rightMouseDown Usage -- Lingo syntax _mouse.rightMouseDown // JavaScript syntax _mouse.
rightMouseUp Usage -- Lingo syntax _mouse.rightMouseUp // JavaScript syntax _mouse.rightMouseUp; Description Mouse property; indicates whether the right mouse button (Windows) or the mouse button and Control key (Macintosh) are currently not being pressed (TRUE) or are currently being pressed (FALSE). Read-only. On the Macintosh, rightMouseUp is TRUE only if the emulateMultiButtonMouse property is TRUE.
Example This statement sets romanLingo to TRUE, which causes Lingo to use a single-byte character set: set the romanLingo to TRUE See also inlineImeEnabled rootLock Usage member(whichCastmember).model(whichModel).keyframePlayer.rootLock member(whichCastmember).model(whichModel).bonesPlayer.rootLock Description 3D #keyframePlayer and #bonesPlayer modifier property; indicates whether the translational components of a motion are used (FALSE) or ignored (TRUE). The default value of this property is FALSE.
rotation Usage -- Lingo syntax spriteObjRef.rotation // JavaScript syntax spriteObjRef.rotation; Description Sprite property; controls the rotation of a QuickTime movie, animated GIF, Flash movie, or bitmap sprite within a sprite’s bounding rectangle, without rotating that rectangle or the sprite’s controller (in the case of QuickTime). Read/write. In effect, the sprite’s bounding rectangle acts as a window through which you can see the Flash or QuickTime movie.
The following frame script keeps the playhead looping in the current frame while it rotates a QuickTime sprite in channel 5 a full 360° in 16° increments. When the sprite has been rotated 360°, the playhead continues to the next frame. -- Lingo syntax on rotateMovie(whichSprite) repeat with i = 1 to 36 sprite(whichSprite).rotation = i * 10 _movie.updateStage() end repeat end // JavaScript syntax function rotateMovie(whichSprite) { for (var i = 1; i <= 36; i++) { sprite(whichSprite).
rotation (engraver shader) Usage member(whichCastmember).shader(whichShader).rotation member(whichCastmember).model(whichModel).shader.rotation member(whichCastmember).model(whichModel).shaderList[index].rotation Description 3D shader engraver property; allows you to get or set an angle in degrees (as a floating-point number) that describes a 2D rotational offset for engraved lines. The default value for this property is 0.0.
This example displays the parent-relative rotation of the model named Moon, then it adjusts the model’s orientation using the rotate command, and finally it displays the resulting world-relative rotation of the model: put member(“SolarSys”).model(“Moon”).transform.rotation -- vector( 0.0000, 0.0000, 45.0000) member(“SolarSys”).model(“Moon”).rotate(15,15,15) put member(“SolarSys”).model(“Moon”).getWorldTransform().rotation --vector( 51.3810, 16.5191, 65.
Example This statement displays in the Message window the RTF formatting information embedded in the text cast member Resume: --Lingo syntax put(member("Resume").RTF) // JavaScript syntax trace(member("Resume").RTF); See also HTML, importFileInto() safePlayer Usage -- Lingo syntax _player.safePlayer // JavaScript syntax _player.safePlayer; Description Player property; controls whether or not safety features in Director are turned on. Read/write.
sampleCount Usage -- Lingo syntax soundChannelObjRef.sampleCount // JavaScript syntax soundChannelObjRef.sampleCount; Description Sound Channel property; specifies the number of sound samples in the currently playing sound in a sound channel. Read-only. This is the total number of samples, and depends on the sampleRate and duration of the sound. It does not depend on the channelCount of the sound. A 1-second, 44.1 KHz sound contains 44,100 samples.
When multiple sounds are queued in a sound channel, Director plays them all with the channelCount, sampleRate, and sampleSize of the first sound queued, resampling the rest for smooth playback. Director resets these properties only after the channel’s sound queue is exhausted or a stop() method is issued. The next sound to be queued or played then determines the new settings.
This statement displays the sample size of the sound playing in sound channel 1 in the Message window: -- Lingo syntax put(sound(1).sampleSize) // JavaScript syntax put(sound(1).sampleSize); scale (3D) Usage member(whichCastmember).camera(whichCamera).backdrop\ [backdropIndex].scale member(whichCastmember).camera(whichCamera).overlay\ [overlayIndex].
scale (Member) Usage -- Lingo syntax memberOrSpriteObjRef.scale // JavaScript syntax memberOrSpriteObjRef.scale; Description Cast member property and sprite property; controls the scaling of a QuickTime, vector shape, or Flash movie sprite. For QuickTime, this property does not scale the sprite’s bounding rectangle or the sprite’s controller. Instead, it scales the image around the image’s center point within the bounding rectangle.
} } See also scaleMode, originMode scale (transform) Usage member(whichCastmember).node(whichNode).transform.scale member(whichCastmember).node(whichNode).getWorldTransform().scale transform.scale Description 3D property; allows you to get or set the scaling component of a transform. A transform defines a scale, position and rotation within a given frame of reference. The scale property allows you to get and set the degree of scaling of the transform along each of the three axes.
• • • • • #showAll (default for Director movies prior to version 7)—Maintains the aspect ratio of the original Flash movie cast member. If necessary, fill in any gap in the horizontal or vertical dimension using the background color. #noBorder—Maintains the aspect ratio of the original Flash movie cast member. If necessary, crop the horizontal or vertical dimension. #exactFit—Does not maintain the aspect ratio of the original Flash movie cast member.
score Usage -- Lingo syntax _movie.score // JavaScript syntax _movie.score; Description Movie property; determines which Score is associated with the current movie. Read/write. This property can be useful for storing the current contents of the Score before wiping out and generating a new one or for assigning the current Score contents to a film loop. Example This statement assigns the film loop cast member Waterfall to the Score of the current movie: -- Lingo syntax _movie.score = member("Waterfall").
scoreSelection Usage -- Lingo syntax _movie.scoreSelection // JavaScript syntax _movie.scoreSelection; Description Movie property; determines which channels are selected in the Score window. Read/write. The information is formatted as a linear list of linear lists. Each contiguous selection is in a list format consisting of the starting channel number, ending channel number, starting frame number, and ending frame number.
script Usage -- Lingo syntax _movie.script[scriptNameOrNum] // JavaScript syntax _movie.script[scriptNameOrNum]; Description Movie property; provides indexed or named access to the script cast members of a movie. Read-only. The scriptNameOrNum argument can be either a string that specifies the name of the script cast member or an integer that specifies the number of the script cast member.
// JavaScript syntax if (channel(5).scripted == false) { channel(5).makeScriptedSprite(member("kite")); } See also Sprite Channel scriptingXtraList Usage -- Lingo syntax _player.scriptingXtraList // JavaScript syntax _player.scriptingXtraList; Description Player property; returns a linear list of all scripting Xtra extensions available to the Director player. Read-only. The Xtra extensions are those that are present in the Configuration\Xtras folder.
Example This handler displays the list of script references attached to a sprite: on showScriptRefs spriteNum put sprite(spriteNum).scriptInstanceList end These statements attach the script Big Noise to sprite 5: x = script("Big Noise").new() sprite(5).scriptInstanceList.add(x) See also scriptNum, sendSprite() scriptList Usage sprite(whichSprite).scriptList the scriptList of sprite whichSprite Description Sprite property; returns the list of behaviors attached to the given sprite and their properties.
Example This statement displays the number of the script attached to sprite 4: put sprite(4).scriptNum See also scriptInstanceList scriptsEnabled Usage -- Lingo syntax memberObjRef.scriptsEnabled // JavaScript syntax memberObjRef.scriptsEnabled; Description Director movie cast member property; determines whether scripts in a linked movie are enabled (TRUE or 1) or disabled (FALSE or 0). This property is available for linked Director movie cast members only. This property can be tested and set.
Example This statement makes the contents of field cast member 20 the script of cast member 30: -- Lingo syntax member(20).text = member(30).scriptText // JavaScript syntax member(20).text = member(30).scriptText; See also Member scriptType Usage member whichScript.scriptType the scriptType of member whichScript Description Cast member property; indicates the specified script’s type. Possible values are #movie, #score, and #parent.
The global variable sliderVal could measure how far the user drags a slider. The statement set newVal = sliderVal * 100 multiplies sliderVal to give a value that is greater than the distance the user drags the slider. If sliderVal is positive, the text moves up; if sliderVal is negative, the text moves down. Example This repeat loop makes the field Credits scroll by continuously increasing the value of scrollTop: --Lingo syntax on wa member("Credits").
depth specifies the maximum number of levels of resolution that the model can display when using the sds modifier. error indicates the level of error tolerance for the subdivision surfaces functionality. This property applies only when the sds.subdivision property is set to #adaptive. subdivision indicates the mode of operation of the subdivision surfaces modifier.
// JavaScript syntax put(_player.searchCurrentFolder); See also Player searchPathList Usage -- Lingo syntax _player.searchPathList // JavaScript syntax _player.searchPathList; Description Player property; a list of paths that Director searches when trying to find linked media such as digital video, GIFs, bitmaps, or sound files. Read/write. Each item in the list of paths is a fully qualified pathname as it appears on the current platform at runtime.
// JavaScript syntax _player.searchPathList = list("Hard Drive:Director:Projects:", "CDROM:Sources:"); See also Player, searchCurrentFolder selectedButton Usage -- Lingo syntax dvdObjRef.selectedButton // JavaScript syntax dvdObjRef.selectedButton; Description DVD property; returns the index of the button that currently has focus. Read-only. See also DVD selectedText Usage -- Lingo syntax memberObjRef.selectedText // JavaScript syntax memberObjRef.
// JavaScript syntax function mouseUp() { var mySelectionObject = sprite(this.spriteNum).member.selectedText; trace(mySelectionObject.text); trace(mySelectionObject.font); trace(mySelectionObject.fontSize); trace(mySelectionObject.fontStyle); } selection Usage -- Lingo syntax castObjRef.selection // JavaScript syntax castObjRef.selection; Description Cast library property; returns the cast members that are selected in a given Cast window. Read/ write.
Example The following statement sets the selection displayed by the sprite of text member myAnswer so that characters 6 through 10 are highlighted: member("myAnswer").selection = [6, 10] See also color(), selStart, selEnd selEnd Usage -- Lingo syntax selEnd // JavaScript syntax selEnd; Description Cast member property; specifies the last character of a selection. It is used with selStart to identify a selection in the current editable field, counting from the beginning character.
selStart Usage -- Lingo syntax selStart // JavaScript syntax selStart; Description Cast member property; specifies the starting character of a selection. It is used with selEnd to identify a selection in the current editable field, counting from the beginning character. This property can be tested and set. The default value is 0.
Example This handler would be located in a movie script of a MIAW. It places the user’s name and the serial number into a display field when the window is opened: -- Lingo syntax on prepareMovie displayString = _player.userName & RETURN & _player.organizationName \ & RETURN & _player.serialNumber member("User Info").text = displayString end // JavaScript syntax function prepareMovie() { var displayString = _player.userName + "\n" + _player.organizationName + "\n" + _player.
Shaders are stored in the shader palette of the 3D cast member. They can be referenced by name (whichShader) or palette index (shaderIndex). A shader can be used by any number of models. Changes to a shader will appear in all models which use that shader. There are four types of shaders: #standard shaders present their textures realistically. #painter, #engraver, and #newsprint shaders stylize their textures for painting, engraving, and newsprint effects.
Set a property of all of the shaders of a model to the same value with this syntax (note the absence of an index for the shaderList): member(whichCastmember).model(whichModel).shaderList.\ whichProperty = propValue Example This statement sets the second shader in the shaderList of the model named Bumper to the shader named Chrome: member("Car").model("Bumper").shaderList[2] = \ member("Car").
shadowStrength Usage member(whichCastmember).model(whichModel).toon.shadowStrength member(whichCastmember).model(whichModel).shader.shadowStrength member(whichCastmember).shader(whichShader).shadowStrength Description 3D toon modifier and #painter shader property; indicates the brightness of the area of the model’s surface where light does not create highlights. The default value of this property is 1.0.
Example This statement checks whether the Shift key is being pressed and calls the handler doCapitalA if it is: -- Lingo syntax if (_key.shiftDown) then doCapitalA(_key.key) end if // JavaScript syntax if (_key.shiftDown) { doCapitalA(_key.key); } See also controlDown, Key, key, keyCode, optionDown shininess Usage member(whichCastmember).shader(whichShader).shininess member(whichCastmember).model(whichModel).shader.shininess member(whichCastmember).model(whichModel).shaderList\ [shaderListIndex].
Silhouette lines are similar to the lines that outline images in a child’s coloring book. The default value for this property is TRUE. Example The following statement sets the silhouettes property of the inker modifier for the model named Sphere to FALSE. Lines will not be drawn around the profile of the model. member("Shapes").model("Sphere").inker.silhouettes = FALSE size Usage -- Lingo syntax memberObjRef.size // JavaScript syntax memberObjRef.
Example In this example, mrFount is a model resource of the type #particle. This statement sets the sizeRange properties of mrFount. The first line sets the start value to 4, and the second line sets the end value to 1. The effect of this statement is that the particles of mrFount are size 4 when they first appear, and gradually shrink to a size of 1 during their lifetime. member("fountain").modelResource("mrFount").sizeRange.start = 4 member("fountain").modelResource("mrFount").sizeRange.
skew Usage -- Lingo syntax spriteObjRef.skew // JavaScript syntax spriteObjRef.skew; Description Sprite property; returns, as a float value in hundredths of a degree, the angle to which the vertical edges of the sprite are tilted (skewed) from the vertical. Read/write. Negative values indicate a skew to the left; positive values indicate a skew to the right. Values greater than 90° flip an image vertically. The Score can retain information for skewing an image from +21,474,836.47° to -21,474,836.
For more information about working with extruder model resources and text cast members, see extrude3D. Example In this example, the cast member Logo is a text cast member. This statement sets the smoothness of Logo to 8. When Logo is displayed in 3D mode, the edges of its letters will be very smooth. member("Logo").smoothness = 8 In this example, the model resource of the model Slogan is extruded text.
sound (Player) Usage -- Lingo syntax _player.sound[intSoundChannelNum] // JavaScript syntax _player.sound[intSoundChannelNum]; Description Player property; provides indexed access to a Sound Channel object by using a Player property. Read-only. The intSoundChannelNum argument is an integer that specifies the number of the sound channel to access. The functionality of this property is identical to the top level sound() method.
Example This statement tells the SWA streaming cast member Frank Zappa to play in sound channel 3: -- Lingo syntax member("Frank Zappa").soundChannel = 3 // JavaScript syntax member("Frank Zappa").soundChannel = 3; soundChannel (RealMedia) Usage -- Lingo syntax memberOrSpriteObjRef.soundChannel // JavaScript syntax memberOrSpriteObjRef.soundChannel; Description RealMedia sprite or cast member property; allows you to get or set the sound channel used to play the audio in the RealMedia stream.
The following examples assign sound channel 1 to the RealMedia stream in sprite 2 and the cast member Real. -- Lingo syntax sprite(2).soundChannel = 1 member("Real").soundChannel = 1 // JavaScript syntax sprite(2).soundChannel = 1; member("Real").soundChannel = 1; See also realPlayerNativeAudio() soundDevice Usage -- Lingo syntax _sound.soundDevice // JavaScript syntax _sound.soundDevice; Description Sound property; allows the sound mixing device to be set while the movie plays. Read/write.
soundDeviceList Usage -- Lingo syntax _sound.soundDeviceList // JavaScript syntax _sound.soundDeviceList; Description Sound property; creates a linear list of sound devices available on the current computer. Readonly. For the Macintosh, this property lists one device, MacSoundManager. Example This statement displays a typical sound device list on a Windows computer: -- Lingo syntax trace(_sound.soundDeviceList) // JavaScript syntax trace(_sound.
soundKeepDevice Usage -- Lingo syntax _sound.soundKeepDevice // JavaScript syntax _sound.soundKeepDevice; Description Sound property; for Windows only, determines whether the sound driver unloads and reloads each time a sound needs to play. Read/write. The default value of this property is TRUE, which prevents the sound driver from unloading and reloading each time a sound needs to play.
These values correspond to the settings in the Macintosh Sound control panel. Using this property, script can change the sound volume directly or perform some other action when the sound is at a specified level. To see an example of soundLevel used in a completed movie, see the Sound Control movie in the Learning/Lingo Examples folder inside the Director application folder. Example This statement sets the variable oldSound equal to the current sound level: -- Lingo syntax oldSound = _sound.
source Usage sprite(whichSprite).camera.backdrop[backdropIndex].source member(whichCastmember).camera(whichCamera).backdrop [backdropIndex].source sprite(whichSprite).camera.overlay[overlayIndex].source member(whichCastmember).camera(whichCamera).overlay [overlayIndex].source Description 3D backdrop and overlay property; allows you to get or set the texture to use as the source image for the overlay or backdrop. Example This statement sets the source of backdrop 1 to the texture Cedar: sprite(3).camera.
Example This statement displays the original coordinates of the Stage named Control_panel in the Message window: -- Lingo syntax put(window("Control_panel").sourceRect) // JavaScript syntax put(window("Control_panel").sourceRect); See also Window specular (light) Usage member(whichCastmember).light(whichLight).specular Description 3D light property; allows you to get or set whether specularity is on (TRUE) or off (FALSE).
Example put member("scene").shader("plutomat").specular -- rgb(11, 11, 11) See also silhouettes, specular (light), specularColor, emissive specularColor Usage member(whichCastmember).specularColor Description 3D cast member property; allows you to get or set the RGB value of the specular color of the first shader in the cast member. The first shader in the cast member’s shader palette is always the default shader.
All shaders have access to the #standard shader properties; in addition to these standard shader properties shaders of the types #engraver, #newsprint, and #painter have properties unique to their type. For more information, see the newShader. Example This statement sets the texture Oval as the specularLightMap of the shader used by the model GlassBox: member("3DPlanet").model("GlassBox").shader.specularLightMap = \ member("3DPlanet").
sprite (Movie) Usage -- Lingo syntax _movie.sprite[spriteNameOrNum] // JavaScript syntax _movie.sprite[spriteNameOrNum]; Description Movie property; provides indexed or named access to a movie sprite. Read-only. The spriteNameOrNum argument can be either a string that specifies the name of the sprite or an integer that specifies the number of the sprite. Example The following statement sets the variable sportSprite to the movie sprite 5: -- Lingo syntax sportSprite = _movie.
spriteNum Usage -- Lingo syntax spriteObjRef.spriteNum // JavaScript syntax spriteObjRef.spriteNum; Description Sprite property; determines the channel number the behavior’s sprite is in and makes it available to any behaviors. Read-only. Simply declare the property at the top of the behavior, along with any other properties the behavior may use. If you use a new() handler to create an instance of the behavior, the script’s new() handler must explicitly set the spriteNum property to the sprite’s number.
This approach allows the use of the reference pMySpriteRef later in the script, with the handler using the syntax: -- Lingo syntax currMember = pMySpriteRef.member // JavaScript syntax var currMember = pMySpriteRef.member instead of the following syntax which is somewhat longer: -- Lingo syntax currMember = sprite(spriteNum).member // JavaScript syntax var currMember = sprite(this.spriteNum).member This alternative approach is merely for convenience, and provides no different functionality.
startAngle Usage member(whichCastmember).modelResource(whichModelResource). startAngle modelResourceObjectReference.startAngle Description 3D property; when used with a model resource whose type is #cylinder or #sphere, this command allows you to both get and set the startAngle property of the referenced model resource, as a floating-point value from 0.0 to 360.0. The default value for this property is 0.0.
startTime Usage -- Lingo syntax soundChannelObjRef.startTime // JavaScript syntax soundChannelObjRef.startTime; Description Sound Channel property; indicates the start time of the currently playing or paused sound as set when the sound was queued. Read-only. This property cannot be set after the sound has been queued. If no value was supplied when the sound was queued, this property returns 0.
A time based startTimeList contains the following properties: • • • • • Specifies the title. hours. Specifies the hour at which playback starts. min. Specifies the minute at which playback starts. sec. Specifies the second at which playback starts. frames. Specifies the frames at which playback starts. title.
Example This statement shows that the cast member named PartyScene has finished loading and preparing for playback, and no errors occurred during the load: put member("PartyScene").state -- 4 state (Flash, SWA) Usage -- Lingo syntax memberObjRef.state // JavaScript syntax memberObjRef.state; Description Cast member property; for Shockwave Audio (SWA) streaming cast members and Flash movie cast members, determines the current state of the streaming file.
Example This statement issues an alert if an error is detected for the SWA streaming cast member: -- Lingo syntax on mouseDown if member("Ella Fitzgerald").state = 9 then _player.alert("Sorry, can't find an audio file to stream.") end if end // JavaScript syntax function mouseDown() { var ellaSt = member("Ella Fitzgerald").state; if (ellaSt = 9) { _player.alert("Sorry, can't find an audio file to stream.
The streaming process is initiated when the playhead enters the span of the RealMedia sprite in the Score, the play method is invoked on a RealMedia sprite or cast member, or a user clicks the Play button in the RealMedia viewer. Calling this property returns a numeric value indicating the state of the streaming process for the RealMedia cast member. For each state, there is one or more corresponding mediaStatus (RealMedia, Windows Media) property value; each mediaStatus value is observed only in one state.
// JavaScript syntax put(sprite(2).state); // 0 put(member("Real").state); // 0 See also mediaStatus (RealMedia, Windows Media), percentBuffered, lastError static Usage -- Lingo syntax memberOrSpriteObjRef.static // JavaScript syntax memberOrSpriteObjRef.static; Description Cast member property and sprite property; controls playback performance of a Flash movie sprite depending on whether the movie contains animation.
staticQuality Usage -- Lingo syntax spriteObjRef.staticQuality // JavaScript syntax spriteObjRef.staticQuality; Description QuickTime VR sprite property; specifies the codec quality used when the panorama image is static. Possible values are #minQuality, #maxQuality, and #normalQuality. This property can be tested and set. status Usage -- Lingo syntax soundChannelObjRef.status // JavaScript syntax soundChannelObjRef.status; Description Sound Channel property; indicates the status of a sound channel.
stillDown Usage -- Lingo syntax _mouse.stillDown // JavaScript syntax _mouse.stillDown; Description Mouse property; indicates whether the user is pressing the mouse button (TRUE) or not (FALSE). Read-only. This function is useful within a mouseDown script to trigger certain events only after the mouseUp function. Script cannot test stillDown when it is used inside a loop. Use the mouseDown function inside loops instead.
stopTimeList Usage -- Lingo syntax dvdObjRef.stopTimeList // JavaScript syntax dvdObjRef.stopTimeList; Description DVD property; a property list that specifies the time or chapter at which playback stops. Read/write. A stopTimeList is a property list that can be either chapter based or time based. A chapter based stopTimeList contains the following properties: • • title. Specifies the title. chapter. Specifies the chapter. Playback stops after this chapter is played.
Description Flash cast member property; controls the way a linked Flash movie cast member is streamed into memory, as follows: • • • #frame (default)—Streams part of the cast member each time the Director frame advances while the sprite is on the Stage. #idle—Streams part of the cast member each time an idle event is generated or at least once per Director frame while the sprite is on the Stage.
Example The following statement links the file BigBand.swa to an SWA streaming cast member. The linked file is on the disk MyDisk in the folder named Sounds. -- Lingo syntax member("SWAstream").streamName = "MyDisk/sounds/BigBand.swa" // JavaScript syntax member("SWAstream").streamName = "MyDisk/sounds/BigBand.swa"; streamSize Usage -- Lingo syntax memberObjRef.streamSize // JavaScript syntax memberObjRef.
streamSize (3D) Usage member(whichCastmember).streamSize Description 3D property; allows you to get the size of the data stream to be downloaded, from 0 to maxInteger. This command refers to the initial file import or the last loadFile() requested. Example This statement shows that the last file load associated with the cast member Scene has a total size of 325300 bytes: put member("Scene").
strokeWidth Usage -- Lingo syntax memberObjRef.strokeWidth // JavaScript syntax memberObjRef.strokeWidth; Description Vector shape cast member property; indicates the width, in pixels, of the shape’s framing stroke. The value is a floating-point number between 0 and 100 and can be tested and set. To see an example of strokeWidth used in a completed movie, see the Vector Shapes movie in the Learning/Lingo Examples folder inside the Director application folder.
subdivision Usage member(whichCastmember).model(whichModel).sds.subdivision Description 3D sds modifier property; allows you to get or set the subdivision surfaces mode of operation. Possible values are as follows: • • specifies that the mesh is uniformly scaled up in detail, with each face subdivided the same number of times. #adaptive specifies that additional detail is added only when there are large surface orientation changes and only to those areas of the mesh that are currently visible.
subPictureCount Usage -- Lingo syntax dvdObjRef.subPictureCount // JavaScript syntax dvdObjRef.subPictureCount; Description DVD property. Returns the number of available sub pictures. Read-only. See also DVD suspendUpdates Usage sprite(which3dSprite).suspendUpdates Description 3D sprite property; when set to TRUE, causes the sprite not to be updated as part of normal screen redraw operations. This can improve movie playback performance.
The value of this property can also be set using the Reset Monitor to Movie’s Color Depth option in the General Preferences dialog box. Example This statement sets the variable named switcher to the current setting of switchColorDepth: -- Lingo syntax switcher = _player.switchColorDepth // JavaScript syntax var switcher = _player.switchColorDepth; This statement checks whether the current color depth is 8-bit and turns the switchColorDepth property on if it is: -- Lingo syntax if (_system.
systemTrayTooltip Usage -- Lingo syntax _movie.displayTemplate.systemTrayTooltip windowObjRef.systemTrayTooltip // JavaScript syntax _movie.displayTemplate.systemTrayTooltip; windowObjRef.systemTrayTooltip; Description Movie and Windows property (Microsoft Windows only). Determines the string that appears in the tooltip pop-up of the system tray icon. Read/write. This property is only applicable if the systemTrayIcon property is set to TRUE.
Example This statement retrieves and displays in the Message window all the tabs for the text cast member Intro credits: put member("Intro credits").tabs -- [[#type: #left, #position: 36], [#type: #Decimal, #position: 141], [#type: #right, #position: 216]] \ target Usage timeoutObject.target Description Timeout object property; indicates the child object that the given timeoutObject will send its timeout events to.
tension Usage member(whichCastmember).model(whichModel).sds.tension Description 3D subdivision surface property; allows you to get or set a floating-point percentage between 0.0 and 100.0 that controls how tightly the newly generated surface matches the original surface. The higher this value, the more tightly the subdivided surface matches the original surface. The default is 65.0. Example The following statement sets the tension property of the sds modifier of the model Baby to 35.
Example This statement places the phrase “Thank you.” in the empty cast member Response: --Lingo syntax if (member("Response").text = EMPTY) then member("Response").text = "Thank You." end if // JavaScript syntax if (member("Response").text = " ") { member("Response").text = "Thank You."; } This statement sets the content of cast member Notice to “You have made the right decision!” --Lingo syntax member("Notice").text = "You have made the right decision!" // JavaScript syntax member("Notice").
For more information about texture properties, see the Using Director topics in the Director Help Panel. The texture of a particle system is a property of the model resource, whose type is #particle. Example This statement sets the texture property of the shader named WallSurface to the texture named BluePaint: member("Room").shader("WallSurface").texture = \ member("Room").texture("BluePaint") See also newTexture, deleteTexture textureCoordinateList Usage member(whichCastmember).
textureCoordinates Usage member(whichCastmember).modelResource(whichModelResource).\ face[faceIndex].textureCoordinates modelResourceObject.face[faceIndex].textureCoordinates Description 3D property; identifies which elements in the textureCoordinateList to use for the faceIndex’d face. This property must be a list of three integers specifying indices in the textureCoordinateList, corresponding to the textureCoordinates to use for each corner of the mesh’s face.
textureList Usage member(whichMember).model(whichModel).shader(whichShader).textureList member(whichMember).model(whichModel).shader(whichShader).textureList[index] Description 3D shader property; determines the list of textures applied to the shader. A shader can have up to 8 layers of textures. When tested, this property returns a linear list of texture objects. When set without specifying an index, this property specifies the texture object to be applied to all layers.
textureMode Usage member(whichCastmember).shader(whichShader).textureMode member(whichCastmember).model(whichModel).shader.textureMode member(whichCastmember).model(whichModel).shaderList{[index]}.\ textureMode Description 3D #standard shader property; specifies how the first texture layer is mapped onto the surface of the model. Use the textureModeList property to specify textures for layers other than the first layer. This property is ignored if the #toon modifier is applied to the model resource.
• • • • • wraps the texture around the surface as though the surface were placed in the middle of the texture and then the texture were rolled around the surface to form a cylinder. The wrapTransformList[textureLayerIndex] is applied to the mapping space before the texture coordinates are generated in model space.
textureRenderFormat Usage getRenderServices().textureRenderFormat Description 3D rendererServices property; allows you to get or set the default bit format used by all textures in all 3d cast members. Use a texture's texture.RenderFormat property to override this setting for specific textures only. Smaller sized bit formats (i.e 16 bit variants such as #rgba5551) use less hardware accelerator video ram, allowing you to make use of more textures before being forced to switch to software rendering.
textureRepeat Usage member(whichCastmember).shader(whichShader).textureRepeat member(whichCastmember).model(whichModel).shader.textureRepeat member(whichCastmember).model(whichModel).shaderList{[index]}.\ textureRepeat Description 3D #standard shader property; controls the texture clamping behavior of the first texture layer of the shader. Use the textureRepeatList property to control this property for texture layers other than the first layer.
Description 3D standard shader property; allows you to get or set the texture clamping behavior of any texture layer. When TRUE, the default, the texture in textureLayerIndex can be tiled (repeated) several times across model surfaces. This can be accomplished by setting shaderReference.textureTransform[textureLayerIndex].scale to be less than 1 in x or y.
To tile the image twice along its horizontal axis, use shaderReference.textureTransform.scale(0.5, 1.0, 1.0). Scaling on the Z axis is ignored. To offset the image by point(xOffset,yOffset), use shaderReference.textureTransform.translate(xOffset,yOffset,0.0). Translating by integers when the shader’s textureRepeat property is TRUE will have no effect, because the width and height of the texture will be valued between 0.0 and 1.0 in that case. To apply a rotation to a texture layer, use shaderReference.
Description 3D standard shader property; this property provides access to a transform which modifies the texture coordinate mapping of a texture layer. Manipulate this transform to tile, rotate, or translate a texture image before applying it to the surface of models. The texture itself remains unaffected, the transform merely modifies how the shader applies the texture. To tile the image twice along its horizontal axis, use textureTransformList[whichTextureLayer].scale(0.5, 1.0, 1.0).
These statements rotate the third texture used by the shader gbCyl3 by 90× around its center, assuming that textureList[3] is a 128x128 sized texture: s = member("scene").shader("gbCyl3") s.textureTransformList[3].translate(-64,-64,0) s.textureTransformList[3].rotate(0,0,90) s.textureTransformList[3].translate(64,64,0) textureType Usage member(whichCastmember).textureType Description 3D texture property; allows you to get or set the texture type for the default texture.
Example The following statement shows how to use a placeholder cast member to display another thumbnail on the Stage. The placeholder cast member is placed on the Stage, then the picture of that member is set to the thumbnail of member 10. This makes it possible to show a reduced image without having to scale or otherwise manipulate a graphic: -- Lingo syntax member("Placeholder").picture = member(10).thumbNail // JavaScript syntax member("Placeholder").picture = member(10).
See also milliseconds, period, persistent, target, timeout(), timeoutHandler timeoutHandler Usage timeoutObject.timeoutHandler Description System property; represents the name of the handler that will receive timeout messages from the given timeoutObject. Its value is a symbol, such as #timeExpiredHandler. The timeoutHandler is always a handler within the timeout object’s target object, or in a movie script if the timeout object has no target specified. This property can be tested and set.
timeScale Usage member(whichCastMember).timeScale the timeScale of member whichCastMember Description Cast member property; returns the time unit per second on which the digital video’s frames are based. For example, a time unit in a QuickTime digital video is 1/600 of a second. This property can be tested but not set. See also digitalVideoTimeScale title (DVD) Usage -- Lingo syntax dvdObjRef.title // JavaScript syntax dvdObjRef.title; Description DVD property; specifies the current title. Read/write.
Example This statements assigns the title Planets to the fifth window: -- Lingo syntax _player.windowList[5].title = "Planets" // JavaScript syntax _player.windowList[5].title = "Planets"; See also Window titlebarOptions Usage -- Lingo syntax windowObjRef.titlebarOptions // JavaScript syntax windowObjRef.titlebarOptions; Description Window property; specifies a list of properties that stores the title bar options of a window. Read/ write.
Example This statement displays in the Message window the available titlebar options for the window named Elements: -- Lingo syntax trace(window("Elements").titlebarOptions) // JavaScript syntax trace(window("Elements").titlebarOptions); These statements set the icon property to the bitmap cast member named smallIcon: -- Lingo syntax window("Elements").titlebarOptions.icon = member("smallIcon") // JavaScript syntax window("Elements").titlebarOptions.
// JavaScript syntax put(_player.toolXtraList); See also mediaXtraList, Player, scriptingXtraList, transitionXtraList, xtraList (Player) toon (modifier) Usage member(whichCastmember).model(whichModel).toon.toonModifierProperty Description 3D modifier; once you have added the #toon modifier to a model you can get and set the #toon modifier properties. The toon modifier draws a model using only a handful of colors, and resulting in a cartoon style of rendering of the model’s surface.
• • • • • • • lineColor allows you to get or set the color of lines drawn by the inker. Possible values are any valid Lingo color object. The default value is rgb (0, 0, 0), which is black. creases allows you to get or set whether lines are drawn in creases. This is a Boolean value; the default value is True. creaseAngle, if creases is set to TRUE, allows you to get or set how sensitive the line drawing function of the toon modifier is to the presence of creases.
topSpacing Usage chunkExpression.topSpacing Description Text cast member property; allows you to specify additional spacing applied to the top of each paragraph in the chunkExpression portion of the text cast member. The value itself is an integer, with less than 0 indicating less spacing between paragraphs and greater than 0 indicating more spacing between paragraphs. The default value is 0, which results in default spacing between paragraphs.
traceLogFile Usage -- Lingo syntax _movie.traceLogFile // JavaScript syntax _movie.traceLogFile; Description Movie property; specifies the name of the file in which the Message window display is written. Read/write. You can close the file by setting the traceLogFile property to EMPTY (Lingo) or an empty string “ “ (JavaScript syntax). Any output that would appear in the Message window is written into this file. You can use this property for debugging when running a movie in a projector and when authoring.
Example This statement turns the traceScript property on. -- Lingo syntax _movie.traceScript = TRUE // JavaScript syntax _movie.traceScript = true; See also Movie trackCount (Member) Usage -- Lingo syntax memberObjRef.trackCount() // JavaScript syntax memberObjRef.trackCount(); Description Digital video cast member property; returns the number of tracks in the specified digital video cast member. This property can be tested but not set.
Example This statement determines the number of tracks in the digital video sprite assigned to channel 10 and displays the result in the Message window: -- Lingo syntax put(sprite(10).trackCount()) // JavaScript syntax trace(sprite(10).trackCount()); trackEnabled Usage -- Lingo syntax spriteObjRef.trackEnabled(whichTrack) // JavaScript syntax spriteObjRef.trackEnabled(whichTrack); Description Digital video sprite property; indicates the status of the specified track of a digital video.
Example This statement determines the time of the keyframe that follows the current time in track 5 of the digital video assigned to sprite channel 15 and displays the result in the Message window: -- Lingo syntax put(sprite(15).trackNextKeyTime(5)) // JavaScript syntax put(sprite(15).trackNextKeyTime(5)); trackNextSampleTime Usage -- Lingo syntax spriteObjRef.trackNextSampleTime(whichTrack) // JavaScript syntax spriteObjRef.
// JavaScript syntax put(sprite(15).trackPreviousKeyTime(5)); trackPreviousSampleTime Usage -- Lingo syntax spriteObjRef.trackPreviousSampleTime(whichTrack) // JavaScript syntax spriteObjRef.trackPreviousSampleTime(whichTrack); Description Digital video sprite property; indicates the time of the sample preceding the digital video’s current time. This property is useful for locating text tracks in a digital video. This property can be tested but not set.
trackStartTime (Sprite) Usage -- Lingo syntax spriteObjRef.trackStartTime(whichTrack) // JavaScript syntax spriteObjRef.trackStartTime(whichTrack); Description Digital video sprite property; sets the starting time of a digital video movie in the specified sprite channel. The value of trackStartTime is measured in ticks. This property can be tested but not set. Example In the Message window, the following statement reports when track 5 in sprite channel 10 starts playing.
trackStopTime (Sprite) Usage -- Lingo syntax spriteObjRef.trackStopTime(whichTrack) // JavaScript syntax spriteObjRef.trackStopTime(whichTrack); Description Digital video sprite property; returns the stop time of the specified track of the specified digital video sprite. When a digital video movie is played, trackStopTime is when playback halts or loops if the loop property is turned on. This property can be tested but not set.
// JavaScript syntax member("Archives").text = sprite(20).trackText(5).toString(); trackType (Member) Usage -- Lingo syntax memberObjRef.trackType(whichTrack) // JavaScript syntax memberObjRef.trackType(whichTrack); Description Digital video cast member property; indicates which type of media is in the specified track of the specified cast member. Possible values are #video, #sound, #text, and #music. This property can be tested but not set.
if sprite(10).trackType(5) = #text then textFormat end if end // JavaScript syntax function checkForText() { var tt = sprite(10).trackType(5); if (tt = "text") { textFormat(); } } trails Usage sprite(whichSprite).trails the trails of sprite whichSprite Description Sprite property; for the sprite specified by whichSprite, turns the trails ink effect on (1 or TRUE) or off (0 or FALSE). For the value set by Lingo to last beyond the current sprite, the sprite must be a scripted sprite.
For bones within models using the bonesPlayer modifier, this property defaults in value to the transform assigned to the bone upon creation of the model file. The transform of a bone represents the bone’s rotation relative to its parent bone and its position relative to its original joint position. The original joint position is determine upon creation of the model file.
See also interpolateTo(), scale (transform), rotation (transform), position (transform), bone, worldTransform, preRotate, preScale(), preTranslate() transitionType Usage member(whichCastMember).transitionType the transitionType of member whichCastMember Description Transition cast member property; determines a transition’s type, which is specified as a number. The possible values are the same as the codes assigned to transitions for the puppetTransition command.
translation Usage -- Lingo syntax memberOrSpriteObjRef.translation // JavaScript syntax memberOrSpriteObjRef.translation; Description QuickTime cast member and sprite property; controls the offset of a QuickTime sprite’s image within the sprite’s bounding box. This offset is expressed in relation to the sprite’s default location as set by its center property.
transparent Usage member(whichCastmember).shader(whichShader).transparent member(whichCastmember).model(whichModel).shader.transparent member(whichCastmember).model(whichModel).shaderList\ [shaderListIndex].transparent Description 3D standard shader property; lets you get or set whether a model is blended using alpha values (TRUE) or is rendered as opaque (FALSE). The default value for this property is TRUE (alpha-blended). The functionality of shader.blend is dependent upon this property.
Example The following statement sets the callback handler for a QuickTime VR sprite to the handler named MyHotSpotCallback when the playhead first enters the sprite span. Every time that hotspot is triggered, the MyHotSpotCallback handler is executed. When the playhead leaves the sprite span, the callback is canceled. -- Lingo syntax property pMySpriteNum, spriteNum on beginSprite(me) pMySpriteNum = spriteNum sprite(pMySpriteNum).
tunnelDepth Usage member(whichTextmember).tunnelDepth member(whichCastMember).modelResource(whichExtruderModel\ Resource).tunnelDepth Description A 3D extruder model resource property, as well as a text cast member property. Using this property allows you to get or set the extrusion depth (the distance between the front and back faces) of a 3D text model resource Possible values are floating point numbers between 1.0 and 100.0. The default value is 50.0.
tweenMode Usage member(whichCastmember).modelResource(whichModelResource).tweenMode modelResourceObjectReference.tweenMode Description 3D particle property; allows you to get or set whether the color of a particle varies according to it’s speed or age. The tweenMode property can have the following values: • • #velocity alters the color of the particle between colorRange.start and colorRange.end based on the velocity of the particle.
type (Member) Usage -- Lingo syntax memberObjRef.type // JavaScript syntax memberObjRef.type; Description Member property; indicates a cast member’s type. Read-only.
// JavaScript syntax function checkFormat() { if (member("Today’s News").type != "field") { _player.alert("Sorry, this cast member must be a field."); } } See also Member type (model resource) Usage member(whichCastmember).modelResource(whichModelResource).type Description 3D model resource property; the resource type of the referenced model resource. This property’s possible values are: • #box indicates that this model resource newModelResource command.
type (motion) Usage member(whichCastmember).motion(whichMotion).type Description 3D motion property; the motion type of the referenced motion object. This property’s possible values are: • • • #bonesPlayer indicates that this motion is a bones based animation and it requires the use of the #bonesPlayer modifier for playback. #keyFramePlayer indicates that this motion is a keyframed animation and it requires the use of the #keyFramePlayer modifier for playback.
type (sprite) Usage sprite(whichSprite).type the type of sprite whichSprite Description Sprite property; clears sprite channels during Score recording by setting the type sprite property value for that channel to 0. Note: Switch the member of a sprite only to another member of the same type to avoid changing the sprite’s properties when the member type is switched. This property can be tested and set. Example This statement clears sprite channel 1 when issued during a Score recording session: sprite(1).
type (Window) Usage -- Lingo syntax windowObjRef.type // JavaScript syntax windowObjRef.type; Description Window property; specifies the window type. Read/write. If the type property is set, all properties pertaining to the new window are set accordingly. This property can be one of the following values: Property Description #document Specifies that the window will appear with a standard title bar, a close box, a minimize box, and a maximize box. These types of windows can be moved.
updateLock Usage -- Lingo syntax _movie.updateLock // JavaScript syntax _movie.updateLock; Description Movie property; determines whether the Stage is updated during Score recording (FALSE) or not (TRUE). Read/write. You can keep the Stage display constant during a Score recording session by setting updateLock to TRUE before script updates the Score. If updateLock is FALSE, the Stage updates to show a new frame each time the frame is entered.
URL Usage -- Lingo syntax memberObjRef.URL // JavaScript syntax memberObjRef.URL; Description Cast member property; specifies the URL for Shockwave Audio (SWA) and Flash movie cast members. For Flash movie members, this property is synonymous with the pathName member property. The URL property can be tested and set. For SWA members, it can be set only when the SWA streaming cast member is stopped.
Example This toggles the alpha channel of cast member “foreground” on and off: -- Lingo syntax member("foreground").useAlpha = not(member("foreground").useAlpha) // JavaScript syntax switch(member("foreground").useAlpha) { case 0: member("foreground").useAlpha = 1; break; case 1: member("foreground").useAlpha = 0; break; } useDiffuseWithTexture Usage member(whichCastmember).shader(whichShader).
useFastQuads Usage -- Lingo syntax _movie.useFastQuads // JavaScript syntax _movie.useFastQuads; Description Movie property; determines whether to use faster (TRUE) or slower (FALSE, default) quad calculation operations. Read/write. When set to TRUE, Director uses a faster, less precise method for calculating quad operations. Fast quads calculations are good for simple rotation and skew sprite effects.
Example This behavior toggles the formatting of hypertext on and off in text cast member “myText”: --Lingo syntax on mouseUp member("myText").usehypertextStyles = \ not(member("myText").usehypertextStyles) end // JavaScript syntax function mouseUp() { member("myText").usehypertextStyles = !(member("myText").usehypertextStyles) } useLineOffset Usage member(whichCastmember).model(whichModel).toon.useLineOffset member(whichCastmember).model(whichModel).inker.
To modify the elements of this list you must use the addProp and deleteProp commands documented in the main Lingo Dictionary. Example This statement displays the userData property of the model named New Body: put member("Car").model("New Body").userData -- [#driver: "Bob", #damage: 34] This statement adds the property #health with the value 100 to the userData property list for the model named Player: member(“scene”).model(“Player”).userData.addProp(#health,100) userName Usage -- Lingo syntax _player.
userName (RealMedia) Usage -- Lingo syntax memberOrSpriteObjRef.userName // JavaScript syntax memberOrSpriteObjRef.userName; Description RealMedia sprite and cast member property; allows you to set the user name required to access a protected RealMedia stream. For security reasons, you cannot use this property to retrieve a previously specified user name. If a user name has been set, the value of this property is the string "********".
useTargetFrameRate Usage sprite(which3dSprite).useTargetFrameRate Description 3D sprite property; determines whether the targetFrameRate property of the sprite is enforced. If the useTargetFrameRate property is set to TRUE, the polygon count of the models in the sprite are reduced if necessary to achieve the specified frame rate.
// JavaScript syntax member("Archie").vertex[2].handle1 = point(-63.0000, -16.0000); See also vertexList vertexList Usage -- Lingo syntax memberObjRef.vertexList // JavaScript syntax memberObjRef.vertexList; Description Cast member property; returns a linear list containing property lists, one for each vertex of a vector shape. The property list contains the location of the vertex and the control handle. There are no control handles if the location is (0,0).
See also addVertex(), count(), deleteVertex(), moveVertex(), moveVertexHandle(), originMode, vertex vertexList (mesh generator) Usage member(whichCastmember).modelResource(whichModelResource).vertexList Description 3D property; when used with a model resource whose type is #mesh, allows you to get or set the vertexList property for the model resource. The vertexList is a linear list of each vertex used in the mesh. A single vertex may be shared by numerous faces of the mesh.
vertices Usage member(whichCastmember).modelResource(whichModelResource).\ face[faceIndex].vertices Description 3D face property; when used with a model resource whose type is #mesh, this property allows you to get or set which vertices from the resource’s vertexList property to use for the mesh face specified by faceIndex.
video (RealMedia, Windows Media) Usage -- Lingo syntax memberOrSpriteObjRef.video // JavaScript syntax memberOrSpriteObjRef.video; Description RealMedia and Windows Media property; allows you to set or get whether the sprite or cast member renders video (TRUE or 1) or only plays the sounds (FALSE or 0). Read/write. Integer values other than 1 or 0 are treated as TRUE.
Possible symbols include the following: Symbol Description #MPEG1 The video format is MPEG-1. #MPEG2 The video format is MPEG-2. #unknown The video format is unknown. See also DVD videoForWindowsPresent Usage the videoForWindowsPresent Description System property; indicates whether AVI software is present on the computer. This property can be tested but not set.
Example This handler accepts a sprite reference as a parameter and moves the view of a Flash movie sprite from left to right within the sprite’s bounding rectangle: -- Lingo syntax on panRight whichSprite repeat with i = 120 down to -120 sprite(whichSprite).viewH = i _movie.updateStage() end repeat end // JavaScript syntax function panRight(whichSprite) { var i = 120; while(i > -121) { sprite(whichSprite).viewH = i; _movie.
Director point values specified for the viewPoint property are restricted to integers, whereas viewH and viewV can be specified with floating-point numbers. When you test the viewPoint property, the point values are truncated to integers. As a general guideline, use the viewH and viewV properties for precision; use the originPoint property for speed and convenience. This property can be tested and set. The default value is point (0,0).
One significant difference between the viewScale and scale properties is that viewScale always scales from the center of the sprite’s bounding rectangle, whereas scale scales from a point determined by the Flash movie’s originMode property. This property can be tested and set. Note: This property must be set to the default value if the scaleMode property is set to #autoSize, or the sprite will not display correctly.
Example This handler accepts a sprite reference as a parameter and moves the view of a Flash movie sprite from the top to the bottom within the sprite’s bounding: rectangle: -- Lingo syntax on panDown(whichSprite) repeat with i = 120 down to -120 sprite(whichSprite).viewV = i _movie.updateStage() end repeat end // JavaScript syntax function panDown(whichSprite) { var i = 120; while(i > -121) { sprite(whichSprite).viewV = i; _movie.
visible (sprite) Usage sprite(whichSprite).visible the visible of sprite whichSprite Description Sprite property; determines whether the sprite specified by whichSprite is visible (TRUE) or not (FALSE). This property affects all sprites in the channel, regardless of their position in the Score. Note: Setting the visible property of a sprite channel to FALSE makes the sprite invisible and prevents only the mouse-related events from being sent to that channel.
volume (DVD) Usage -- Lingo syntax dvdObjRef.volume // JavaScript syntax dvdObjRef.volume; Description DVD property. Determines the current DVD sound volume . Read/write. The volume must be an integer in the range of 0 (silent) to 100 (full volume). On Windows the volume scale is logarithmic. On Macintosh the scale is linear. See also DVD volume (Member) Usage -- Lingo syntax memberObjRef.volume // JavaScript syntax memberObjRef.
Sound channels are numbered 1, 2, 3, and so on up to 8. Channels 1 and 2 are the channels that appear in the Score. The value of the volume property ranges from 0 (mute) to 255 (maximum volume). A value of 255 indicates the full volume set for the machine, as controlled by the Sound object’s soundLevel property, and lower values are scaled to that total volume. This property allows several channels to have independent settings within the available range.
volume (Windows Media) Usage -- Lingo syntax windowsMediaObjRef.volume // JavaScript syntax windowsMediaObjRef.volume; Description Windows Media sprite property; determines the volume of a Windows Media sprite. The value of this property is an integer that ranges from 0 (mute) to 7 (loud). You can also set this property using the Control > Volume menu in Director. Example This statement sets the volume of sprite 7 to 2: -- Lingo syntax sprite(7).volume = 2 // JavaScript syntax sprite(7).
width Usage -- Lingo syntax memberObjRef.width imageObjRef.width spriteObjRef.width // JavaScript syntax memberObjRef.width; imageObjRef.width; spriteObjRef.width; Description Member, Image, and Sprite property; for vector shape, Flash, animated GIF, RealMedia, Windows Media, bitmap, and shape cast members, determines the width, in pixels, of a cast member. Read-only for cast members and image objects, read/write for sprites. This property does not affect field and button cast members.
width (3D) Usage member(whichCastmember).modelResource(whichModelResource).width modelResourceObjectReference.width Description 3D property; allows you to get or set the width of the plane for a model resource whose type is #box or #plane. This property must be greater than 0.0, and has a default setting of 1.0. For objects whose type is #box, the default value of width is 50.0. For objects whose type is #plane, the default setting is 1.0. width is measured along the X axis.
Example put member("3D").modelResource("fog bank").wind -- vector(10.5,0,0) window Usage -- Lingo syntax _player.window[windowNameOrNum] // JavaScript syntax _player.window[windowNameOrNum]; Description Player property; provides indexed or named access to the Window objects created by the Director player. Read-only. The windowNameOrNum argument is either a string that specifies the name of the window to access or an integer that specifies the index position of the window to access.
// JavaScript syntax var backWindow = _player.windowList[5].windowBehind; backWindow.moveToFront(); See also moveToBack(), moveToFront(), Window, windowInFront, windowList windowInFront Usage -- Lingo syntax windowObjRef.windowInFront // JavaScript syntax windowObjRef.windowInFront; Description Window property; returns a reference to the window that is in front of all other windows. Read-only.
// JavaScript syntax trace(_player.windowList); See also Player wordWrap Usage -- Lingo syntax memberObjRef.wordWrap // JavaScript syntax memberObjRef.wordWrap; Description Cast member property; determines whether line wrapping is allowed (TRUE) or not (FALSE). Example This statement turns line wrapping off for the field cast member Rokujo: --Lingo syntax member("Rokujo").wordWrap = FALSE // JavaScript syntax member("Rokujo").wordWrap = false; worldPosition Usage member(whichCastmember).
worldTransform Usage member(whichMember).model(whichModel).bonesPlayer.bone[index].\ worldTransform Description 3D bonesplayer property; allows you to get the world relative transform of a specific bone, as opposed to using the transform property which returns the bone’s parent relative transform. The worldTransform property can only be used with bonesplayer modified models. Example This statement stores a bone’s world relative transform in the variable finalTransform: finalTransform = member("3D").
wrapTransformList Usage member( whichCastmember ).shader( ShaderName ).wrapTransformList\ [ textureLayerIndex ] member( whichCastmember ).shader[ shaderListIndex ].\ wrapTransformList[ textureLayerIndex ] member( whichCastmember ).model( modelName ).\ shader.wrapTransformList[ textureLayerIndex ] member( whichCastmember ).model( modelName ).shaderList\ [ shaderListIndex ].
xAxis Usage member(whichCastmember).transform.xAxis Description 3D transform property; allows you to get but not set the vector representing the transform’s canonical x-axis in transform space. Example The first line of this example sets the transform of the model ModCylinder to the identity transform. The next two lines show that the x-axis of ModCylinder is the vector (1.0000, 0.0000, 0.0000). This means that the x-axis of ModCylinder is aligned with the x-axis of the world.
xtraList (Movie) Usage -- Lingo syntax _movie.xtraList // JavaScript syntax _movie.xtraList; Description Movie property; displays a linear property list of all Xtra extensions in the Movies/Xtras dialog box that have been added to the movie. Read-only. Two possible properties can appear in xtraList: • • • #filename—Specifies the filename of the Xtra extension on the current platform. It is possible to have a list without a #filename entry, such as when the Xtra extension exists only on one platform.
There are two possible properties that can appear in xtraList: • • #filename—Specifies the filename of the Xtra extension on the current platform. It is possible to have a list without a #filename entry, such as when the Xtra extension exists only on one platform. #version—Specifies the same version number that appears in the Properties dialog box (Windows) or Info window (Macintosh) when the file is selected on the desktop. An Xtra extension may not necessarily have a version number.
Example The first line of this example sets the transform of the model ModCylinder to the identity transform. The next two lines show that the Y axis of ModCylinder is the vector (0.0000, 1.0000, 0.0000). This means that the y-axis of ModCylinder is aligned with the y-axis of the world. The next line rotates ModCylinder 90° around its x-axis. This rotates the axes of ModCylinder as well. The last two lines show that the y-axis of ModCylinder is now the vector (0.0000, 0.0000, 1.0000).
zAxis Usage member(whichCastmember).transform.zAxis Description 3D transform property; allows you to get but not set the vector representing the transform’s canonical z-axis in transform space. Example The first line of this example sets the transform of the model ModCylinder to the identity transform. The next two lines show that the z-axis of ModCylinder is the vector (0.0000, 0.0000, 1.0000). This means that the z-axis of ModCylinder is aligned with the z-axis of the world.
Chapter 14: Properties
INDEX Symbols " (quotation mark) 155 " (string constant) 151 # (symbol definition operator) 484, 595 # (symbol) data type 16 & (concatenation operator) 598 && (concatenation operator) 599 () (parentheses operator) 600 * (multiplication operator) 601, 603 + (addition operator) 602 - (minus operator) 597, 603 -- (comment delimiter) 598 .
allowTransportControl property 629 allowVolumeControl property 629 allowZooming property 630 alphaThreshold property 630 ambient property 630 ambientColor property 631 ampersand operators (& or &&) 598, 599 ancestor property 631 ancestor scripting 56 ancestor, sending messages to 252 and logical operator 611 angle (3D) property 633 angle (DVD) property 633 angleCount property 634 Animated GIF object 119 animationEnabled property 634 antiAlias property 634 antiAliasingEnabled property 635 antiAliasingSupport
bitmaps picture of member property 446 trimming white space 1061 bitmapSizes property 655 bitNot() method 244 bitOr() method 244 bitRate property 655 bitsPerSample property 656 bitXor() method 245 blend (3D) property 656 blend property 657 blend range, end and start 662 blendConstant property 658 blendConstantList property 658 blendFactor property 659 blendFunction property 660 blendFunctionList property 661 blendLevel property 662 blendRange property 662 blendSource property 663 blendSourceList property 66
cast members borders 834 copying 273 creating 416 duration of 746 font used to display 780 line spacing for 833 lines in 832 locToCharPos function 385 locVToLinePos function 386 media in cast member tracks 1055 palettes associated with 909, 910 pictureP function 446 preloading 934 Shockwave Audio 327, 329 text boxes for 671 Cast window 9, 10 castLib property 678 castLib() method 255 castLibNum property 679 castMemberList property 679 casts, saving changes to 516 center property 680 centerRegPoint property 6
item... of keyword 210 last function 379 line...of keyword 211 put...after command 218 put...before command 219 put...into command 219 selecting words in 226 word...
controller property 707 converting ASCII codes to characters 432 characters to ASCII codes 259 duration in time to frames 357 expressions to floating-point numbers 317 frames to duration in time 320 copying cast members 273 lists 43, 46, 299 scripts 81 copyPixels() method 271 copyrightInfo (Movie) property 708 copyrightInfo (SWA) property 708 copyToClipBoard() method 273 core objects 52, 101 cos() method 274 count (3D) property 710 count property 709 count() method 274 counting characters in strings 381 ite
deleteGroup method 288 deleteLight method 289 deleteModel method 289 deleteModelResource method 290 deleteMotion method 290 deleteOne method 291 deleteProp method 291 deleteShader method 292 deleteTexture method 292 deleteVertex() method 293 deleting array items 45 behaviors 80 child objects 60 items in lists 43, 286, 291 objects 94, 503 values from lists 291 variables 72 delimiters comment delimiter (--) 598 defining for items 817 density property 728 depth (3D) property 729 depth (bitmap) property 729 dep
duplicate() (Image) method 298 duplicate() (list function) method 299 duplicate() (Member) method 299 duplicateFrame() method 300 duration (3D) property 745 duration (DVD) property 746 duration (Member) property 746 duration (RealMedia) property 747 DVD object 123 DVDeventNotification handler 165 E e logarithm functions 387 editable property 748 editing behaviors 80 debugger mode 98 parent scripts 80 scripts 76 editShortCutsEnabled property 749 elapsedTime property 749 elements, definitions of 10 emissive p
field cast members field keyword 207 font size of 781 font style of 781 height of lines in 382 installing menus defined in 369 lineHeight function 382 lineHeight of member property 833 locToCharPos function 385 locVToLinePos function 386 position of lines in 382 scrolling 519, 520, 978 strings in 1027 text boxes for 671 Field object 124 field properties alignment of member 627 font of member 780 fontSize of member 781 fontStyle of member 781 lineHeight of member 833 selStart 985 fieldOfView (3D) property 76
frames attaching behaviors 80 behaviors, creating 79 converting duration in time to 357 converting to duration in time 320 framesToHMS function 320 HMStoFrames function 357 listing frame labels 824 on enterFrame handler 169 on exitFrame handler 172 on prepareFrame handler 189 on stepFrame handler 196 frameScript property 788 frameSound1 property 788 frameSound2 property 789 frameStep() method 322 framesToHMS() method 320 frameTempo property 789 frameTransition property 790 free memory 322, 323, 857 freeBloc
list of 159 marking end of 206 messages, receiving 35 on keyword 216 order of execution 33 parameters 36 parentheses 13 placing 35 result function 508 results from 37 return keyword 223 handlers() method 355 hardware information, getting 332 height lineHeight function 382 of lines in field cast members 382 height (3D) property 796 height property 795 heightVertices property 796 hiding cast member controllers 707 hierarchies, objects 53 highlighting text 356 highlightPercentage property 797 highlightStrength
invertMask property 815 isInWorld() method 375 isPastCuePoint() method 376 isVRMovie property 816 item...
less than operator (<) 605 less than or equal to operator (<=) 605 level of detail (LOD) modifier properties 839 level property 830 lifetime property 831 Light object 144 light property 831 light() method 381 lights ambient light 731 attenuation property 640 directional light 735 line spacing for cast members 833 line wrapping 1094 linear lists adding to 230, 237 appending to 239 deleting values from 291 syntax 38 lineColor property 832 lineCount property 832 lineDirection property 833 lineHeight property 8
multidimensional 44, 47 position of properties in property lists 314 replacing property values from 526, 535 setaProp command 526 setAt command 527 setProp command 535 setting and retrieving items 39 sorting 44, 47, 544 syntax 38 types of 361, 384 value of parameters in 438 literal quotation mark (") 155 literal values decimal and floating-point numbers 18 description of 18 integers 18 strings 18 loaded property 835 loadFile() method 385 loc (backdrop and overlay) property 836 loc (modifier) property 839 lo
member property 853 member() method 394 memory allocated to program 857 free 322, 323, 857 preloading cast members 934 size of free blocks 322 memorySize property 857 menu item properties enabled of menuItem 752 name of menuItem 884 menu items selecting 752 setting text in 884 menu keyword 213 menu properties name of menu 884 number of menus 899 menus in current movie 899 installing 369 name of menu property 884 mergeDisplayTemplate() method 395 mergeProps() method 396 mesh (property) method 396 mesh colors
mouseH property 872 mouseItem property 873 mouseLevel property 874 mouseLine property 875 mouseLoc property 876 mouseMember property 876 mouseOverButton property 877 mouseUp property 878 mouseUpScript property 879 mouseV property 879 mouseWord property 880 move() method 405 moveableSprite property 881 moveToBack() method 406 moveToFront() method 407 moveVertex() method 407 moveVertexHandle() method 408 Movie object 106 movie properties center of member 680 controller of member 707 scriptsEnabled of member 9
normalize method 429 normalList property 892 normals 324, 397, 429 normals property 892 not equal operator (<>) 605 not logical operator 614 nothing method 430 nudge method 431 null data type 16 number (Cast) property 893 number (characters) property 893 number (items) property 894 number (lines) property 895 number (Member) property 895 number (menu items) property 897 number (menus) property 896 number (Sprite Channel) property 897 number (system) property 898 number (words) property 898 Number data type
openFile() method 437 opening applications 435 MIME files 353 Shockwave movies 353 openXlib method 437 operators arithmetic 26 assignment 27 comparison 26 definition of 11 JavaScript 595 Lingo 595 logical 27 precedence of 25 string 28 types of 25 Option-Return character (\) 203 optionDown property 901 or logical operator 615 order of execution events, messages, and handlers 33 scripts 28 organizationName property 902 originalFont property 903 originH property 903 originMode property 904 originPoint property
percentStreamed property 920 period property 921 perpendicularTo method 446 persistent property 921 PI constant 154 picture (Member) property 922 picture (Window) property 923 pictureP() method 446 platform property 923 play() (3D) method 447 play() (DVD) method 448 play() (RealMedia, Windows Media) method 452 play() (Sound Channel) method 450 playBackMode property 924 playBackRate property 928 Player object 108 playerParentalLevel() method 456 playFile() method 453 playFromToTime() method 454 playing digit
property variables 219 property variables, declaring 57 propList() method 476 prototype objects 68, 72 proxy servers, setting values of 477 proxyServer method 477 ptToHotSpotID() method 477 puppetPalette() method 478 puppetSprite() method 479 puppetTempo() method 480 puppetTransition() method 481 purgePriority property 939 put() method 483 Q qtRegisterAccessKey method 484 qtUnRegisterAccessKey method 484 quad property 940 quality (3D) property 942 quality property 941 queue() (3D) method 486 queue() method
repeat with...down to keyword 221 repeat with...
in linked movies 977 indenting 77 inserting line breaks 76 invoking handlers in 250 Lingo vs. JavaScript 49 linked 81, 383 Message window 90 movie 80 object-oriented programming 54 objects created by parent scripts 433 order of execution 28 parent.
shutDown() method 543 silhouettes property 990 sin() method 543 size chunkSize of member property 688 lineSize of member property 834 of cast members 688 of free blocks of memory 322 size property 991 sizeRange property 991 sizeState property 992 sizing rectangles and points 389 skew property 993 slash sign (/) 604 smoothness 993 smoothness property 993 sort method 544 sorting lists 44, 47, 544 Sound Channel 111 Sound object 110, 133 sound properties multiSound 882 volume of sprite 1088 sound property 995 s
statements, if...then...
numbers 18 object-oriented programming 54 operators 25 repeat loops 31 rules 12 strings 18 symbols 20 troubleshooting 84 system events, relaying to child objects 64 System object 115 system properties floatPrecision 778 multiSound 882 systemTrayIcon property 1024 systemTrayTooltip property 1025 T TAB character constant 157 Tab key 157 Tab key, using to reformat script 77 tabbing order, autoTab of member property 648 tabCount property 1025 tabs property 1025 tan() method 560 target property 1026 targetFrameR
timeOutList property 63 timeoutList property 1041 timeScale property 1042 title (DVD) property 1042 title (Window) property 1042 titlebarOptions property 1043 titleCount property 1044 titleMenu() method 565 toolXtraList property 1044 toon (modifier) property 1045 top (3D) method 565 top property 1046 topCap method 566 topRadius method 566 topSpacing property 1047 trace() method 567 traceLoad property 1047 traceLogFile property 1048 traceScript property 1048 trackCount (cast member) property 1049 trackCount
updateStage() method 575 updating Score 242 uppercase letters 15, 18 URL property 1070 URLEncode method 576 useAlpha property 1070 useDiffuseWithTexture property 1071 useFastQuads property 1072 useHypertextStyles property 1072 useLineOffset property 1073 userData property 1073 userName (RealMedia) property 1075 userName property 1074 useTargetFrameRate property 1076 V value() method 576 values comparing 26 Object inspector 93 variables, storing and updating 21 values, expressing literal 18 variables call st
windowInFront property 1093 windowList property 1093 windowPresent() method 590 windows displaying strings in browser windows 415 forget method 319 minimize() method 399 on activateWindow handler 160 on closeWindow handler 162 on deactivateWindow handler 164 on moveWindow handler 187 on openWindow handler 188 on resizeWindow handler 190 on zoomWindow handler 201 open method 436 picture property 923 rect property 947 Windows Media object 135 words in chunk expressions 898 wordWrap property 1094 world units 9