MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference
MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference

Director scripting reference

Advertisement

DIRECTOR
MX
Director Scripting Reference

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING

  • Page 1 DIRECTOR Director Scripting Reference...
  • Page 2 If you access a third-party website mentioned in this guide, then you do so at your own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia endorses or accepts any responsibility for the content on those third-party sites.
  • Page 3: Table Of Contents

    CONTENTS CHAPTER 1: Introduction ..........5 Intended audience .
  • Page 4 CHAPTER 4: Debugging Scripts in Director ......83 Good scripting habits ..........84 Basic debugging.
  • Page 5: Chapter 1 Introduction

    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.
  • Page 6: What's New With Director Scripting

    JavaScript in Director is referred to as JavaScript syntax throughout this reference. The support of JavaScript syntax in Director helps create a scripting environment that is familiar not only to JavaScript developers but also to developers experienced with Macromedia Flash ActionScript, Macromedia Flash Communication Server, Macromedia Dreamweaver, Macromedia Authorware, and a number of other environments.
  • Page 7: What's New In This Documentation

    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”...
  • Page 8 Constants Provides a list of the constants that are available in Director. Events and Messages Provides a list of the events that are available in Director. Keywords Provides a list of the keywords that are available in Director. Methods Provides a list of the methods that are available in Director. Operators Provides a list of the operators that are available in Director.
  • Page 9: Chapter 2: Director Scripting Essentials

    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...
  • Page 10: Scripting Terminology

    • 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.
  • Page 11 • 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.
  • Page 12: Scripting Syntax

    • 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 , and width height...
  • Page 13 • Parentheses are required after all method and function names. For example, when calling the Sound object’s method, you must include the parentheses after the word beep. beep() Otherwise, a script error will occur. // JavaScript syntax _sound.beep(); // this statement will work properly _sound.beep;...
  • Page 14 • keyword can be used in JavaScript syntax to specify a constant whose value does not const change. Lingo has its own predefined set of constants ( , and so on); therefore, the EMPTY keyword does not apply to Lingo. const For example, the following statement specifies a constant named and sets its value...
  • Page 15: Data Types

    • 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 = true member("cat").hiLite = True MEMBER("CAT").HILITE = TRUE Member("Cat").Hilite = true Although Lingo is not case-sensitive, it’s a good habit to choose a case convention and use it...
  • Page 16 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.
  • Page 17 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.
  • Page 18: Literal Values

    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.
  • Page 19 A decimal number, also called a floating-point number, or float, is any number that includes a decimal point. In Lingo, the property controls the number of decimal places floatPrecision used to display these numbers. Director always uses the complete number, up to 15 significant digits, in calculations;...
  • Page 20 Constants A constant is a named value whose content never changes. In Lingo, the predefined terms , and are constants because their values TRUE FALSE VOID EMPTY are always the same. The predefined terms , and BACKSPACE ENTER QUOTE RETURN SPACE are constants that refer to keyboard characters.
  • Page 21: Variables

    For example, you cannot set the cast member property, which indicates the number numChannels of channels within a movie that contains Macromedia Shockwave content. However, you can return the number of channels by referring to the property of a cast member.
  • Page 22 Global variables can be shared among handlers, scripts, or movies. A global variable exists and retains its value as long as Director is running or until you call the method. clearGlobals() In Macromedia Shockwave Player, global variables persist among movies displayed by the method, but not among those displayed by the method. goToNetMovie() goToNetPage() Every handler that declares a variable as global can use the variable’s current value.
  • Page 23 To display all current global variables and their current values: • Use the Global object’s method in the Message window. showGlobals() For more information on the Message window, see “Debugging in the Message window” on page To clear all current global variables: •...
  • Page 24 • If you declare a variable inside or outside a JavaScript syntax function by using the syntax , the variable is available to all scripts within a movie. _global.varName The following example uses the syntax in one script to declare the variable _global.gMovie as global.
  • Page 25: Operators

    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. Some types of operators include the following: •...
  • Page 26 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. When placed before a number, reverses the sign of a number. Performs multiplication.
  • Page 27 Operator Meaning Precedence (JavaScript syntax only) Two operands are not equal and/or not of the same type (Lingo only) Two operands are not equal <> < The left operand is less than the right operand The left operand is less than or equal to the right operand <= The left operand is greater than the right operand >...
  • Page 28: Conditional Constructs

    (Lingo) or ! (JavaScript syntax) operator is useful for toggling a value to TRUE FALSE 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);...
  • Page 29 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.
  • Page 30 When writing structures in Lingo, you can place the statement or statements if...then following in the same line as , or you can place them on their own line by inserting a then then carriage return after . If you insert a carriage return, you must also include an then end if statement at the end of the...
  • Page 31 • 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);...
  • Page 32 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 structure.
  • Page 33: Events, Messages, And Handlers

    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.
  • Page 34 When the movie encounters a frame, events occur in the following order: This event occurs only if new sprites begin in the frame. beginSprite stepFrame prepareFrame After and before , Director handles any time delays enterFrame enterFrame exitFrame required by the tempo setting, idle events, and keyboard and mouse events. exitFrame This event occurs only if the playhead exits a sprite in the frame.
  • Page 35 • 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.
  • Page 36 After a handler intercepts a message, the message does not automatically pass on to the remaining locations. However, in Lingo you can use the method to override this default rule and pass() pass the message to other objects. If no matching handler is found after the message passes to all possible locations, Director ignores the message.
  • Page 37 For example, consider that you wrote a custom sprite method named that takes a single jump() integer as a parameter, and you placed the method in a behavior. When you call from a jump() sprite object reference, the handler must also include a parameter that represents the script object reference, and not just the single integer.
  • Page 38: Linear Lists And Property Lists

    // 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 calls the put(findColor()) handler and then displays the result in the Message window.
  • Page 39 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: •...
  • Page 40 The following statements illustrate defining the linear list that contains one value, workerList , and then adds as the second value in the list. Heather Carlos -- Lingo syntax workerList = ["Heather"] -- define a linear list workerList[2] = "Carlos" -- set the second value using the equal operator workerList.setAt(2, "Carlos") -- set the second value using setAt() // JavaScript syntax var workerList = list("Heather");...
  • Page 41 -- Lingo syntax foodList = [#Bruno:"sushi"] -- define a property list trace(foodList) -- displays [#Bruno: "sushi"] foodList.Bruno = "teriyaki" -- use dot syntax to set the value of Bruno trace(foodList) -- displays [#Bruno: "teriyaki"] // JavaScript syntax var foodList = propList("Bruno", "sushi"); // define a property list trace(foodList);...
  • Page 42 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 functions, passing the variable that put() trace() contains the list as a parameter.
  • Page 43 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 method. append() • To add an item at its proper position in a sorted list, use the methods.
  • Page 44 To create a copy of a list that is independent of another list: • Use the method. duplicate() 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");...
  • Page 45: Javascript Syntax Arrays

    // 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.
  • Page 46 • To delete an item from an array, use the Array object’s method. splice() • To replace an item in an array, use the Array object’s method. splice() The following example illustrates using the Array object’s method to add items to, splice() delete items from, and replace items in an array.
  • Page 47 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 method. sort() The following statements sort a non-sorted alphabetical array.
  • Page 48 Chapter 2: Director Scripting Essentials...
  • Page 49: Chapter 3: Writing Scripts In Director

    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 object- oriented scripting in Director.
  • Page 50: Scripting In Dot Syntax Format

    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.
  • Page 51: Introducing The Director Objects

    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]...
  • Page 52 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.
  • Page 53: Object Model Diagrams

    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. Object model diagrams...
  • Page 54: Top Level Functions And Properties

    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 property refers directly to the core Movie object, and the top level _movie...
  • Page 55: Object-Oriented Programming With Lingo

    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.
  • Page 56 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.
  • Page 57 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.
  • Page 58 The following handler creates a new child object from the parent script and initializes the on new child’s property with the value passed to it in the parameter. The spriteNum aSpriteNum return statement returns the child object to the handler that originally called the handler.
  • 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 method and assign the child object a variable new() name or position in a list so you can identify and work with it later.
  • Page 60 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.
  • Page 61 Using scriptInstanceList You can use the property to dynamically add new behaviors to a sprite. scriptInstanceList Normally, is the list of behavior instances created from the behavior scriptInstanceList 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.
  • Page 62 To add an object to the actorList: • Use the property as follows, where is a reference to the child object actorList childObject to add: -- Lingo syntax _movie.actorList.add(childObject) The object’s handler in its parent or ancestor script then runs automatically each stepFrame time the playhead advances.
  • Page 63 This statement uses the following elements: • is the variable you are placing the timeout object into. variableName • indicates which type of Lingo object you are creating. timeout • is the name you give to the timeout object. This name appears in the timeoutName .
  • Page 64 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 , and...
  • Page 65: Object-Oriented Programming With Javascript Syntax

    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.
  • Page 66 • 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.
  • Page 67 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 expression. Object instances The most common way to create a new object instance is to use the operator followed by the name of a constructor function.
  • Page 68 Object inheritance In addition to being able to create your own custom classes, another major advantage of object- oriented 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.
  • Page 69 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. To specify the scope of a custom property or method, you define it as one of the following four types: •...
  • Page 70 The following example defines a function named . The function name is Car_increaseSpeed() then assigned to the property of the class’s prototype object. increaseSpeed // 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 could then access the method and assign its value to...
  • Page 71 The following example defines a function named that can change the setInitialSpeed() default speed of new car instances. The function name is assigned to the setInitialSpeed property of the class. function Car(make, model, color) { // define a Car class this.make = make;...
  • Page 72 Deleting variables You can delete a class variable or an instance variable by using the operator. The following delete 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";...
  • Page 73: Writing Scripts In The Script Window

    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 object instance created previously, the following statements add the myCar property to after it has already been created.
  • Page 74 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.
  • Page 75 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.
  • Page 76 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 method and whose names actually appear in the pop-up menu.
  • Page 77 • 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.
  • Page 78 To find text in scripts: Make the Script window active. Select Edit > Find > Text. The Find Text dialog box appears. Enter text that you want to find in the Find field, and then click Find. By default, find is not case-sensitive: , and are all the ThisHandler...
  • Page 79 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.
  • Page 80 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 handler.
  • Page 81 Linked scripts are used by Director only during authoring. At runtime, Director projectors and Macromedia Shockwave Player use a special internal copy of the script data stored in the movie. This way, your linked scripts need not be distributed with your movies and cannot be copied by end users.
  • Page 82 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.
  • Page 83: Chapter 4: Debugging Scripts In Director

    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.
  • Page 84: Good Scripting Habits

    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. •...
  • Page 85 Script window each time you want to compile a script. When you compile your script, Macromedia Director MX 2004 gives you an error message if the script contains incorrect syntax. The message usually includes the line in which the problem was first detected.
  • Page 86 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.
  • Page 87: Debugging In The Script Window

    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: •...
  • Page 88 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() functions.
  • Page 89 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...
  • Page 90 Scripting Xtra extensions 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 method and whose names actually appear in the pop-up menu.
  • Page 91: Debugging In The Object Inspector

    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 -->...
  • Page 92 Global variables, such as gMyList • Child objects, such as gMyChild • Macromedia Flash objects, such as ; for more information about using Flash gMyFlashObject objects in Director, see the Using Director topics in the Director Help Panel. • Script expressions, such as sprite(7).blend...
  • Page 93 To view an object using the Inspect Object button: In the Script window, highlight the part of a statement that refers to an object. In the Script window, click Inspect Object. If the object has subproperties, a plus sign (+) appears to the left of it.
  • Page 94: Debugging In The Debugger Window

    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: •...
  • Page 95 To add a breakpoint that will open the Debugger window: In the Script window, open the script that should contain the breakpoint. 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.
  • Page 96 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.
  • Page 97 To add an object to the Watcher pane whose name does not appear in the Script pane: Double-click the first empty cell in the object column of the Watcher pane. 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.
  • Page 98: Debugging Projectors And Shockwave Movies

    Debugging projectors and Shockwave movies This section discusses debugging during runtime in Director projectors and movies that contain Macromedia Shockwave content. You can use either the Message window or enable full script error dialog boxes to debug projectors and movies that contain Shockwave content.
  • Page 99: Advanced 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? •...
  • Page 100 Chapter 4: Debugging Scripts in Director...
  • Page 101: Chapter 5: Director Core Objects

    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;...
  • Page 102 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.
  • Page 103 Method summary for the Global object Method clearGlobals() showGlobals() See also _global Used to monitor a user’s keyboard activity. You can access the Key object by using the top level property. You can either assign _key _key a variable, or use the property directly to access the Key object’s methods and properties.
  • Page 104 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.
  • Page 105 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),...
  • Page 106 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.
  • Page 107 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() updateStage() Property summary for the Movie object Property aboutInfo frameTransition...
  • Page 108 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 the core playback engine used to manage and execute the authoring environment,...
  • Page 109 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 searchCurrentFolder...
  • Page 110 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 property. _sound • Assign to a variable.
  • Page 111 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 method, the sound()
  • Page 112 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.
  • Page 113 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.
  • Page 114 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.
  • Page 115 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 property.
  • Page 116 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 function, the window() Player object’s...
  • Page 117 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...
  • Page 118 Chapter 5: Director Core Objects...
  • Page 119: Chapter 6: Media Types

    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.
  • Page 120 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. You can use bitmap image objects to perform simple operations that affect the content of an entire bitmap cast member, such as changing the background and foreground colors of the member, or to perform fine manipulations of the pixels of an image, such as cropping, drawing, and copying pixels.
  • Page 121 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 method.
  • Page 122 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 property of the palette bitmap cast member to the color palette cast member .
  • Page 123 Represents a DVD cast member. You can add a DVD cast member to a movie by using the Movie object’s method. newMember() -- 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.
  • Page 124 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...
  • Page 125 See also Member Flash Component Represents a Macromedia Flash component that is embedded in a cast member or sprite that contains Flash content. A Flash component provides prepackaged functionality that extends the existing functionality of cast members or sprites that contain Flash content. They are created and supported entirely by the Director development community.
  • Page 126 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 values that aren’t mutually exclusive. true false DateChooser...
  • Page 127 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.
  • Page 128 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 method.
  • Page 129 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...
  • Page 130 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) nodeExitCallback...
  • Page 131 Member Shockwave 3D Represents a Macromedia Shockwave 3D cast member. A Shockwave 3D (or simply 3D) cast member differs from other cast members in that a 3D cast member contains a complete 3D world. A 3D world contains a set of objects that are unique to 3D cast members, and that enable you to add 3D functionality to a movie.
  • Page 132 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 method. newMember() -- Lingo syntax _movie.newMember(#swa) // JavaScript syntax _movie.newMember("swa"); Event summary for the Shockwave Audio media type Event on cuePassed Method summary for the Shockwave Audio media type...
  • Page 133 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.
  • Page 134 Property summary for the Text media type Property antiAlias hyperlink antiAliasThreshold hyperlinkRange bottomSpacing hyperlinks charSpacing hyperlinkState firstIndent kerning fixedLineSpace kerningThreshold font 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.
  • Page 135 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...
  • Page 136 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)
  • Page 137: Chapter 7: Scripting Objects

    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.
  • Page 138 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 operator.
  • Page 139 SpeechXtra Enables you to add text-to-speech functionality to a movie. You can create a reference to a SpeechXtra object by using the operator. -- Lingo syntax objSpeech = new xtra("speechxtra") // JavaScript syntax var objSpeech = new xtra("speechxtra"); Method summary for the SpeechXtra object Method voiceCount() voiceSet()
  • Page 140 XML Parser Enables you to perform XML parsing. You can create a reference to an XML Parser object by using the operator. -- Lingo syntax objXml = new xtra("xmlparser") // JavaScript syntax var objXml = new xtra("xmlparser"); Method summary for the XML Parser object Method count() doneParsing()
  • Page 141: Chapter 8: 3D Objects

    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.
  • Page 142 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 property of the 3D object.
  • Page 143 Property (continued) fog.color() projection fog.decayMode rootNode fog.enabled (fog) 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.
  • Page 144 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 property of the 3D object.
  • Page 145 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 function, member() or by using the...
  • Page 146 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...
  • Page 147 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 method. After a modifier addModifier() has been attached to a model, its properties can be manipulated with script. The following modifiers are available to a model: Modifier Description...
  • Page 148 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.
  • Page 149 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 property of the 3D object.
  • Page 150 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 property of the 3D object.
  • Page 151: Chapter 9 Constants

    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.
  • Page 152 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 handler checks whether the Backspace key was pressed and, if it was, calls the on keyDown handler clearEntry...
  • Page 153 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 refers only to Enter on the numeric keypad. ENTER For a movie that plays back as an applet, use to specify both Return in Windows and RETURN...
  • Page 154 FALSE Usage -- Lingo syntax FALSE // JavaScript syntax false Description Constant; applies to an expression that is logically , such as 2 > 3. When treated as a FALSE number value, has the numerical value of 0. Conversely, 0 is treated as FALSE FALSE Example...
  • Page 155 This statement inserts quotation mark characters in a string: -- Lingo syntax put("Can you spell" && QUOTE & "Macromedia" & QUOTE & "?") // JavaScript syntax put("Can you spell \"Macromedia\"?"); The result is a set of quotation marks around the word Macromedia: Can you spell "Macromedia"? QUOTE...
  • Page 156 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...
  • Page 157 Usage -- Lingo syntax // 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 if it is: doNextField -- Lingo syntax if (_key.key = TAB) then doNextField // JavaScript syntax if (_key.keyCode == 48) {...
  • Page 158 TRUE Usage -- Lingo syntax TRUE // JavaScript syntax true Description Constant; represents the value of a logically true expression, such as . It has a traditional 2 < 3 numerical value of 1, but any nonzero integer evaluates to in a comparison.
  • Page 159: Chapter 10: Events And Messages

    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) // JavaScript syntax function activateApplication() { statement(s); Description Built-in handler;...
  • Page 160 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() // JavaScript syntax function activateApplication() { sound(1).queue(member("openSound")); sound(1).play(); See also deactivateApplication, activeCastLib, on deactivateWindow on activateWindow Usage -- Lingo syntax on activateWindow...
  • Page 161 See also activeWindow, close(), deactivateWindow, frontWindow, moveWindow, open() (Window) on beginSprite Usage -- Lingo syntax on beginSprite statement(s) // 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.
  • Page 162 on closeWindow Usage -- Lingo syntax on closeWindow statement(s) // 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. handler is a good place to put Lingo commands that you want executed on closeWindow every time the movie’s window closes.
  • Page 163 • The number of the sound or sprite channel for the file where the cue channelID point occurred. • The ordinal number of the cue point that triggers the event in the list of cuePointNumber the cast member’s cue points. •...
  • Page 164 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() // JavaScript syntax function deactivateApplication() { sound(1).queue(member("closeSound")); sound(1).play(); See also add (3D texture), activeCastLib, on deactivateWindow on deactivateWindow Usage -- Lingo syntax on deactivateWindow...
  • Page 165 on DVDeventNotification Usage -- Lingo syntax on DVDeventNotification objectRef, event {, eventArg1} {, eventArg2} {, eventArg3} statement(s) // 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.
  • Page 166 Event Description chapterStart Occurs when playback of a new program in the domain starts. title The following additional information is passed to DVDeventNotification when this event occurs: - An integer that indicates the new chapter number. • eventArg2 diskEjected Occurs when a DVD is ejected. diskInserted Occurs when a DVD is inserted.
  • Page 167 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: . An integer that indicates the new parental level set in the •...
  • Page 168 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: - An integer or address that indicates which playback or • eventArg2 search mechanisms the DVD disc explicitly disabled. Occurs when a DVD warning condition is encountered.
  • Page 169 Example This handler runs when the playhead exits a sprite: -- Lingo syntax on endSprite me -- clean up gNumberOfSharks = gNumberOfSharks - 1 sound(5).stop() // JavaScript syntax function endSprite() { // clean up gNumberOfSharks--; sound(5).stop(); See also beginSprite, on exitFrame on enterFrame Usage -- Lingo syntax...
  • Page 170 // JavaScript syntax function EvalScript(aParam) { statement(s); Description System message and event handler; in a movie with Macromedia Shockwave content, contains statements that run when the handler receives an message from a browser. The EvalScript parameter is a string passed in from the browser.
  • Page 171 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) // JavaScript syntax function EvalScript(aParam) { _movie.go(aParam); This handler runs the statement if it receives an message that _movie.go(aParam)
  • Page 172 on exitFrame Usage -- Lingo syntax on exitFrame statement(s) // 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 handler is attached to. The handler is a useful place on exitFrame on exitFrame...
  • Page 173 This handler branches the playhead to a specified frame if the value in the global variable exceeds 1000 when the playhead exits the frame: vTotal // JavaScript syntax function exitFrame() { if (_global.vTotal > 1000) { _movie.go("Finished"); See also on enterFrame on getBehaviorDescription Usage -- Lingo syntax...
  • Page 174 on getBehaviorTooltip Usage -- Lingo syntax on getBehaviorTooltip statement(s) // 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 message to the script when the cursor stops over it in getBehaviorTooltip...
  • Page 175 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 handler within a behavior script. Behaviors that on getPropertyDescriptionList don’t contain an handler don’t appear in the Parameters on getPropertyDescriptionList dialog box and can’t be edited from the Director interface.
  • Page 176 on hyperlinkClicked Usage -- Lingo syntax on hyperlinkClicked me, data, range statement(s) // JavaScript syntax function hyperlinkClicked(data, range) { statement(s); Description System message and event handler; used to determine when a hyperlink is actually clicked. This event handler has the following parameters: •...
  • Page 177 on idle Usage -- Lingo syntax on idle statement(s) // 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.
  • Page 178 on isOKToAttach Usage -- Lingo syntax on isOKToAttach me, aSpriteType, aSpriteNum statement(s) // 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.
  • Page 179 // JavaScript syntax function isOKToAttach(aSpriteType, aSpriteNum) { switch (aSpriteType) { case symbol("graphic"): // any graphic sprite type return sprite(aSpriteNum).member.type != symbol("shape"); // works for everything but shape cast members case symbol("script"): // the frame script channel return false; // doesn't work as a frame script on keyDown Usage -- Lingo syntax...
  • Page 180 You can override an handler by placing an alternative handler in a on keyDown on keyDown location that Lingo checks before it gets to the handler you want to override. For example, you can override an handler assigned to a cast member by placing an on keyDown on keyDown handler in a sprite script.
  • Page 181 When the movie plays back as an applet, an handler always traps key presses, even if the on keyUp handler is empty. If the user is typing in an editable field, an handler attached to the on keyUp field must include the command for the key to appear in the field.
  • Page 182 When the mouse button is pressed, Lingo searches the following locations, in order, for an handler: primary event handler, sprite script, cast member script, frame script, and mouseDown movie script. Lingo stops searching when it reaches the first location that has an on mouseDown handler, unless the handler includes the command to explicitly pass the...
  • Page 183 on mouseEnter Usage -- Lingo syntax on mouseEnter statement(s) // 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;...
  • Page 184 on mouseLeave Usage -- Lingo syntax on mouseLeave statement(s) // 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;...
  • Page 185 on mouseUp (event handler) Usage -- Lingo syntax on mouseUp statement(s) // 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 handler: primary event handler, sprite script, cast member script, frame script, and mouseUp movie script.
  • Page 186 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") // JavaScript syntax function mouseUp() { sprite(10).member = member("Dimmed");...
  • Page 187 on mouseWithin Usage -- Lingo syntax on mouseWithin statement(s) // 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;...
  • Page 188 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) // JavaScript syntax function moveWindow() { put("Just moved window containing " + _movie.name); See also activeWindow, name...
  • Page 189 on prepareFrame Usage -- Lingo syntax on prepareFrame statement(s) // JavaScript syntax function prepareFrame { statement(s); Description System message and event handler; contains statements that run immediately before the current frame is drawn. Unlike events, a event is generated each time the beginSprite endSprite prepareFrame...
  • Page 190 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.
  • Page 191 Example This handler moves sprite 3 to the coordinates stored in the variable when the centerPlace window that the movie is playing in is resized: -- Lingo syntax on resizeWindow centerPlace sprite(3).loc = centerPlace // JavaScript syntax function resizeWindow(centerPlace) { sprite(3).loc = centerPlace;...
  • Page 192 on rightMouseUp (event handler) Usage -- Lingo syntax on rightMouseUp statement(s) // 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. On Macintosh computers, the statements run if the mouse button is released while the Control key is pressed and the property is set to emulateMultiButtonMouse...
  • Page 193 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 . Normally, the currentInitializerList Parameters dialog box allows the user to set the mass and gravitational constants. However, this handler assigns these parameters constant values without displaying a dialog box: -- Lingo syntax property mass...
  • Page 194 Event handler; functions much like the scripting method, which is also available using the getURL Macromedia Flash Asset Xtra extension. The handler is called in Lingo when the on sendXML ActionScript method is executed in a Flash sprite or Flash XML object.
  • Page 195 // JavaScript syntax function sendXML(theURL, targetWindow, xmlData) { gotoNetPage(theURL, targetWindow); postNetText(theURL, xmlData); on startMovie Usage -- Lingo syntax on startMovie statement(s) // 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.
  • Page 196 on stepFrame Usage -- Lingo syntax on stepFrame statement(s) // JavaScript syntax function stepFrame() { statement(s); Description System message and event handler; works in script instances in because these are the actorList only objects that receive messages. This event handler is executed when the on stepFrame playhead enters a frame or the Stage is updated.
  • Page 197 on stopMovie Usage -- Lingo syntax on stopMovie statement(s) // JavaScript syntax function stopMovie() { statement(s); Description System message and event handler; contains statements that run when the movie stops playing. handler is a good place to put Lingo that performs cleanup tasks—such as on stopMovie closing resource files, clearing global variables, erasing fields, and disposing of objects—when the movie is finished.
  • Page 198 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. event handler has the following parameters: on streamStatus Displays the Internet address of the data being retrieved.
  • Page 199 on timeOut Usage -- Lingo syntax on timeOut statement(s) // 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 Always place an handler timeOutLength.
  • Page 200 Example The following handler pauses a movie when a user double-clicks the system tray icon. -- Lingo syntax on trayIconMouseDoubleClick _movie.delay(500) // JavaScript syntax function trayIconMouseDoubleClick() { _movie.delay(500); See also Movie, systemTrayIcon, trayIconMouseDown, trayIconRightMouseDown, Window trayIconMouseDown Usage -- Lingo syntax on trayIconMouseDown statement(s) // JavaScript syntax...
  • Page 201 trayIconRightMouseDown Usage -- Lingo syntax on trayIconRightMouseDown statement(s) // 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. event is sent to the handler only if the property trayIconRightMouseDown systemTrayIcon...
  • Page 202 event handler is a good place to put Lingo that rearranges sprites when on zoomWindow window dimensions change. Example This handler moves sprite 3 to the coordinates stored in the variable when the centerPlace window that the movie is playing in is resized: -- Lingo syntax on zoomWindow centerPlace = point(10, 10)
  • Page 203: Chapter 11: Keywords

    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.
  • Page 204 Description Keyword; starts a multiple branching logic structure that is easier to write than repeated statements. if...then Lingo compares the value in to the expressions in the lines beneath it, starting case expression 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...
  • Page 205 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.
  • Page 206 Usage -- Lingo syntax Description Keyword; marks the end of handlers and multiple-line control structures. Example The following handler ends with an statement. mouseDown end mouseDown on mouseDown _player.alert("The mouse was pressed") end mouseDown end case Usage -- Lingo syntax end case Description Keyword;...
  • Page 207 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 See also abort, halt(), quit(), pass, return (keyword) exit repeat Usage...
  • Page 208 Any variables manipulated in the Message window are automatically global, even though they are not explicitly declared as such. Movies with Macromedia Shockwave content playing on the Internet cannot access global variables within other movies, even movies playing on the same HTML page. The only way...
  • Page 209 See also showGlobals(), property, gotoNetMovie 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)
  • Page 210 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...
  • Page 211 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 property. itemDelimiter The terms , and must be integers or integer expressions that whichItem firstItem lastItem...
  • Page 212 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 to the field cast member To Do: Action member("To Do").text = Action.line[1..4] This statement inserts the word...
  • Page 213 on new me return me The following two sets of handlers make up a parent script. The first set uses to refer to the child object. The second set uses the variable to refer to the child object. In all other myAddress respects, the parent scripts are the same.
  • Page 214 keyword is followed immediately by a colon, a space, and the name of the menu. In menu 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 keyword.
  • Page 215 Usage -- Lingo syntax 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 next Usage...
  • Page 216 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 keyword. exit repeat 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)
  • Page 217 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 keyword. • If the user pressed any other key, the movie executes the statement that follows the otherwise keyword.
  • Page 218 This parent script handler declares a property to make it available: pMySpriteNum -- script Elder property pMyChannel on new me, whichSprite me.pMyChannel = whichSprite return me The original behavior script sets up the ancestor and passes the property to spriteNum all behaviors: property spriteNum property ancestor...
  • Page 219 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 specifies a nonexistent target chunk, the string value is inserted as appropriate chunkExpression into the container.) Chunk expressions refer to any character, word, item, or line in any container.
  • Page 220 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"...
  • Page 221 repeat with Usage -- Lingo syntax repeat with counter = start to finish statement(s) end repeat Description Keyword; executes the Lingo specified by the number of times specified by statement(s) . The value of is the difference between the value specified by and the counter counter...
  • Page 222 While in a repeat loop, Lingo ignores other events. To check the current key in a repeat loop, use property. keyPressed 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).
  • Page 223 return (keyword) Usage -- Lingo syntax return expression Description Keyword; returns the value of and exits from the handler. The expression 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...
  • Page 224 set...to, set...= Usage -- Lingo syntax lingoProperty = expression variable = expression Description Command; evaluates an expression and puts the result in the property specified by or the variable specified by lingoProperty variable Example This statement sets the name of member 3 to Sunset: member(3).name = "Sunset"...
  • Page 225 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 is entirely inside the quad of ) or not ( sprite1 sprite2 TRUE FALSE If both sprites have matte ink, their actual outlines, not the quads, are used.
  • Page 226 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. A word chunk is any sequence of characters delimited by spaces.
  • Page 227: Chapter 12 Methods

    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.
  • Page 228 abs() Usage --Lingo syntax abs (numericExpression) // JavaScript syntax Math.abs (numericExpression) Description Math function (Lingo only); calculates the absolute value of a numerical expression. function has several uses. It can simplify the tracking of mouse and sprite movement abs() by converting coordinate differences (which can be either positive or negative numbers) into distances (which are always positive numbers).
  • Page 229 Parameters Required. A point in Stage coordinates that specifies the location of the embedded point(x, y) 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));...
  • Page 230 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.
  • Page 231 Description modifier command; adds an empty texture layer to the model’s mesh. meshdeform 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.add() // JavaScript syntax...
  • Page 232 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 Required. The texture to apply to the backdrop. texture Required.
  • Page 233 Parameters Required. A reference to the camera to add to the list of cameras for the sprite. whichCamera Required. An integer that specifies the index in the list of cameras at which index whichCamera is added. If is greater than the value of , the camera is added to the end of index cameraCount()
  • Page 234 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 argument to maintain Bird’s world position.
  • Page 235 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").addModifier(symbol("toon")); See also bonesPlayer (modifier), collision (modifier), inker (modifier), keyframePlayer (modifier), (modifier), meshDeform (modifier), (modifier), toon (modifier), getRendererServices(), removeModifier, modifier, modifier[], modifiers addOverlay Usage...
  • Page 236 // 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.
  • Page 237 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).addToWorld() Description 3D command; inserts the model, group, camera, or light into the 3D world of the cast member as a child of the group named World. When a model, group, camera, or light is created or cloned, it is automatically added to the world.
  • Page 238 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 Required.
  • Page 239 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"...
  • Page 240 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.
  • Page 241 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. This handler lets you convert between degrees and radians: -- Lingo syntax on DegreesToRads degreeValue return degreeValue * PI/180...
  • Page 242 // 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 , the playhead automatically advances one frame and begins beginRecording() recording in that frame.
  • Page 243 // 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;...
  • Page 244 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 00000000000000000000000000000001...
  • Page 245 Parameters Required. The first integer. integer1 Required. The second integer. integer2 Example This statement compares the 32-bit binary versions of 5 and 6 and returns the result as an integer: put bitOr(5, 6) -- 7 See also bitNot(), bitAnd(), bitXor() bitXor() Usage bitXor(integer1, integer2)
  • Page 246 breakLoop() Usage -- Lingo syntax soundChannelObjRef.breakLoop() // JavaScript syntax soundChannelObjRef.breakLoop(); Description Sound Channel method; causes the currently looping sound in channel soundChannelObjRef stop looping and play through to its endTime If there is no current loop, this method has no effect. Parameters None.
  • Page 247 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"...
  • Page 248 Director or as projectors. This cacheDocVerify function is not valid for movies with Macromedia Shockwave content because they use the network settings of the browser in which they run. -- Lingo syntax...
  • Page 249 // JavaScript syntax function resetCache() { current = cacheDocVerify(); if (current == symbol("once")) { alert("Turning cache verification on"); cacheDocVerify(symbol("always")) Parameters Optional. A symbol that specifies how often the contents of a page on the Internet cacheSetting are refreshed. Possible values are (default) and .
  • Page 250 // 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. command can use a variable as the name of the handler.
  • Page 251 The following example shows how a statement can call handlers in a behavior or parent call script and its ancestor. • This is the parent script: -- Lingo syntax -- script Man property ancestor on new me set ancestor = new(script "Animal", 2) return me on run me, newTool put "Man running with "&the legCount of me&"...
  • Page 252 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 , the name of the handler can be a variable, and you can explicitly callAncestor bypass the handlers in the primary script and go directly to the ancestor script.
  • Page 253 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]...
  • Page 254 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. The view from each camera in the list is displayed on top of the view from camera with lower positions.
  • Page 255 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.
  • Page 256 The default cast library number is 1. To specify a cast member in a cast library other than cast 1, to specify the alternative cast library. castLib() Parameters Required. A string that specifies the cast library name, or an integer that specifies castNameOrNum the cast library number.
  • Page 257 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 method. sound() Parameters Required. An integer that specifies the sound channel to reference. intChannelNum Example This statement sets the variable named myChannel to sound channel 2:...
  • Page 258 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.
  • Page 259 6, 10) -- "media" The following statement tries to identify the sixth through twentieth characters of the word Macromedia. Because the word has only 10 characters, the result includes only the sixth through tenth characters. put chars ("Macromedia", 6, 20) -- "media"...
  • Page 260 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...
  • Page 261 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. command clears only the cache, which is separate from the browser’s cache. clearCache If a file is in use, it remains in the cache until it is no longer in use.
  • Page 262 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 property to -1 to indicate that an error occurred.
  • Page 263 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...
  • Page 264 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 (Lingo) or (JavaScript): VOID null -- Lingo syntax on mouseDown _global.clearGlobals() // JavaScript syntax...
  • Page 265 cloneDeep Usage member(whichCastmember).model(whichModel).cloneDeep(cloneName) member(whichCastmember).group(whichGroup).cloneDeep(cloneName) member(whichCastmember).light(whichLight).cloneDeep(cloneName) member(whichCastmember).camera(whichCamera).cloneDeep(cloneName) Description 3D command; creates a copy of the model, group, light, or camera plus all of the following: • The model resources, shaders, and textures used by the original model or group • The children of the model, group, light, or camera •...
  • Page 266 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...
  • Page 267 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 method. This allows rapid access to windows that you want to open() (Window) keep available.
  • Page 268 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. command doesn’t work for URLs. closeXlib In Windows, using the DLL extension for Xtra extensions is optional.
  • Page 269 Parameters Required if using 8-bit palette values. An integer that specifies the 8-bit palette intPaletteIndex value to use. Valid values range from 0 to 255. All other values are truncated. Required if using RGB values. An integer that specifies the red color component in the intRed current palette.
  • Page 270 Parameters Required. An integer that specifies the sprite whose horizontal coordinates are intSpriteNum evaluated against intPosn Required. An integer to be evaluated against by the horizontal coordinates of the left and intPosn right sides of the sprite identified by intSpriteNum Example These statements check the function for sprite 1 when it has left and right...
  • Page 271 Both the s constrain only one axis each. constrainV() constrainH() Parameters Required. An integer that identifies the sprite whose vertical coordinates are intSpriteNum evaluated against intPosn Required. An integer to be evaluated against by the vertical coordinates of the left and intPosn right sides of the sprite identified by intSpriteNum...
  • Page 272 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 Required. A reference to the source image object from which pixels are copied. sourceImgObj Required if copying pixels into a screen coordinate rectangle or a floating point destRectOrQuad quad.
  • Page 273 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.
  • Page 274 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 function. cos() Parameters Required. An integer that specifies the angle to test. angle Example The following statement calculates the cosine of...
  • Page 275 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 Required.
  • Page 276 createMatte() Syntax imageObject.createMatte({alphaThreshold}) Description This function creates and returns a matte object that you can use with to duplicate copyPixels() the effect of the matte sprite ink. The matte object is created from the specified image object’s alpha layer. The optional parameter excludes from the matte all pixels whose alphaThreshold alpha channel value is below that threshold.
  • Page 277 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 to trim existing cast members, or in conjunction with the picture of the Stage to crop grab a snapshot and then crop it to size for display.
  • Page 278 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 vector2 Example In this example, is a vector on the x axis and is a vector on the y axis.
  • Page 279 • Use the syntax for the custom cursors available through the _player.cursor(cursorMemRef) 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 to specify default system cursors. The term _player.cursor(intCursorNum) must be one of the following integer values: intCursorNum...
  • Page 280 Value Description Wait mouse down 1 Wait mouse down 2 Vertical size Horizontal size Diagonal size Closed hand No-drop hand Copy (closed hand) Inverse arrow Rotate Skew Horizontal double arrow Vertical double arrow Southwest Northeast double arrow Northwest Southeast double arrow Smear/smooth brush Air brush Zoom in...
  • Page 281 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.
  • Page 282 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. Creates a standard, formatted date object instance for use with other date object instances in arithmetic operations and for use in manipulating dates across platforms and in international formats.
  • Page 283 Optional when creating a Lingo date object. An integer that specifies the new intFormat date object. Optional when creating a Lingo date object. An integer that specifies the four- intYearFormat digit year of the new date object. Optional when creating a Lingo date object. An integer that specifies the two- intMonthFormat digit month of the new date object.
  • Page 284 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. •...
  • Page 285 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, is useful for controlling the playback rate of a sequence of frames. delay() method can be applied only when the playhead is moving.
  • Page 286 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. command checks whether an item is in a list; if you try to delete an object that deleteAt isn’t in the list, Director displays an alert.
  • Page 287 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.
  • Page 288 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()
  • Page 289 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 Required. A string or integer that specifies the name or index position of the lightNameOrNum light to delete.
  • Page 290 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.
  • Page 291 deleteOne Usage list.deleteOne(value) deleteOne list, value Description List command; deletes a value from a linear or property list. For a property list, also deleteOne deletes the property associated with the deleted value. If the value appears in the list more than once, deletes only the first occurrence.
  • Page 292 See also deleteAt deleteShader Usage member(whichCastmember).deleteShader(whichShader) member(whichCastmember).deleteShader(index) Description 3D command; removes the shader from the cast member. Parameters Required. A string or integer that specifies the name or index position of the shaderNameOrNum 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.
  • Page 293 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 Required. An integer that specifies the index position of the vertex to delete. indexToRemove Example This line removes the second vertex point in the vector shape Archie:...
  • Page 294 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 Required. A string that specifies the title displayed in the Save dialog box. stringTitle Required.
  • Page 295 doneParsing() Usage parserObject.doneParsing() Description Function; returns when the parser has completed parsing a document using 1 (TRUE) . The return value is until the parsing is complete. parseURL() 0 (FALSE) 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 is the cosine of the angle between the two vectors.
  • Page 296 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 is the cosine of the angle between the two vectors. dotproduct To manually arrive at the dot of two vectors, multiply the x component of by the x vector1...
  • Page 297 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 command.
  • Page 298 Required if drawing a line using coordinates. An integer that specifies the coordinate of the end of the line. Required if drawing a line using coordinates. An integer that specifies the coordinate of the end of the line. Required. A color object or parameter list that specifies the color of the colorObjOrParamList line or shape’s border.
  • Page 299 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;...
  • Page 300 Parameters Optional. An integer that specifies the Cast window for the duplicate cast member. If intPosn 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()
  • Page 301 _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.enableHotSpot(hotSpotID, trueOrFalse);...
  • Page 302 Example When used in the following handler, the keyword ends the Score endRecording 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...
  • Page 303 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 through start finish -- Lingo syntax on deleteMember start, finish repeat with i = start to finish member(i).erase() end repeat...
  • Page 304 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.
  • Page 305 Alternatively, define a script for the event: <SCRIPT FOR="NameOfShockwaveInstance" EVENT="externalEvent(aParam)" LANGUAGE="VBScript"> 'script here </SCRIPT> 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).extrude3D(member(which3dCastmember)) Description 3D command;...
  • Page 306 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 <EMBED> or <OBJECT> tag. If specifying a parameter by name, this method returns any parameter names that matches .
  • Page 307 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. A string value that specifies text to be used in the movie. swText swURL A string URL that may specify the location of another movie with Shockwave...
  • Page 308 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 A string that specifies the location of a Shockwave Audio file to be played with the swAudio movie.
  • Page 309 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()
  • Page 310 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...
  • Page 311 fadeTo() Usage -- Lingo syntax soundChannelObjRef.fadeTo(intVolume {, intMilliseconds}) // JavaScript syntax soundChannelObjRef.fadeTo(intVolume {, intMilliseconds}); Description Sound Channel method; gradually changes the of a sound channel to a specified volume volume over a given number of milliseconds. The current pan setting is retained for the entire fade. To see an example of used in a completed movie, see the Sound Control movie in the fadeTo()
  • Page 312 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. Fills a rectangular region with a specified color in a given image object. This method returns a value of 1 if there is no error, zero if there is an error.
  • Page 313 Required if filling a region using points. Two points that specify the point(x, y), point(x, y) upper-left and lower-right corners of region to fill, relative to the upper-left corner of the given image object. Required if filling a region using a rectangle. A rectangle that specifies the rectangular region rect to fill.
  • Page 314 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. Using with linear lists returns a bogus number if the value of is a number and...
  • Page 315 command is similar to the command, except that when the specified findPosNear findPos property is not in the list, the command identifies the position of the value with the findPosNear most similar alphanumeric name. This command is useful in finding the name that is the closest match in a sorted directory of names.
  • Page 316 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).
  • Page 317 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 property. floatPrecision In JavaScript syntax, use the function.
  • Page 318 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...
  • Page 319 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 on a window also removes that window’s reference from the forget() windowList When the...
  • Page 320 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.
  • Page 321 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 if the specified cast members have been downloaded, and if not.
  • Page 322 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.
  • Page 323 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(),...
  • Page 324 generateNormals() Usage member(whichCastmember).modelResource(whichModelResource). generateNormals(style) Description model resource command; calculates the vectors for each vertex of the mesh. #mesh normal If the parameter is set to , each vertex receives a normal for each face to which it style #flat belongs. Furthermore, all three of the vertices of a face will have the same normal. For example, if the vertices of all receive and the vertices of...
  • Page 325 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 , or in the list specified by item listPosition propertyName list •...
  • Page 326 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. command works with linear and property lists. This command has the same function getAt as the command for linear lists.
  • Page 327 You can also use the bracket list access: firstPerson = employeeInfoList[1] put firstPerson -- ["Dennis", "consulting", 510] firstPersonDept = firstPerson[2] put firstPersonDept -- "consulting" As with , brackets can be nested: getAt firstPersonDept = employeeInfoList[1][2] See also getaProp, setaProp, setAt getError() (Flash, SWA) Usage -- Lingo syntax...
  • Page 328 Parameters None. Example This handler uses to determine whether an error involving the Shockwave Audio cast getError 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...
  • Page 329 // 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.getError() Description Function; returns the descriptive error string associated with a given error number (including the line and column number of the XML where the error occurred).
  • Page 330 Possible integer values and corresponding messages are: getError() getErrorString() getError() value getErrorString() message memory network playback device other Parameters None. Example This handler uses to determine whether an error occurred for Shockwave Audio cast getError() member Norma Desmond Speaks, and if so, uses to obtain the error message getErrorString and assign it to a field cast member:...
  • Page 331 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 on the getProperty() 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.
  • Page 332 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.
  • Page 333 is a linear list containing the maximum width and height of a texture, in #maxTextureSize 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 value at run time.
  • Page 334 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]:...
  • Page 335 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 before using to return the length openFile() getLength() of the file. Parameters None.
  • Page 336 To see an example of used in a completed movie, see the Forms and Post movie in getNetText() the Learning/Lingo folder inside the Director application folder. Parameters Required. The URL to the file that contains the text to get. Optional. Specifies a property list used for CGI queries. propertyList Optional.
  • Page 337 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...
  • Page 338 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 command returns the result 0 when the specified value is not in the list.
  • Page 339 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.
  • Page 340 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.
  • Page 341 // 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.getPosition(); Description Fileio method;...
  • Page 342 To see an example of used in a completed movie, see the Read and Write Text movie getPref() in the Learning/Lingo folder inside the Director application folder. Parameters Required. A string that specifies the file for which content is retrieved. stringPrefName Example This handler retrieves the content of the file Test and then assigns the file’s text to the field...
  • Page 343 getPref() Usage getPref(prefFileName) Description Function; retrieves the content of the specified file. When you use this function, replace with the name of a file created by the prefFileName function. If no such file exists, returns setPref getPref VOID The filename used for must be a valid filename only, not a full path;...
  • Page 344 Example This statement identifies the value associated with the property 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 See also getOne() getPropAt() Usage list.getPropAt(index) getPropAt(list, index) Description...
  • Page 345 • indicates the bit depth of the hardware output buffer. depthBufferDepth • indicates the bit depth of the color buffer. This property can be tested colorBufferDepth but not set. • is a linear list of modifiers available for use by models in 3D cast members. Possible modifiers values include #collision...
  • Page 346 This statement displays in the message window the current status of a download begun with and the resulting net ID placed in the variable getNetText() netID put getStreamStatus(netID) -- [#URL: "www.macromedia.com", #state: "InProgress", #bytesSoFar: 250, #bytesTotal: 50000, #error: EMPTY] See also streamStatus, tellStreamStatus()
  • Page 347 This statement sets the variable to refer to the same object that the variable named tObject 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 from the Flash cast member in sprite currentURL 3 and displays it in the Message window:...
  • Page 348 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"). getworldTransform().rotation --vector(0.0000, 0.0000, 0.0000) See also worldPosition,...
  • Page 349 Parameters Required. A string that specifies the marker label of the frame to which the frameNameOrNum playhead branches, or an integer that specifies the number of the frame to which the playhead branches. Optional. A string that specifies the movie that contains the frame specified by movieName .
  • Page 350 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. •...
  • Page 351 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.
  • Page 352 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) // JavaScript syntax function Navigate(whereTo) { sprite(5).goToFrame(whereTo); gotoNetMovie Usage gotoNetMovie URL gotoNetMovie (URL)
  • Page 353 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 command launches the preferred browser if it is gotoNetPage...
  • Page 354 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") Example...
  • Page 355 handler() Usage scriptObject.handler(#handlerSymbol) Description This function returns if the given contains a specified handler, and TRUE scriptObject FALSE it does not. The script object must be a parent script, a child object, or a behavior. Parameters Required. Specifies the name of the handler. symHandler Example This Lingo code invokes a handler on an object only if that handler exists:...
  • Page 356 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.
  • Page 357 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...
  • Page 358 Required. Logical expression that determines whether the frame is a drop frame dropFrame ) or not ( ). If the string ends in a d, the time is treated as a drop frame, regardless TRUE FALSE of the value of dropFrame Required.
  • Page 359 // 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.identity() Description 3D command; sets the transform to the identity transform, which is transform(1.0000,0.0000,0.0000,0.0000, 0.0000,1.0000,0.0000,0.0000, 0.0000,0.0000,1.0000,0.0000, 0.0000,0.0000,0.0000,1.0000) property of the identity transform is...
  • Page 360 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 ( ) or TRUE are still waiting to be loaded ( FALSE Parameters Required. An integer that specifies the load tag for the cast members to test. intLoadTag Example This statement checks whether all cast members whose load tag is 20 have been loaded and then...
  • Page 361 Example These Lingo statements leave set to the default of and parse the given ignoreWhiteSpace() TRUE XML into a list. The element has no children in the list. <sample> XMLtext = "<sample> </sample>" parserObj.parseString(XMLtext) theList = parserObj.makelist() put theList -- ["ROOT OF XML DOCUMENT": ["!ATTRIBUTES": [:], "sample": ["!ATTRIBUTES": [:]]]] These Lingo statements set and then parse the given XML into a...
  • Page 362 The following table shows the return value for each type of object recognized by ilk() Type of ilk(Object) returns ilk(Object, Type) Example Object 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...
  • Page 363 Example The following statement identifies the type of the object named Bids: Bids = [:] put ilk( Bids ) -- #proplist The following 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...
  • Page 364 Type of object ilk(object) returns ilk(object, Type) if only Type = vector #vector #vector transform #transform #transform Parameters Required. Specifies the object to test. object Optional. Specifies the type to which is compared. If the object is of the specified type object type, the...
  • Page 365 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 used in a completed movie, see the Imaging movie in the Learning/ image()
  • Page 366 • 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() download the file to a local disk first, and then import the file from the local disk.
  • Page 367 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.
  • Page 368 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 sets the numberOfFrames number of frames. -- Lingo syntax on animBall(numberOfFrames) _movie.beginRecording() _movie.frameTransition = member("Fog").number _movie.go(_movie.frame + 1)
  • Page 369 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...
  • Page 370 Parameters Optional. Specifies the field cast member to which a menu is installed. fieldMemberObjRef 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"...
  • Page 371 integerP() Usage expression.integerP (numericExpression).integerP integerP(expression) Description Function (Lingo only); indicates whether a specified expression can be evaluated to an integer ) or not ( ). P in stands for predicate. 1 or TRUE 0 or FALSE integerP Parameters Required. The expression to test. expression Example This statement checks whether the number 3 can be evaluated to an integer and then displays 1...
  • Page 372 interpolate() Usage transform1.interpolate(transform2,percentage) Description method; returns a copy of created by interpolating from the position transform transform1 and rotation of to the position and rotation of by the specified transform1 transform2 percentage. The original is not affected. To interpolate , use transform1 transform1 interpolateTo()
  • Page 373 intersect() Usage rectangle1. Intersect(rectangle2) intersect(rectangle1, rectangle2) Description Function; determines the rectangle formed where two rectangles intersect. Parameters Required. Specifies the second rectangle in the intersection test. rectangle2 Example This statement assigns the variable to the rectangle formed where rectangle newRectangle toolKit intersects rectangle Ramp: newRectangle = toolKit.intersect(Ramp) See also...
  • Page 374 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 method; inverts the position and rotation properties of the transform. transform This method changes the original transform. To invert a copy of the original transform, use the function. inverse() Parameters None. Example This statement inverts the transform of the model Box: member("3d world").model("Box").transform.invert()
  • Page 375 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...
  • Page 376 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.
  • Page 377 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."...
  • Page 378 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 if the key was pressed: updateData -- Lingo syntax if (_key.keyPressed(RETURN)) then updateData end if // JavaScript syntax if (_key.keyPressed(36)) { updateData();...
  • Page 379 Required. Specifies the chunk expression that contains the last chunk. chunkExpression Example This statement identifies the last word of the string “Macromedia, the multimedia company” and displays the result in the Message window: put the last word of "Macromedia, the multimedia company"...
  • Page 380 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. 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: if the lastClick >...
  • Page 381 length() Usage string.length length(string) Description Function; returns the number of characters in the string specified by , including spaces string 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"...
  • Page 382 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...
  • Page 383 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);...
  • Page 384 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 . To create a list with a large amount of data, enclose the data in square list() brackets ([]), put the data into a field, and then assign the field to a variable.
  • Page 385 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 property must be either -1 (error) or 4 (loaded) before the state loadFile command is used. Parameters Required.
  • Page 386 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.
  • Page 387 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 function. log() Parameters Required. A number from which the natural logarithm is calculated. This number must number be a decimal number greater than 0.
  • Page 388 end if return parsedList // 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;...
  • Page 389 makeSubList() Usage XMLnode.makeSubList() Description Function; returns a property list from a child node the same way that returns the makeList() root of an XML document in list format. Parameters None. Example Beginning with the following XML: <?xml version="1.0"?> <e1> <tagName attr1="val1" attr2="val2"/> <e2>element 2</e2>...
  • Page 390 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.
  • Page 391 If the specified point on the Stage is not within the sprite, a is returned. VOID Parameters Required. A point from which an equivalent point is returned. whichPointInMember See also map(), mapStageToMember() mapStageToMember() Usage sprite(whichSpriteNumber). mapStageToMember(whichPointOnStage) mapStageToMember(sprite whichSpriteNumber, whichPointOnStage) Description Function;...
  • Page 392 • — Returns the frame number of the first marker before the marker(0). marker(-1) • — Returns the frame number of the second marker before the marker(0). marker(-2) If the parameter is a string, returns the frame number of the first markerNameOrNum marker() frame whose marker label matches the string.
  • Page 393 -- Lingo syntax on findWinner Bids Winner = Bids.max() member("Congratulations").text = \ "You have won, with a bid of $" & Winner &"!" // JavaScript syntax function findWinner(Bids) { Winner = Bids.max(); member("Congratulations").text = "You have won, with a bid of $" + \ Winner + "!");...
  • Page 394 Usage mci "string" Description Command; for Windows only, passes the strings specified by to the Windows Media string 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 Required.
  • Page 395 Optional. A string that specifies the cast library name to which the member castNameOrNum belongs, or an integer that specifies the index position of the cast library to which the member belongs. If omitted, searches all cast libraries until a match is found. member() Example This statements sets the variable...
  • Page 396 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 propList properties.
  • Page 397 • allows you to get or set the list of normal vectors used by the specified mesh. normalList • allows you to get or set the texture coordinates used by the first textureCoordinateList 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 •...
  • Page 398 • allows access to the properties of the specified mesh. mesh[index] 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.count -- 2 The following statement displays the number of faces in the second mesh of the model named...
  • Page 399 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 <>...
  • Page 400 Parameters Optional. A string that specifies the name of the model to return. whichModel 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.
  • Page 401 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.
  • Page 402 Optional. A list of model references that are included if they are found under the modelList 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.
  • Page 403 Parameters Required. A vector from which a ray is drawn and under which a list of models locationVector is found. Required. A vector that specifies the direction the ray is pointing. directionVector Optional. A list that specifies the maximum number of models to return, the level optionsList of information detail, a list of models among which to cast, and the maximum distance to draw the ray.
  • Page 404 This statement builds a list of options that would return a maximum of ten models, include simple detail, draw results from , and have a maximum ray distance of 50: tModelList 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").modelsUnderRay(vector(0, 0, 300), vector(0, 0, -\...
  • Page 405 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 , or is found at the index position specified by the . As whichMotion index , this property returns the total number of motions found within the cast member. motion.count Object name string comparisons are not case-sensitive.
  • Page 406 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");...
  • Page 407 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 in front of all other windows: windowList -- Lingo syntax myWindow = _player.windowList[1] myWindow.moveToFront() // JavaScript syntax...
  • Page 408 Parameters Required. Specifies the index position of the vertex to move. vertexIndex Required. Specifies the amount to move the vertex horizontally. xChange Required. Specifies the amount to move the vertex vertically. yChange 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)
  • Page 409 See also addVertex(), deleteVertex(), originMode, vertexList multiply() Usage transform.multiply(transform2) Description 3D command; applies the positional, rotational, and scaling effects of after the transform2 original transform. Parameters Required. Specifies the transform that contains the effects to apply to another transform2 transform. Example This statement applies the positional, rotational, and scaling effects of the model Mars’s transform to the transform of the model Pluto.
  • Page 410 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() postNetText() In some cases, when a network ID is not available, you can use a URL to stop the transmission of...
  • Page 411 Parameters Optional. Specifies the ID of the network operation to test. netID Example The following handler uses the function to test whether the last network operation has netDone finished. If the operation is finished, text returned by is displayed in the field cast netTextResult member Display Text.
  • Page 412 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.
  • Page 413 Example This statement passes a network ID to to check the error status of a particular netError network operation: --Lingo syntax on exitFrame global mynetID if netError(mynetID)<>"OK" then beep // JavaScript syntax function exitFrame() { global mynetID; if (netError(mynetID) != "OK") { _sound.beep();...
  • Page 414 // 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).
  • Page 415 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. command doesn’t work in projectors.
  • Page 416 If the specified network operation was , the text is the text of the file on getNetText() the network. If the specified network operation was , the result is the server’s response. postNetText After the next operation starts, Director discards the results of the previous operation to conserve memory.
  • Page 417 For cast members, the parameter sets the cast member’s type. Possible predefined values type correspond to the existing cast member types: , and so on. The function can #bitmap #field 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.
  • Page 418 After the line has been executed, will contain the member reference to the cast newMember 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 method.
  • Page 419 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()
  • Page 420 newCurve() Usage -- Lingo syntax memberObjRef.newCurve(positionInVertexList) // JavaScript syntax memberObjRef.newCurve(positionInVertexList); Description Function; adds a symbol to the , which adds a #newCurve vertexList vectorCastMember new shape to the vector shape. You can break apart an existing shape by calling with newCurve() a position in the middle of a series of vertices.
  • Page 421 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 Required. Specifies the name of the new light. The name of the new light must be newLightName unique within the light palette.
  • Page 422 When the argument for the function is a parent script, the function creates a new() child object. The parent script should include an handler that sets the child object’s initial on new state or property values and returns the reference to the child object. The child object has all the handlers of the parent script.
  • Page 423 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 properties of the new mesh, followed by a vertexList face[index].vertices call to its command, in order to actually generate the geometry. build() Parameters Required.
  • Page 424 Line 17 calls the command to construct the mesh. build 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 ]...
  • Page 425 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 parameter and specify facing #box #sphere...
  • Page 426 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 command.
  • Page 427 Parameters Required. Specifies the type of new object to create. objectType Optional. Specifies any initialization arguments required by the object. Each arg1, arg2, ... argument must be separated by a comma. Example This Lingo sets the variable to a reference to a new object tLocalConObject LocalConnection...
  • Page 428 Parameters Required. Specifies the name of the new shader. The name of the new shader newShaderName must be unique in the shader list. Required. A symbol that determines the style in which the shader is applied. Valid shaderType values include the following: •...
  • Page 429 Optional. Specifies the type of the new texture. If omitted, the new texture is typeIndicator created with no specific type. Valid values include the following: • (a cast member) #fromCastMember • (a Lingo image object) #fromImageObject Optional. Specifies a reference to the source cast member or Lingo sourceObjectReference image object.
  • Page 430 nothing Usage nothing Description Command; does nothing. This command is useful for making the logic of an if...then statement more obvious. A nested statement that contains no explicit if...then...else command for the clause may require , so that Lingo does not interpret the else else nothing clause as part of the preceding...
  • Page 431 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 command has nudge no return value.
  • Page 432 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.
  • Page 433 objectP() Usage objectP(expression) Description Function; indicates whether a specified expression is an object produced by a parent script, Xtra, or window ( ) or not ( TRUE FALSE The P in stands for predicate. objectP It is good practice to use to determine which items are already in use when you create objectP objects by parent scripts or Xtra instances.
  • Page 434 This statement displays in the Message window the beginning position of the string “Micro” within the string “Macromedia”: put offset("Micro", "Macromedia") The result is 0, because “Macromedia” doesn’t contain the string “Micro”. This handler finds all instances of the string represented by within the string...
  • Page 435 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 Required. Specifies the horizontal offset, in pixels. When horizontalChange is greater than 0, the offset is toward the right of the Stage; when horizontalChange is less than 0, the offset is toward the left of the Stage.
  • Page 436 Parameters Optional. A string that specifies the document to open when the application stringDocPath specified by opens. stringAppPath Required. A string that specifies the path to the application to open. stringAppPath 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")
  • Page 437 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;...
  • Page 438 In Windows, the .dll extension is optional. Note: This command is not supported in Shockwave Player. Parameters Required. Specifies the Xlibrary file to open. If the file is not in the folder containing whichFile the current movie, must include the pathname. whichFile Example This statement opens the Xlibrary file Video Disc Xlibrary:...
  • Page 439 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.
  • Page 440 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 function in conjunction with to determine when the...
  • Page 441 The movie script contains the handler: on parseDone on parseDone global gParserObject if voidP(gParserObject.getError()) then put "Successful parse" else put "Parse error:" put " " & gParserObject.getError() end if This JavaScript syntax parses the file sample.xml and calls the function. Because no parseDone script object is given with the function, the...
  • Page 442 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) {...
  • Page 443 // 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.
  • Page 444 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 pause() (Sound Channel) Usage -- Lingo syntax soundChannelObjRef.pause() // JavaScript syntax soundChannelObjRef.pause();...
  • Page 445 pause() (3D) Usage member(whichCastmember).model(whichModel).bonesPlayer.pause() member(whichCastmember).model(whichModel).keyframePlayer.pause() Description modifier command; halts the motion currently being #keyframePlayer #bonesPlayer executed by the model. Use the command to unpause the motion. play() When a model’s motion has been paused by using this command, the model’s property will be set to bonesPlayer.playing FALSE...
  • Page 446 // 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.
  • Page 447 Example The first statement in this example assigns the value of the member property for the picture cast member Shrine, which is a bitmap, to the variable . The second statement pictureValue checks whether Shrine is a picture by checking the value assigned to pictureValue -- Lingo syntax pictureValue = member("Shrine").picture...
  • Page 448 Optional. Measured in milliseconds from the beginning of the motion. When endTime looped , the motion begins at and ends at . When , the first FALSE offset endTime looped TRUE iteration of the loop begins at and ends at with all subsequent repetitions offset endTime...
  • Page 449 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 property. Playback continues until startTimeList the value specified by the property, if set. stopTimeList With the , and parameters, this method...
  • Page 450 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.play(propList); Description Sound Channel method;...
  • Page 451 Property Description #loopEndTime The time within the sound to end a loop, in milliseconds. See loopEndTime The amount of the sound to buffer before playback, in milliseconds. See #preloadTime preloadTime Example This statement plays cast member introMusic in sound channel 1: -- Lingo syntax sound(1).play(member("introMusic")) // JavaScript syntax...
  • Page 452 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.
  • Page 453 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.
  • Page 454 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 Required. An integer that specifies the time, in milliseconds, at which playback intStartTime begins.
  • Page 455 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.playNext() Description modifier command; initiates playback of the next #keyframePlayer #bonesPlayer motion in the playlist of the model’s...
  • Page 456 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 point() Usage -- Lingo syntax point(intH, intV) // JavaScript syntax point(intH, intV);...
  • Page 457 Parameters Required. An integer that specifies the horizontal coordinate of the point. intH Required. An integer that specifies the vertical coordinate of the point. intV Example This statement sets the variable to the point (250, 400): lastLocation -- Lingo syntax lastLocation = point(250, 400) // JavaScript syntax var lastLocation = point(250, 400);...
  • Page 458 Parameters Required. Specifies the world relative position. This value can also be a vectorPosition node reference. Optional. Specfies a world relative vector that hints at where the object’s up vector vectorUp should point. If this parameter isn’t specified, then defaults to using the world’s y axis as pointAt the up hinting vector.
  • Page 459 Parameters Required. Specifies the point to test. point 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.
  • Page 460 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 property, which is set to a comma by default.
  • Page 461 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.
  • Page 462 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.
  • Page 463 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.
  • Page 464 postNetText Usage postNetText(url, propertyList {,serverOSString} {,serverCharSetString}) postNetText(url, postText {,serverOSString} {,serverCharSetString}) Description Command; sends a request to a URL, which is an HTTP URL, with specified data. POST This command is similar to . As with , the server’s response is getNetText() getNetText() returned by...
  • Page 465 Example This statement omits the parameter: serverCharSetString 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 have been omitted: serverOSString serverCharSetString lastName = member("Last Name").text firstName = member("First Name").text totalScore = member("Current Score").text infoList = ["FName":firstName, "LName":lastName, "Score":totalScore]...
  • Page 466 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 handler sets up a Flash movie cast member for streaming and then sets its startMovie property: bufferSize...
  • Page 467 Parameters Optional. A string that specifies the specific frame to preload, or an integer that frameNameOrNum specifies the number of the specific frame to preload. Required if preloading a range of frames. A string that specifies the name fromFrameNameOrNum 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.
  • Page 468 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.preLoadMember(fromMemNameOrNum, toMemNameOrNum); Description Movie method; preloads cast members and stops when memory is full or when all of the specified cast members have been preloaded.
  • Page 469 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 methods.
  • Page 470 function does not parse a Director file’s links. Thus, even if a Director preloadNetThing() file is linked to casts and graphic files, downloads only the Director file. You preloadNetThing() still must preload other linked objects separately. Parameters Required. Specifies the name of any valid Internet file, such as a Director movie, graphic, or FTP server location.
  • Page 471 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.preRotate\ ( positionVector, directionVector, angle ) Description 3D transform command; applies a rotation before the current positional, rotational, and scale offsets held by the referenced transform object.
  • Page 472 The above is equivalent to: member("scene").model("bip01").rotate(20,20,20). Generally is only useful when dealing with transform variables. This line will orbit preRotate() 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...
  • Page 473 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.preTranslate( vector ) Description 3D transform command; applies a translation before the current positional, rotational, and scale offsets held by the referenced transform object.
  • Page 474 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 ActionScript command, which was introduced in print Flash 5.
  • Page 475 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 .
  • Page 476 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.
  • Page 477 proxyServer Usage proxyServer serverType, "ipAddress", portNum proxyServer() Description Command; sets the values of an FTP or HTTP proxy server. Without parameters, returns the settings of an FTP or HTTP proxy server. proxyServer() Parameters Optional. A symbol that specifies the type of proxy server. The value can be either serverType #ftp #http...
  • Page 478 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. method sets the current palette to the palette cast member specified by puppetPalette() .
  • Page 479 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...
  • Page 480 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);...
  • Page 481 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 syntax.
  • Page 482 Code Transition Code Transition Reveal down, left Strips on top, build right Reveal left Zoom open Reveal up, left Zoom close Dissolve, pixels fast* Vertical blinds Dissolve, boxy rectangles Dissolve, bits fast* Dissolve, boxy squares Dissolve, pixels* Dissolve, patterns Dissolve, bits* Transitions marked with an asterisk (*) do not work on monitors set to 32 bits.
  • Page 483 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...
  • Page 484 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.
  • Page 485 Once a sound has been queued, it can be played immediately with the method. This is play() because Director preloads a certain amount of each sound that is queued, preventing any delay between the method and the start of playback. The default amount of sound that is play() preloaded is 1500 milliseconds.
  • Page 486 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.\ queue(motionName {, looped, startTime, endTime, scale, offset}) Description modifier command;...
  • Page 487 The following Lingo adds the motion named Kick to the end of the playlist of the bonesPlayer 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.
  • Page 488 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"...
  • Page 489 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...
  • Page 490 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 // JavaScript syntax function SelectScene() { if (random(2) == 1) { _movie.go("11a"); } else { _movie.go("11b");...
  • Page 491 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"...
  • Page 492 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...
  • Page 493 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 before using to read a line.
  • Page 494 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 before using to read a word. openFile() readWord() Parameters...
  • Page 495 Example The following code shows that the function is set to , which realPlayerNativeAudio() FALSE 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 function to , which means that...
  • Page 496 Example The following code shows that the function is set to realPlayerPromptToInstall() 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 function to , which means...
  • Page 497 To view the RealPlayer build number in Windows: Launch RealPlayer. 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: Launch RealPlayer.
  • Page 498 Optional. Specifies a list of symbols indicating the face of the original font. Possible values face . If you do not provide a value for this parameter, is used. #plain #bold #italic #plain Optional. Specifies a list of integers specifying the sizes for which bitmaps are to be bitmapSizes recorded.
  • Page 499 var myRectWidth1 = myRect.right - myRect.left; // 50 var myRectWidth2 = myRect[3] - myRect[1]; // 50 To see an example of used in a completed movie, see the Imaging movie in the Learning/ rect() Lingo folder inside the Director application folder. Parameters Required.
  • Page 500 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 and the registerForEvent() commands.
  • Page 501 • is the total number of milliseconds that will elapse between the duration registerForEvent call and the last event. For example, if there are five iterations with a period of 500 #timeMS ms, the duration is 2500 ms. For tasks with unlimited iterations, the duration is 0. •...
  • Page 502 Parameters Required. Specifies the name of the event. The event can be any of the following eventName predefined events, or any custom event that you define: • is a collision event. #collideAny • is a collision event involving this specific model. The #collideWith command is a shortcut for using the setCollisionCallback()
  • Page 503 Example This statement registers the event handler found in a movie script to be called messageReceived when the model named Player receives the custom user defined event named #message member("Scene").model("Player").registerScript(#message, \ #messageReceived, 0) This statement registers the event handler found in the same script as the collisionResponder command to be called each time a collision occurs between the model named registerScript...
  • Page 504 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 modifier command; removes the last motion from the keyframePlayer bonesPlayer modifier’s playlist Parameters None. Example This statement removes the last motion from the playlist of the modifier for the bonesPlayer model named Walker:...
  • Page 505 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 Required. Specifies the index position of the overlay in the list of overlays. index Example The following statement removes the third overlay from the list of overlays for the camera being used by sprite 5.
  • Page 506 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 property must be state either 0 (unloaded), 4 (media loaded), or -1 (error) before this command can be used, otherwise a script error will occur.
  • Page 507 resolveB Usage collisionData.resolveB(bResolve) Description 3D collision method; overrides the collision behavior set by the property for collision.resolve . Call this function only if you wish to override the behavior set for collisionData.modelB modelB using collision.resolve. Parameters Required. Specifies whether the collision for modelB is resolved. If bResolve bResolve TRUE...
  • Page 508 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...
  • Page 509 In the following example, the two statements diceRoll roll = the result are equivalent to this statement: set roll = diceRoll() The statement would not call the handler because there are no set roll = diceRoll parentheses following here is considered a variable reference. diceRoll diceRoll See also...
  • Page 510 Example This statement resumes playback after a menu has been displayed: -- Lingo syntax member(1).returnToTitle() // JavaScript syntax member(1).returnToTitle(); See also 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.
  • Page 511 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();...
  • Page 512 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.
  • Page 513 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.";...
  • Page 514 Parameters None. Example This statement displays the root menu: -- Lingo syntax member(1).rootMenu() // JavaScript syntax member(1).rootMenu(); See also 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.rotate(rotationVector {, relativeTo}) transform.rotate(position, axis, angle {, relativeTo}) Description...
  • Page 515 Required if applying a rotation about an arbitrary axis passing through a point in space. angle Specifies the amount of rotation about the axis axis Optional. Specifies which coordinate system axes are used to apply the desired relativeTo rotational changes. The parameter can have any of the following values: relativeTo •...
  • Page 516 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...
  • Page 517 saveMovie() Usage -- Lingo syntax _movie.saveMovie({stringFilePath}) // JavaScript syntax _movie.saveMovie({stringFilePath}); Description Movie method; saves the current movie. Including the optional parameter saves the movie to the file specified. This stringFilePath method does not work with compressed files. The specified filename must include the .dir file extension.
  • Page 518 Parameters Required if specifying three scalings. Specifies the scale along the -axis. xScale Required if specifying three scalings. Specifies the scale along the -axis. yScale Required if specifying three scalings. Specifies the scale along the -axis. zScale Required if specifying a single, uniform scaling. Specifies the uniform scaling. uniformScale Example This example first displays the...
  • Page 519 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 to the script cast member Actions: actionMember -- Lingo syntax actionMember = script("Actions")
  • Page 520 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.
  • Page 521 If the command is called when , the stream rebuffers and returns to seek mediaStatus #paused at the new location specified by . If is called when #paused seek seek mediaStatus #playing the stream rebuffers and automatically begins playing at the new location in the stream. If seek called when , nothing happens.
  • Page 522 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 selectButton() Usage -- Lingo syntax dvdObjRef.selectButton(intButton) // JavaScript syntax dvdObjRef.selectButton(intButton); Description DVD method; selects a specified button. This method returns if successful.
  • Page 523 Parameters Required. A symbol (Lingo) or a string (JavaScript syntax) that specifies the direction direction to move from the current button position. Valid values are left right Example This statement specifies the button to the left of the current button: -- Lingo syntax member(12).member.selectButtonRelative(#left) // JavaScript syntax...
  • Page 524 For best results, send the message only to those sprites that will properly handle the message through the method. No error will occur if the message is sent to all the sprites, sendSprite() 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.
  • Page 525 Example The first line in this example creates an instance of a parent script named . The second "tester" 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 event is sent.
  • Page 526 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 . The must be a number from 0–255. Lower values cause the alphaImageObject alphaLevel 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.
  • Page 527 • command can also set properties. setaProp ancestor Parameters Required. A symbol (Lingo only) or a string that specifies the name of the listProperty property whose value is changing. Required. The new value for the property. newValue listProperty Example These statements create a property list and then adds the item to the list: #c:10 newList = [#a:1, #b:5]...
  • Page 528 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...
  • Page 529 Example This statement sets a the Lingo handler named in the Lingo script object to be myOnStatus called when an event is generated by the ActionScript object in the onStatus tLocalConObject Flash movie in sprite 3: -- Lingo syntax sprite(3).setCallback(tLocalConObject, "onStatus", #myOnStatus, me) // JavaScript syntax sprite(3).setCallback(tLocalConObject, "onStatus", symbol("myOnStatus"), me);...
  • Page 530 This command is a shorter alternative to using the command for collisions, but registerScript there is no difference in the overall result. This command can be considered to perform a small subset of the command functionality. registerScript Parameters Required. Specifies the handler called when a model is involved in a collision. handlerName Required.
  • Page 531 Parameters Required. A string that specifies the finder information. stringAttrs 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 on the given Flash setProperty() sprite.
  • Page 532 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 intOnOff values include 0 (off ) or 1 (on).
  • Page 533 Required if setting the color to a color object or an integer value. A colorObjOrIntValue 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()
  • Page 534 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 10- second point. -- Lingo syntax on playMusic sound(2).queue([#member:member("introMusic"), #startTime:3000, \ #endTime:10000, #loopCount:5, #loopStartTime:8000, #loopEndTime:8900]) sound(2).play()
  • Page 535 After runs, if the movie is playing in a browser, a folder named Prefs is created in the setPref() Plug-In Support folder. The method can write only to that folder. setPref() If the movie is playing in a projector or Director, a folder is created in the same folder as the application.
  • Page 536 This command is similar to the command, except that returns an error when setaProp setProp the property is not already in the list. Parameters Required. A symbol (Lingo only) or a string that specifies the property whose value is property replaced by newValue Required.
  • Page 537 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.
  • Page 538 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.
  • Page 539 Required. Specifies the new value of the variable. newValue Example The following statement sets the value of the variable currentURL in the Flash cast member in sprite 3. The new value of currentURL will be “http://www.macromedia.com/software/flash/”. -- Lingo syntax sprite(3).setVariable("currentURL", \ "http://www.macromedia.com/software/flash/") // JavaScript syntax sprite(3).setVariable("currentURL",...
  • Page 540 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.
  • Page 541 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.
  • Page 542 // 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;...
  • Page 543 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()
  • Page 544 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.
  • Page 545 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 property is set to a value of 9, calling scriptExecutionStyle sprite("foo") where no sprite with that name exists returns a reference to sprite 1.
  • Page 546 Parameters 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.7446) See also...
  • Page 547 stageBottom Usage the stageBottom Description Function; along with , and , indicates where the Stage is stageLeft stageRight stageTop 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 stageBottom - the stageTop When the movie plays back as an applet, the property is the height of the applet...
  • Page 548 Example This statement checks whether the left edge of the Stage is beyond the left edge of the screen and calls the handler if it is: leftMonitorProcedure if the stageLeft < 0 then leftMonitorProcedure See also stageBottom, stageRight, stageTop, locH, locV stageRight Usage...
  • Page 549 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 property is not used to calculate movie coordinates;...
  • Page 550 Parameters None. Example This statement checks whether the top of the Stage is beyond the top of the screen and calls the handler if it is: upperMonitorProcedure if the stageTop < 0 then upperMonitorProcedure See also stageLeft, stageRight, stageBottom, locH, locV status() Usage...
  • Page 551 Example This statement stops playback: -- Lingo syntax member(1).stop() // JavaScript syntax member(1).stop(); See also 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 method begins playing the first sound of those that remain in the queue of the play()
  • Page 552 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...
  • Page 553 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;...
  • Page 554 // 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);...
  • Page 555 -- 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...
  • Page 556 stringP() Usage stringP(expression) Description Function; determines whether an expression is a string ( ) or not ( TRUE FALSE The P in stands for predicate. stringP Parameters Required. The expression to test. expression Example This statement checks whether 3 is a string: put stringP("3") The result is 1, which is the numeric equivalent of TRUE...
  • Page 557 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 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.
  • Page 558 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. is the sprite number of the sprite with the QuickTime VR member.
  • Page 559 symbol() Usage -- Lingo syntax symbol(stringValue) // JavaScript syntax symbol(stringValue); Description Top level function; takes a string and returns a symbol. Parameters Required. The string to convert to a symbol. stringValue Example This statement displays the symbol #hello --Lingo syntax put(symbol("hello")) // JavaScript syntax put(symbol("hello"));...
  • Page 560 Example This statement checks whether the variable is a symbol: myVariable 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 function.
  • Page 561 Example This handler turns the handler on when the movie starts: on prepareMovie on streamStatus -- Lingo syntax on prepareMovie tellStreamStatus(TRUE) // JavaScript syntax function prepareMovie() { tellStreamStatus(TRUE); This statement determines the status of the stream status handler: -- Lingo syntax on mouseDown put tellStreamStatus() // JavaScript syntax...
  • Page 562 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...
  • Page 563 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).texture Description 3D element and shader property; an image object used by a shader to define the appearance of the surface of a model. The image is wrapped onto the geometry of the model by the shader. The visible component of a shader is created with up to eight layers of textures.
  • Page 564 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()
  • Page 565 Example This handler deletes the timeout object named Random Lightning: -- Lingo syntax on exitFrame timeout("Random Lightning").forget() // 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...
  • Page 566 Parameters None. Example This statement sets the property of the model resource Gift box to , meaning the top of FALSE 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;...
  • Page 567 Example The following statement sets the property of the model resource Tube to 0.0. If the topRadius 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);...
  • Page 568 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.translate(xIncrement, yIncrement, zIncrement \ {, relativeTo}) transform.translate(translateVector {, relativeTo})
  • Page 569 • applies the increments relative to the world coordinate system. If a model’s parent is #world the world, than this is equivalent to using #parent • allows you to specify a node to base your translation upon, the command nodeReference applies the translations relative to the coordinate system of the specified node.
  • Page 570 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. •...
  • Page 571 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.
  • Page 572 • When used with one argument, , the method clears from memberObjRef unLoadMember() memory the cast members in that frame. • When used with two arguments, , the fromMemberNameOrNum toMemberNameOrNum method unloads all cast members in the range specified. You can specify a unLoadMember() range of cast members by frame numbers or frame labels.
  • Page 573 Parameters Required. A string that specifies the name of the movie to unload stringMovieName 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 <...
  • Page 574 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...
  • Page 575 // 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;...
  • Page 576 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 getNetText() when they are given a property list. Parameters Required.
  • Page 577 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.
  • Page 578 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.
  • Page 579 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() voiceGet() specify a particular voice to be active. Parameters None.
  • Page 580 Example This statement sets the variable to the property list describing the current text-to- oldVoice speech 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()
  • Page 581 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. Example These statements check whether the pitch of the current voice is above 10 and set it to 10 if it is: -- Lingo syntax if voiceGetPitch() >...
  • Page 582 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.
  • Page 583 Example These statements load the computer’s text-to-speech engine and then test for whether the text-to- speech engine has completed loading before using the command to speak the voiceSpeak() 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."...
  • Page 584 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. Example These statements resume the speech when the playhead moves to the next frame in the Score: -- Lingo syntax on exitFrame voiceResume()
  • Page 585 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 Required. An integer that specifies the pitch for the text-to-speech voice. The valid range integer of values depends on the operating system platform and text-to-speech software.
  • Page 586 voiceSetVolume() Usage voiceSetVolume(integer) Description Command; sets the volume of the text-to-speech synthesis. Parameters Required. An integer that specifies the volume of text-to-speech synthesis. The range of integer valid values depends on the operating system platform. If successful, the command returns the new value that was set.
  • Page 587 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 , and #playing #paused #stopped Parameters None. Example These statements check whether the text-to-speech engine is actively speaking and set the voice to 1 if it is not: --Lingo syntax if voiceState() <>...
  • Page 588 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()
  • Page 589 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 , this function returns . If the variable has a value other than , this function VOID TRUE...
  • Page 590 Example This statement sets the variable to the window named Collections: myWindow -- 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 is running as a stringWindowName movie in a window (...
  • Page 591 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.
  • Page 592 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 Required.
  • Page 593 Parameters Required. A string that specifies the name of the Xtra to return, or an integer xtraNameOrNum that specifies the index position of the Xtra to return. String names are not case sensitive. Example This statement sets the variable to the NetLingo Xtra extension: myNetLingo -- Lingo syntax myNetLingo = xtra("netlingo")
  • Page 594 Chapter 12: Methods...
  • Page 595: Chapter 13: Operators

    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.
  • Page 596 • 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.
  • Page 597 - (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 from expression2...
  • Page 598 -- (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.
  • Page 599 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.
  • Page 600 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)
  • Page 601 // 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;...
  • Page 602 + (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.
  • Page 603 - (subtraction) Usage -- Lingo syntax vector1 - vector2 vector - scalar // JavaScript syntax vector1 - vector2 vector - scalar Description 3D vector operator; subtracts the components of from the corresponding components vector2 , or subtracts the scalar value from each of the components and returns a new vector. vector1 subtracts the values of from the corresponding components in...
  • Page 604 / (division) Usage -- Lingo syntax expression1 / expression2 // JavaScript syntax expression1 / expression2 Description Math operator; performs an arithmetic division on two numerical expressions, dividing . If both expressions are integers, the quotient is an integer. If expression1 expression2 either or both expressions are floating-point numbers, the quotient is a floating-point number.
  • Page 605 < (less than) Usage -- Lingo syntax expression1 < expression2 // JavaScript syntax expression1 < expression2 Description Comparison operator; compares two expressions and determines whether is less expression1 than ), or whether is greater than or equal to expression2 TRUE expression1 expression2 FALSE...
  • Page 606 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.
  • Page 607 >= (greater than or equal to) Usage -- Lingo syntax expression1 >= expression2 // JavaScript syntax expression1 >= expression2 Description Comparison operator; compares two expressions and determines whether is greater expression1 than or equal to ), or whether is less than expression2 TRUE expression1...
  • Page 608 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.
  • Page 609 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 , where is the list in the sortList machinery machinery...
  • Page 610 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.
  • Page 611 Usage -- Lingo syntax logicalExpression1 and logicalExpression2 // JavaScript syntax logicalExpression1 && logicalExpression2 Description Logical operator; determines whether both logicalExpression1 logicalExpression2 (1), or whether either or both expressions are (0). TRUE FALSE The precedence level of this logical operator is 4. Example This statement determines whether both logical expressions are and displays the result in the...
  • Page 612 comparison operator is useful for checking whether the user types a specific contains character or string of characters. You can also use the operator to search one or more contains fields for specific strings of characters. Example This example determines whether a character passed to it is a digit: -- Lingo syntax on isNumber aLetter digits = "1234567890"...
  • Page 613 // JavaScript syntax put(7 % 4); The result is 3. The following handler sets the ink effect of all odd-numbered sprites to , which is the ink copy effect specified by the number 0. First the handler checks whether the sprite in the variable is an odd-numbered sprite by dividing the sprite number by 2 and then checking mySprite whether the remainder is 1.
  • Page 614 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 value , and making a value . It is useful when testing to see if a certain TRUE FALSE FALSE...
  • Page 615 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. Example This statement indicates in the Message window whether at least one of the expressions 1 <...
  • Page 616 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. Example This statement reports in the Message window whether the word Macromedia starts with the string “Macro”: -- Lingo syntax put("Macromedia" starts "Macro") // JavaScript syntax var string1 = "Macromedia";...
  • Page 617: Chapter 14: Properties

    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.
  • Page 618 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 to the property: objKey _key -- Lingo syntax objKey = _key // JavaScript syntax var objKey = _key;...
  • Page 619 _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.
  • Page 620 _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. Example This statement sets the variable to the property: objPlayer _player...
  • Page 621 This statement uses the property directly to access the property: _sound soundLevel -- 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.
  • Page 622 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 ( default) or disabled ( TRUE, FALSE This property can be tested and set.
  • Page 623 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 property. Read-only. getRendererServices().renderer The possible values of the property are active3dRenderer #openGL...
  • Page 624 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...
  • Page 625 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 receive a message each time the playhead enters a frame. actorList stepFrame To add an object to...
  • Page 626 alertHook Usage -- Lingo syntax _player.alertHook // JavaScript syntax _player.alertHook; Description Player property; specifies a parent script that contains the handler. Read/write. alertHook to control the display of alerts about file errors or script errors. When an error alertHook occurs and a parent script is assigned to , Director runs the handler in the alertHook...
  • Page 627 // 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;...
  • Page 628 Description Movie property; sets the availability of the graphic controls in the context menu when playing the movie in a Macromedia Shockwave environment. Read/write. Set this property to if you would rather have a text menu displayed than the graphic FALSE context menu.
  • Page 629 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 See also...
  • Page 630 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 to prevent users from changing the size of the movie in browsers and FALSE ShockMachine.
  • Page 631 For example, if the color of the ambient light is and the value of the rgb(255, 255, 255) property of the shader is , the shader will reflect all of the red ambient rgb(255, 0, 0) 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.
  • Page 632 For child objects, the property is usually assigned in the handler within the ancestor on new 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 property.
  • Page 633 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 property.
  • Page 634 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) -- 2...
  • Page 635 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. property is by default. antiAlias TRUE For vector shapes, is the equivalent of the quality setting for a Flash asset, and TRUE #high...
  • Page 636 Example This Lingo checks whether the currently running 3D renderer for sprite 2 supports anti-aliasing with the property. If anti-aliasing is supported, the second statement antiAliasingSupported turns on anti-aliasing for the sprite with the property. antiAliasingEnabled if sprite(2).antiAliasingSupported = TRUE then sprite(2).antiAliasingEnabled = TRUE end if See also...
  • Page 637 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 Specifies the 1-bit cast member to use as a mask for the window. #mask Specifies the type of border for the window.
  • Page 638 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.
  • Page 639 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").open();...
  • Page 640 The default value for this property is vector(1.0, 0.0, 0.0). Example This statement sets the property of the light named HouseLight to the vector attenuation (.5, 0, 0), darkening it slightly. member("3d world").light("HouseLight").attenuation = \ vector(.5, 0, 0) See also color (light) attributeName Usage...
  • Page 641 here is some text </e1> 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 ( , default) or not ( ).
  • Page 642 Example The following examples show that the properties for sprite 2 and the cast member Real is audio set to , which means that the audio portion of the RealMedia stream will be played. TRUE -- Lingo syntax put(sprite(2).audio) -- 1 put(member("Real").audio) -- 1 // JavaScript syntax put(sprite(2).audio);...
  • Page 643 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 audioExtension Usage -- Lingo syntax dvdObjRef.audioExtension...
  • Page 644 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. The audio format is MPEG-1.
  • Page 645 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 audioStreamCount Usage -- Lingo syntax dvdObjRef.audioStreamCount // JavaScript syntax dvdObjRef.audioStreamCount; Description DVD property;...
  • Page 646 Example This statement sets the property of the modifier of the model named Spaceship to auto TRUE The modifier will automatically set the model’s level of detail. member("3D World").model("Spaceship").lod.auto = TRUE See also (modifier), bias, level autoblend Usage member(whichCastmember).model(whichModel).\ keyframePlayer.autoblend member(whichCastmember).model(whichModel).bonesPlayer.autoblend Description modifier property;...
  • Page 647 Example This statement sets the property of the cast member named Headline to autoCameraPosition . When the cast member is displayed in 3D mode, the camera will not be positioned FALSE automatically. member("Headline").autoCameraPosition = FALSE See also displayMode autoMask Usage member(whichCursorCastMember).autoMask the autoMask of member whichCastMember Description...
  • Page 648 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 . The property can be made active ( ) or whichCastMember TRUE...
  • Page 649 back Usage member(whichCastmember).modelResource(whichModelResource).back Description model resource property; indicates whether the side of the box intersected by its +Z axis #box is sealed ( ) or open ( TRUE FALSE The default value for this property is TRUE Example This statement sets the property of the model resource named Crate to , meaning the back...
  • Page 650 Example The following statement sets the variable to the background color of sprite 5: oldColor -- 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...
  • Page 651 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...
  • Page 652 Description Movie property; determines whether the computer automatically beeps when the user clicks on anything except an active sprite ( ), or not ( , default). Read/write. TRUE FALSE Scripts that set should be placed in frame or movie scripts. beepOn Example This statement sets...
  • Page 653 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.
  • Page 654 // 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 , the color of the Stage, or the background color of the 3D whichSprite...
  • Page 655 modifier can only be added to models created outside of Director in 3D modeling #lod programs. The value of the property of the model resources used by these models is type . The modifier cannot be added to primitives created within Director. #fromFile Example This statement sets the...
  • Page 656 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) // JavaScript syntax function beginSprite() { var memName = sprite(spriteNum).member.name; put("The bitRate of member "...
  • Page 657 Description 3D backdrop, overlay, and shader property; indicates the opacity of the backdrop, #standard overlay, or shader. Setting the property of a shader will have no effect unless the shader’s blend 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.
  • Page 658 blendConstant Usage member(whichCastmember).shader(whichShader).blendConstant member(whichCastmember).model(whichModel).shader.blendConstant member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendConstant Description shader property; indicates the blending ratio used for the first texture layer of #standard the shader. If the shader’s property is set to , the texture blends with the useDiffuseWithTexture TRUE color set by the shader’s property.
  • Page 659 property works only when the property of the blendConstantList blendSource 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 property of each of the textures used by the second shader.
  • Page 660 blendFunction Usage member(whichCastmember).shader(whichShader).blendFunction member(whichCastmember).model(whichModel).shader.blendFunction member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendFunction Description shader property; indicates the type of blending used by the first texture layer of #standard the shader. If the shader’s property is set to , the texture blends with the color useDiffuseWithTexture TRUE set by the shader’s property.
  • Page 661 blendFunctionList Usage member(whichCastmember).shader(whichShader).\ blendFunctionList{[index]} member(whichCastmember).model(whichModel).shader.\ blendFunctionList{[index]} member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendFunctionList{[index]} Description shader property; a linear list that indicates the manner in which each texture layer #standard blends with the texture layer below it. The shader’s texture list and blend function list both have eight index positions. Each index position in the blend function list controls blending for the texture at the corresponding index position in the texture list.
  • Page 662 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.
  • Page 663 blendSource Usage member(whichCastmember).shader(whichShader).blendSource member(whichCastmember).model(whichModel).shader.blendSource member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendSource Description shader property; indicates whether blending of the first texture layer in the #standard shader’s texture list is based on the texture’s alpha information or a constant ratio. If the shader’s property is set to , the texture blends with the color useDiffuseWithTexture TRUE...
  • Page 664 Description shader property; indicates whether blending of a texture layer with the texture #standard 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.
  • Page 665 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].worldTransform Description 3D element;...
  • Page 666 is a number that is multiplied by the parameter of the playRate (3D) scale play() queue() command to determine the playback speed of the motion. returns the number of motions currently queued in the playlist. playlist.count (3D) indicates whether the translational component of the motion is used or ignored. rootLock indicates whether the motion plays once or repeats continuously.
  • Page 667 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...
  • Page 668 bottom (3D) Usage member(whichCastmember).modelResource(whichModelResource).bottom Description model resource property; indicates whether the side of the box intersected by its -Y axis #box is sealed ( ) or open ( TRUE FALSE The default value for this property is TRUE Example This statement sets the property of the model resource named GiftBox to , meaning bottom...
  • Page 669 Example This statement sets the property of the model resource named Tube to 38.5. bottomRadius 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 portion of the text cast member.
  • Page 670 Example This statement sets the boundary property of the inker modifier applied to the model named Box . Lines will be drawn at the edges of the surface of the model. TRUE member("shapes").model("Box").inker.boundary = TRUE See also lineColor, lineOffset, silhouettes, creases boundingSphere Usage...
  • Page 671 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 , and #adjust...
  • Page 672 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 ( ) or not ( TRUE FALSE When this property is set to...
  • Page 673 Example This handler sets up a Flash movie cast member for streaming and then sets its startMovie property. bufferSize -- Lingo syntax on startMovie member.("Flash Demo").preload = FALSE member.("Flash Demo").bufferSize = 65536 // JavaScript syntax function startMovie() { member.("Flash Demo").preload = 0; member.("Flash Demo").bufferSize = 65536;...
  • Page 674 Example This handler accepts a sprite reference and toggles the sprite’s property on buttonsEnabled or off. -- Lingo syntax on ToggleButtons(whichSprite) sprite(whichSprite).buttonsEnabled = \ not(sprite(whichSprite).buttonsEnabled) // JavaScript syntax function ToggleActions(whichSprite) { sprite(whichSprite).buttonsEnabled = !(sprite(whichSprite).buttonsEnabled); See also actionsEnabled buttonStyle Usage -- Lingo syntax _movie.buttonStyle // JavaScript syntax _movie.buttonStyle;...
  • Page 675 This statement remembers the current setting of the property by putting the buttonStyle current value in the variable buttonStyle 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;...
  • Page 676 -- Lingo syntax on fetchMovie(whichFlashMovie) repeat while member(whichFlashMovie).percentStreamed < 100 stream(member(whichFlashMovie)) put("Number of bytes streamed:" && member(whichFlashMovie).bytesStreamed) end repeat // JavaScript syntax function fetchMovie(whichFlashMovie) var i = member(whichFlashMovie).percentStreamed; while(i < 100) { stream(member(whichFlashMovie)); trace( "Number of bytes streamed: " + member(whichFlashMovie).bytesStreamed);...
  • Page 677 Cameras are stored in the camera palette of the cast member. Use the newCamera commands to create and delete cameras in a 3D cast member. deleteCamera property of a sprite is the first camera in the list of cameras of the sprite. The camera camera referred to by is the same as...
  • Page 678 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).
  • Page 679 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...
  • Page 680 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...
  • Page 681 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 ( default); or repositions the TRUE, registration point at its current point value when you resize the sprite, set the defaultRect property, or set the property (...
  • Page 682 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.
  • Page 683 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.
  • Page 684 See also Chapter 14: Properties...
  • Page 685 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).
  • Page 686 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 portion of the text cast member. chunkExpression A value less than 0 indicates less spacing between letters. A value greater than 0 indicates more spacing between letters.
  • Page 687 Example This handler turns off any items that are checked in the custom menu specified by the argument . For example, turns off all the items in the Format menu. theMenu unCheck ("Format") 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...
  • Page 688 Example Beginning with the following XML: <?xml version="1.0"?> <e1> <tagName attr1="val1" attr2="val2"/> <e2>element 2</e2> <e3>element 3</e3> here is some text </e1> This Lingo returns the name of the first child node of the preceding XML: put gParserObject.child[1].name -- "e1" chunkSize Usage member(whichCastMember).chunkSize the chunkSize of member whichCastMember...
  • Page 689 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 is set to .
  • Page 690 // 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...
  • Page 691 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 is set to .
  • Page 692 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 property of the last active sprite that was clicked to a foreColor random color:...
  • Page 693 Example These statements try to set to TRUE, and display an alert if they cannot closedCaptions 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.");...
  • Page 694 collisionData Usage on myHandlerName me, collisionData Description 3D data object; sent as an argument with the events to the #collideWith #collideAny handler specified in the , and registerForEvent registerScript setCollisionCallback commands. The object has these properties: collisionData is one of the models involved in the collision. modelA is the other model involved in the collision.
  • Page 695 collisionNormal Usage collisionData.collisionNormal Description property; a vector indicating the direction of the collision. collisionData object is sent as an argument with the collisionData #collideWith #collideAny events to the handler specified in the registerForEvent, registerScript, commands. setCollisionCallback events are sent when a collision occurs between models to #collideWith #collideAny which collision modifiers have been added.
  • Page 696 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 member and sprite properties, the color...
  • Page 697 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 )
  • Page 698 See also colorBufferDepth Usage getRendererServices().colorBufferDepth Description property; indicates the color precision of the hardware output buffer of rendererServices 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 value of the user’s video card is 32.
  • Page 699 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 property refers to the monitor colorDepth displaying the Stage. If the Stage spans more than one monitor, the property colorDepth indicates the greatest depth of those monitors;...
  • Page 700 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. Any single color can be shared by several vertices (faces) of the mesh.
  • Page 701 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 values.
  • Page 702 See also face, vertices, vertices, flat Chapter 14: Properties...
  • Page 703 colorSteps Usage member(whichCastmember).model(whichModel).toon.colorSteps member(whichCastmember).model(whichModel).shader.colorSteps member(whichCastmember).shader(whichShader).colorSteps Description modifier and shader property; the maximum number of colors available for use toon painter by the modifier or shader. The value of this property can be 2, 4, 8, or 16. If you toon painter set the value of to any other number, it will be rounded to one of these.
  • Page 704 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 // JavaScript syntax function enterFrame() { if (_key.commandDown &&...
  • Page 705 compressed Usage member(whichCastmember).texture(whichTexture).compressed Description 3D texture property; indicates whether the source cast member of the texture is compressed ) or not ( ). The value of the property changes automatically from TRUE FALSE compressed TRUE when the texture is needed for rendering. It can be set to to decompress the FALSE FALSE...
  • Page 706 Example This statement removes a sprite property: constraint -- 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;...
  • Page 707 Example This handler checks whether the pressed key is the Control key, and if it is, the on keyDown handler activates the handler. The argument identifies which key on doControlKey (_key.key) was pressed in addition to the Control key. -- Lingo syntax on keyDown if (_key.controlDown) then doControlKey(_key.key)
  • Page 708 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;...
  • Page 709 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;...
  • Page 710 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.count member(whichCastmember).group.child.count sprite(whichSprite).camera{(index)}.backdrop.count member(whichCastmember).camera(whichCamera).backdrop.count sprite(whichSprite).camera{(index)}.overlay.count member(whichCastmember).camera(whichCamera).overlay.count member(whichCastmember).model(whichModel).modifier.count member(whichCastmember).model(whichModel).keyframePlayer.\ playlist.count member(whichCastmember).model(whichModel).bonesPlayer.\ playlist.count member(whichCastmember).modelResource(whichModelResource).\ face.count member(whichCastmember).model(whichModel).meshDeform.\ mesh[index].textureLayer.count member(whichCastmember).model(whichModel).meshDeform.mesh.count member(whichCastmember).model(whichModel).meshDeform.\ mesh[index].face.count Description 3D property; returns the number of items in the given list that is associated with the given 3D object.
  • Page 711 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.count -- 2 See also cameraCount() cpuHogTicks Usage...
  • Page 712 property of the modifier must be set to for the property to creases TRUE creaseAngle have an effect. has a range of -1.0 to +1.0. The default setting is 0.01. CreaseAngle Example This statement sets the property of the modifier applied to the model named creaseAngle inker Teapot to 0.10.
  • Page 713 Example Although you typically inspect the property using the Property inspector or the creationDate 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).crop the crop of member whichCastMember Description Cast member property;...
  • Page 714 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.
  • Page 715 currentLoopState Usage member(whichCastmember).model(whichModel).keyframePlayer.\ currentLoopState member(whichCastmember).model(whichModel).bonesPlayer.\ currentLoopState Description modifier property; indicates whether the motion being keyframePlayer bonesPlayer executed by the model repeats continuously ( ) or plays to the end and is replaced by the next TRUE motion in the modifier’s playlist ( FALSE The default setting for this property is the value of the looped parameter of the command...
  • Page 716 Example The following handler in a cast member or movie script switches the cast member assigned to the sprite involved in the event: mouseDown -- Lingo syntax on mouseDown sprite(_player.currentSpriteNum).member = member("DownPict") // JavaScript syntax function mouseDown() { sprite(_player.currentSpriteNum).member = member("DownPict"); See also Player, spriteNum...
  • Page 717 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) -- 11500 // JavaScript syntax trace (member(1).currentTime); // 11500 This statement sets to a specific point in the current title:...
  • Page 718 // 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...
  • Page 719 -- 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.currentTime; Description Sprite and sound channel property;...
  • Page 720 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.
  • Page 721 Value Description Select Bucket Hand Rectangle tool Rounded rectangle tool Circle tool Line tool Rich text tool Text field tool Button tool Check box tool Radio button tool Placement tool Registration point tool Lasso Finger Dropper Wait mouse down 1 Wait mouse down 2 Vertical size Horizontal size...
  • Page 722 Value Description Air brush Zoom in Zoom out Zoom cancel Start shape Add point Close shape Zoom camera Move camera Rotate camera Custom To use custom cursors, set the property to a list containing the cast member to be used as cursor a cursor or to the number that specifies a system cursor.
  • Page 723 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 by 16 pixels 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.
  • Page 724 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.0000, 56.0000)]] This statement moves the first vertex of the first curve in a vector shape down and to the right by...
  • Page 725 Message window, and the Message window will be tied to the first movie alone. On the Macintosh, the generated log file is located in the Shockwave Player folder at HardDrive/ System Folder/Extensions/Macromedia/Shockwave. To open this Message window, set the property to .
  • Page 726 Example This statement sets the property of the fog of the camera Defaultview to . If decayMode #linear the fog’s property is set to , the density of the fog will steadily increase between the enabled TRUE distances set by the fog’s properties.
  • Page 727 // 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.defaultRectMode;...
  • Page 728 -- 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 // JavaScript syntax function setDefaultRectSize(whichCast) { var i = 1; while( i <...
  • Page 729 depth (3D) Usage member(whichCastmember).model(whichModel).sds.depth Description 3D subdivision surfaces ( ) modifier property; specifies the maximum number of levels of resolution that the model can display when using the modifier. If the modifier’s settings are low, increasing the property will have error tension depth...
  • Page 730 // 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 property; indicates the precision of the hardware depth buffer of the rendererServices user’s system.
  • Page 731 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...
  • Page 732 diffuseColor Usage member(whichCastmember).diffuseColor Description 3D cast member property; indicates a color that is blended with the first texture of the first shader of the cast member when the following conditions are met: • the shader’s property is set to , and either useDiffuseWithTexture TRUE •...
  • Page 733 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. property can be set to any value you choose. digitalVideoTimeScale The value of this property determines the fraction of a second that is used to track the video, as in the following examples:...
  • Page 734 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.
  • Page 735 Example This statement sets the property of the cast member named Room to rgb(0, directionalColor 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...
  • Page 736 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 (1), the cast member plays in front of all other layers on the Stage, and TRUE ink effects have no affect.
  • Page 737 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 , this property prevents Director from automatically taking Stage scrolling or zooming TRUE into account when the property is used to get the image of the Stage.
  • Page 738 In this example, the model resource of the model named Slogan is extruded text. This statement sets the property of Slogan's model resource to . The front face displayFace [#back, #tunnel] of Slogan will not be drawn. member("scene").model("Slogan").resource.displayFace = \ [#back, #tunnel] See also extrude3D,...
  • Page 739 Example The following examples show that the property for sprite 2 and the cast displayRealLogo member Real is set to , which means that the RealNetworks logo is displayed when the TRUE movie starts to play and when it is stopped or rewound. -- Lingo syntax put(sprite(2).displayRealLogo) -- 1 put(member("Real").displayRealLogo) -- 1...
  • Page 740 Property Description resizable Determines whether a window is resizable. If , the window is resizable. If TRUE , the window is not resizable. The default value is . For more FALSE TRUE information, see resizable Returns or sets the title of the display template. For more information, title title titlebarOptions...
  • Page 741 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 #linear The default value is #linear Example In this example, ThermoSystem is a model resource whose type is .
  • Page 742 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 property.
  • Page 743 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) -- #title // JavaScript syntax trace (member(1).domain); // #title See also doubleClick...
  • Page 744 drag Usage member(whichCastmember).modelResource(whichModelResource).drag Description model resource property; indicates the percentage of each particle’s velocity that is #particle 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 .
  • Page 745 // 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];...
  • Page 746 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) -- 1329566 // JavaScript syntax trace (member(1).duration);...
  • Page 747 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 // JavaScript syntax function exitFrame() {...
  • Page 748 editable Usage -- Lingo syntax spriteObjRef.editable // JavaScript syntax spriteObjRef.editable; Description Sprite property; determines whether a specified sprite can be edited on the Stage ( ) or not TRUE ). Read/write. FALSE 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.
  • Page 749 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 , these text operations function. When set to , these operations are not TRUE FALSE...
  • Page 750 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...
  • Page 751 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.maxSpeed Description 3D particle system element; controls the initial propulsion of particles from a model resource whose type is #particle The “See also” section of this entry contains a complete list of emitter properties. For more information, see the individual property entries.
  • Page 752 enabled Usage the enabled of menuItem whichItem of menu whichMenu Description Menu item property; determines whether the menu item specified by is displayed in whichItem plain text and is selectable ( default) or appears dimmed and is not selectable ( TRUE, FALSE The expression...
  • Page 753 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 enabled (sds)
  • Page 754 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 method. Read/write. getURL() The Flash method loads a new URL into a blank browser window. getURL() is set to , a sprite with Flash content can execute any valid script...
  • Page 755 Example For this example, assume that the cast member named MyMember contains a model that uses the model resource named Sphere4, whose value is 310, leaving an opening of 50°. The endAngle handler closes that opening in a way that makes it look like it is sliding shut. The closeSphere repeat loop changes the value of the sphere 1°...
  • Page 756 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)
  • Page 757 _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 property in environmentPropList the future, without affecting existing movies. The information is in the form of property and value pairs for that area.
  • Page 758 error Usage member(whichCastmember).model(whichModel).sds.error Description modifier property; indicates the percentage of error tolerated by the modifier when #sds synthesizing geometric detail in models. This property works only when the modifier’s property is set to . The subdivision #adaptive properties of the modifier combine with the property to control tension depth (3D)
  • Page 759 -- Lingo syntax on enterFrame if sprite(5).buttonsEnabled = TRUE then sprite(5).eventPassMode= #passNotButton else sprite(5).eventPassMode = #passAlways end if // 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...
  • Page 760 // 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 <EMBED> or <OBJECT> tag is passing to a movie with Shockwave content.
  • Page 761 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].vertices member(whichCastmember).model(whichModel).meshdeform.\ face.count member(whichCastmember).model(whichModel).meshdeform.\ mesh[index].face.count member(whichCastmember).model(whichModel).meshdeform.\ mesh[meshIndex].face[faceIndex] member(whichCastmember).model(whichModel).meshdeform.\ mesh[meshIndex].face[faceIndex].neighbor{[neighborIndex]} Description model resource and modifier property. All model resources are meshes #mesh meshdeform composed of triangles. Each triangle is a face. You can access the properties of the faces of model resources whose type is .
  • Page 762 face[ ] Usage member(whichCastmember).model(whichModel).meshdeform.\ mesh[meshIndex].face[faceIndex] Description modifier property; indicates which indices in the vertex list of the model meshdeform 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 model #mesh resource by setting its...
  • Page 763 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)}.fieldOfView Description 3D camera property; indicates the angle formed by two rays: one drawn from the camera to the top of the projection plane, and the other drawn from the camera to the bottom of the projection plane.
  • Page 764 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. commands rewrite the file to delete this free space. Save Compact Save As...
  • Page 765 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 &...
  • Page 766 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.
  • Page 767 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 property to the movie’s fileName...
  • Page 768 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.
  • Page 769 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 when the property of the shape is set to fillColor fillMode #solid...
  • Page 770 Example This statement sets the of member Archie to 3: fillCycles -- 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. This property is only valid when the property of the shape is set to fillMode...
  • Page 771 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: • —The shape is transparent #none • —The shape uses a single fill color #solid •...
  • Page 772 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...
  • Page 773 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 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.
  • Page 774 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 property can have integer values. The default value is 15. fixedRate This property is ignored if the sprite’s property is anything other than playbackMode...
  • Page 775 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 , default), or not ( ), regardless of the Stage size saved with that movie, or the setting TRUE FALSE for the...
  • Page 776 For linked Flash cast members, the member property returns a valid value only when FlashRect 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...
  • Page 777 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 ) or not ( ). Read-only. TRUE FALSE The image itself is flipped around its registration point. This means any rotation or skew remains constant;...
  • Page 778 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 must be an integer. The maximum value is 15 floatPrecision significant digits; the default value is 4. property determines only the number of digits used to display floatPrecision floating-point numbers;...
  • Page 779 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: •...
  • Page 780 // 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.
  • Page 781 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 can be either a cast member name or number.
  • Page 782 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.
  • Page 783 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.
  • Page 784 // 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 member property can have integer values. frameCount This property can be tested but not set.
  • Page 785 Example The following statement checks the label of the current frame. In this case, the current value is Start: frameLabel -- Lingo syntax put(_movie.frameLabel) // JavaScript syntax put(_movie.frameLabel); See also labelList, Movie framePalette Usage -- Lingo syntax _movie.framePalette // JavaScript syntax _movie.framePalette;...
  • Page 786 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.
  • Page 787 -- Lingo syntax property spriteNum on beginSprite me if sprite(spriteNum).member.frameRate < 15 then sprite(spriteNum).playBackMode = #fixed sprite(spriteNum).fixedRate = 15 end if // JavaScript syntax function beginSprite () { var fr = sprite(this.spriteNum).member.frameRate; if (fr < 15) { sprite(this.spriteNum).playBackMode = symbol("fixed"); sprite(this.spriteNum).fixedRate = 15;...
  • Page 788 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 property.
  • Page 789 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;...
  • Page 790 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;...
  • Page 791 Example This statement sets the property of the model resource named Crate to , meaning front FALSE the front of this box will be open: member("3D World").modelResource("Crate").front = FALSE See also back, bottom (3D), (3D), left (3D), right (3D) frontWindow Usage -- Lingo syntax _player.frontWindow...
  • Page 792 See also getBoneID Usage memberReference.modelResource.getBoneID("boneName") Description 3D model resource property; returns the index number of the bone named in the boneName 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").getBoneId("ShinL") -- 40 See also...
  • Page 793 glossMap Usage member(whichCastmember).shader(whichShader).glossMap member(whichCastmember).model(whichModel).shader.glossMap member(whichCastmember).model(whichModel).shaderList{[index]}.\ glossMap Description shader property; specifies the texture to use for gloss mapping. #standard 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. •...
  • Page 794 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 . The is only valid when the #linear #radial gradientType fillMode set to #gradient This property can be tested and set.
  • Page 795 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;...
  • Page 796 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 model resource, model resource, and texture property; indicates the height #box #cylinder of the object.
  • Page 797 Example The following statement sets the property of the model resource named Tower heightVertices 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...
  • Page 798 Example The following statement sets the property of the modifier for the highlightStrength toon 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.hilite;...
  • Page 799 Description 3D camera property; indicates the distance in world units from the camera beyond which models are drawn. Objects closer to the camera than are not drawn. hither 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.
  • Page 800 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.
  • Page 801 Setting a hyperlink to an empty string removes it. Example The following handler creates a hyperlink in the first word of text cast member “MacroLink”. The text is linked to Macromedia’s website. --Lingo syntax on startMovie member("MacroLink").word[1].hyperlink = "http://www.macromedia.com"...
  • Page 802 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 , the returned range of the link contains the first character hyperLink...
  • Page 803 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: , and #normal #active #visited This property can be tested and set. Like , the returned range of the link contains the first character hyperLink...
  • Page 804 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 message. Read/write. idle The default value is 1, which tells the movie to send handler messages no more than 60 idle times per second.
  • Page 805 idleLoadMode Usage -- Lingo syntax _movie.idleLoadMode // JavaScript syntax _movie.idleLoadMode; Description Movie property; determines when the methods try to load preLoad() preLoadMember() cast members during idle periods. Read/write. Idle periods can be one of the following values: • 0—Does not perform idle loading •...
  • Page 806 The default value for is 0, which instructs Director to service the load queue as idleLoadPeriod 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;...
  • Page 807 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 is 32K. idleReadChunkSize 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)
  • Page 808 These statements place a reference to the image of the stage into the variable and then myImage 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;...
  • Page 809 If you plan to make a lot of changes to the property, it is faster to copy the property image image into a new image object using the Member object’s method, apply your changes to duplicate() 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 method.
  • Page 810 // 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 ( , default) or invisible ( TRUE FALSE This property can be tested and set.
  • Page 811 // 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.imageQuality; Description Movie and bitmap cast member property; indicates the level of compression to use when a movie’s property is set to .
  • Page 812 Example This statement sets the property of the modifier attached to the first immovable collision model of the cast member named Scene to TRUE member("Scene").model[1].collision.immovable = TRUE See also collision (modifier) Usage -- Lingo syntax spriteObjRef.ink // JavaScript syntax spriteObjRef.ink; Description Sprite property;...
  • Page 813 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()
  • Page 814 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 , this property allows the user to enter double-byte characters directly into the TRUE 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.
  • Page 815 // 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 ( ) or in the black pixels ( , default).
  • Page 816 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 ( ), or whether the cast member or TRUE sprite isn’t a QuickTime VR movie ( FALSE...
  • Page 817 itemDelimiter Usage the itemDelimiter Description Player property; indicates the special character used to separate items. You can use the to parse filenames by setting to a backslash (\) itemDelimiter itemDelimiter in Windows or a colon (:) on the Macintosh. Restore the character to a comma itemDelimiter (,) for normal operation.
  • Page 818 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.
  • Page 819 -- Lingo syntax on prepareMovie keyDownScript = "checkKey" on checkKey if (_key.key = "q") then _movie.go("Main Menu") end if // JavaScript syntax function prepareMovie() { keyDownScript = checkKey(); function checkKey() { if (_key.key == "q") { _movie.go("Main Menu"); This handler checks whether the last key pressed is the z key and if it is, calls the on keyDown handler: addNumbers...
  • Page 820 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.
  • Page 821 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, keyDownScript Usage the keyDownScript Description System property;...
  • Page 822 See also 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 modifier animate the entire model at once, unlike Bones player motions, which keyframePlayer animate segments of the model called bones. Motions and the models that use them must be created in a 3D modeling program, exported as W3D files, and then imported into a movie.
  • Page 823 • initiates playback of the next motion in the playlist. playNext() • adds a motion to the end of the playlist. queue() modifier generates the following events, which are used by handlers keyframePlayer declared in the commands. The call to the registerForEvent() registerScript() declared handler includes three arguments: the event type (either...
  • Page 824 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.) Example This statement makes a list of frame labels in the content of the field cast member Key Frames:...
  • Page 825 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 >...
  • Page 826 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...
  • Page 827 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.
  • Page 828 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 >...
  • Page 829 left (3D) Usage member(whichCastmember).modelResource(whichModelResource).left Description model resource property; indicates whether the side of the box intersected by its -X axis #box is sealed ( ) or open ( TRUE FALSE The default value for this property is TRUE Example This statement sets the property of the model resource named Crate to , meaning the left...
  • Page 830 The length of a vector is its distance in world units from . This is the same as vector(0, 0, 0) the magnitude of the vector. Example This statement sets the variable to the length of the model resource named myBoxLength GiftBox.
  • Page 831 modifier can only be added to models created outside of Director in 3D modeling #lod programs. The value of the property of the model resources used by these models is type . The modifier cannot be added to primitives created within Director. #fromFile Example The following statement sets the...
  • Page 832 See also newLight, deleteLight lineColor Usage member(whichCastmember).model(whichModel).inker.lineColor member(whichCastmember).model(whichModel).toon.lineColor Description modifier property; indicates the color of the lines drawn on the model by the toon inker modifier. For this property to have an effect, either the modifier’s , or creases silhouettes property must be set to boundary TRUE...
  • Page 833 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.
  • Page 834 lineOffset Usage member(whichCastmember).model(whichModel).toon.lineOffset member(whichCastmember).model(whichModel).inker.lineOffset Description modifier property; indicates the apparent distance from the model’s surface toon inker at which lines are drawn by the modifier. For this property to have an effect, the modifier’s property must be set to , and one or more of its , or useLineOffset TRUE...
  • Page 835 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 ( , default), or inside the Director cast library ( ). Read/write for script, TRUE FALSE Flash, and animated GIF members, read-only for all other member types.
  • Page 836 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...
  • Page 837 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.\...
  • Page 838 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...
  • Page 839 // 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.
  • Page 840 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 ( ) or play once and stop ( TRUE FALSE The default setting for this property is TRUE Example This statement sets the loop property of the cast member named Walkers to TRUE.
  • Page 841 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 ( ) or not ( TRUE FALSE Example This statement sets the QuickTime movie cast member Demo to loop: -- Lingo syntax member("Demo").loop = 1 // JavaScript syntax...
  • Page 842 loop (Windows Media) Usage -- Lingo syntax windowsMediaObjRef.loop // JavaScript syntax windowsMediaObjRef.loop; Description Windows Media property. Determines whether a movie loops ( , default) or not ( ) after TRUE FALSE completion. Read/write. Example This statement specifies that the cast member Classical should loop after completion: -- Lingo syntax member("Classical").loop = TRUE // JavaScript syntax...
  • Page 843 If the property is turned off while the movie is playing, the movie continues to play. loop 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.
  • Page 844 // 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.loopEndTime; Description Sound Channel property; specifies the end time, in milliseconds, of the loop set in the current sound playing in a sound channel.
  • Page 845 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. If this property is tested immediately after a sound starts playing, it returns one less than the number of loops defined with property in the methods.
  • Page 846 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.
  • Page 847 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...
  • Page 848 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 property to 0. mask 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")
  • Page 849 maxSpeed Usage member(whichCastmember).modelResource(whichModelResource).\ emitter.maxSpeed Description 3D property; when used with a model resource whose type is , allows you to get and #particle set the maximum speed at which particles are emitted. Each particle’s initial velocity is randomly selected between the emitter’s properties.
  • Page 850 Example This statement copies the content of the cast member Sunrise into the cast member Dawn by setting the member property value for Dawn to the member property value media media for Sunrise: -- Lingo syntax member("Dawn").media = member("Sunrise").media // JavaScript syntax member("Dawn").media = member("Sunrise").media;...
  • Page 851 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 The DVD is stopped. #stopped The DVD is playing. #playing #paused The DVD is paused.
  • Page 852 • indicates that a connection to the RealMedia or Windows Media stream is #connecting being established. • indicates that a connection to the RealMedia or Windows Media stream has been #opened established and is open. This is a transitory state that is very quickly followed by #buffering •...
  • Page 853 // 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].member Description 3D texture property; if the texture’s type is , this property indicates the cast #fromCastMember member that is used as the source for a texture. This property can be tested and set.
  • Page 854 // 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. argument can be a string that specifies the cast member by name or an memberNameOrNum integer that specifies the cast member by number.
  • Page 855 -- 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. Sprite property differs from the Sprite property, which specifies only the member spriteNum...
  • Page 856 // JavaScript syntax sprite(15).member = member(3, 4); Chapter 14: Properties...
  • Page 857 The following handler uses the function with the sprite.member property to find if mouseMember 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 // JavaScript syntax...
  • Page 858 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. Once you have added the modifier (using the command) to a model #meshDeform addModifier you have access to the following properties of the modifier: #meshDeform Note: For more detailed information about the following properties see the individual property entries...
  • Page 859 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;...
  • Page 860 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.
  • Page 861 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: • uses the actual mesh geometry of the model’s resource.
  • Page 862 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...
  • Page 863 modelB Usage collisionData.modelB Description property; indicates one of the models involved in a collision, the other model collisionData being modelA object is sent as an argument with the collisionData #collideWith #collideAny events to the handler specified in the , and registerForEvent, registerScript commands.
  • Page 864 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 , or is found at the index position specified by the whichModelResource parameter. If no model resource exists for the specified parameter, the command returns index .
  • Page 865 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");...
  • Page 866 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.
  • Page 867 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 property.
  • Page 868 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.
  • Page 869 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 , or #minQuality #maxQuality...
  • Page 870 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."...
  • Page 871 // 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.
  • Page 872 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 is the number of pixels the cursor is positioned from the left edge of mouseH the Stage.
  • Page 873 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 property.
  • Page 874 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 sprite property can have mouseLevel these values:...
  • Page 875 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.
  • Page 876 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.
  • Page 877 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!")
  • Page 878 _movie.updatestage() // 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;...
  • Page 879 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.
  • Page 880 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. property is useful for moving sprites to the vertical position of the mouse cursor and mouseV checking whether the cursor is within a region of the Stage.
  • Page 881 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.
  • Page 882 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 This statement checks whether a sprite is moveable and, if it is not, displays a message:...
  • Page 883 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;...
  • Page 884 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].name = "BirdCam"...
  • Page 885 Example This statement sets the variable to the name of the eighth item in the Edit menu: itemName 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"...
  • Page 886 // 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 of a sprite channel during a Score recording session—between calls to the Movie name object’s methods. beginRecording() endRecording() Note: Starting a Score recording session using...
  • Page 887 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: <?xml version="1.0"?> <e1> <tagName attr1="val1" attr2="val2"/> <e2>element 2</e2>...
  • Page 888 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).nearFiltering Description 3D texture property; allows you to get or set whether bilinear filtering is used when rendering a projected texture map that covers more screen space than the original texture source. Bilinear filtering smooths any errors across the texture and thus improves the texture’s appearance.
  • Page 889 _player.alert("Sorry, the Network Support Xtras could not be found."); See also Player netPresent...
  • Page 890 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.
  • Page 891 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.
  • Page 892 normalList Usage member(whichCastmember).modelResource(whichModelResource).\ normalList model.meshDeform.mesh[index].normalList Description 3D property; when used with a model resource whose type is , this property allows you to #mesh get or set the property of the model resource. normalList property is a linear list of vectors from which you may specify vertex normals normalList when building the faces of your mesh.
  • Page 893 Example This statement sets the property of the fifth face of the model resource named Player to normals 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;...
  • Page 894 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 to the number of characters in the word i located in...
  • Page 895 Example This statement displays the number of lines in the string “Macromedia, the Multimedia Company” in the Message window: put the number of lines in "Macromedia, the Multimedia Company" The result is 1.
  • Page 896 // 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...
  • Page 897 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 . The parameter can be a menu name or menu number. whichMenu whichMenu This menu property can be tested but not set. Use the command to set up a custom installMenu menu bar.
  • Page 898 Example This statement displays in the Message window the number of words in the string “Macromedia, the multimedia company”: put the number of words in "Macromedia, the multimedia company" The result is 4.
  • Page 899 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.
  • Page 900 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"...
  • Page 901 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 property of the model resource named Cylinder03 to 10: numSegments member("3D World").modelResource("Cylinder03").numSegments = 10 obeyScoreRotation...
  • Page 902 In Windows, does not work in projectors if Alt is pressed without another optionDown nonmodifier key. Avoid using if you intend to distribute a movie as a Windows optionDown projector and need to detect only the modifier key press; use instead.
  • Page 903 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:...
  • Page 904 Example This sprite script uses the property to set up a Flash movie sprite so it’s origin point originMode 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...
  • Page 905 Example This sprite script uses the property to set up a Flash movie sprite so its origin point originMode 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...
  • Page 906 Example This sprite script uses the property to set up a Flash movie sprite so its origin point originMode 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)
  • Page 907 Example This sprite script uses the property to set up a Flash movie sprite so its origin point originMode 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...
  • Page 908 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 this property returns the overlay.count total number of overlays contained in the camera’s list of overlays to be displayed. Overlays are textures displayed in front of all models appearing in a given camera’s view frustum.
  • Page 909 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.
  • Page 910 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.
  • Page 911 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, affects which speaker (left or right) the sound plays through.
  • Page 912 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.
  • Page 913 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.
  • Page 914 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 &...
  • Page 915 Setting the path of an unlinked cast member converts it to a linked cast member. This property can be tested and set. The property of an unlinked member is an pathName empty string. This property is the same as the property for other member types, and you can use fileName instead of...
  • Page 916 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. This property can be useful in movies with Shockwave content to change images by changing the tiling applied to a shape, allowing you to save memory required by larger bitmaps.
  • Page 917 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 ( or 0) or remains paused ( or 1).
  • Page 918 The following example uses the property to buffer a RealMedia sprite off the pausedAtStart Stage, and then play it on the Stage once the buffering is complete. In this example, the RealMedia member has its property set to . An instance of this member is pausedAtStart TRUE positioned off the Stage, in sprite channel 1.
  • Page 919 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),...
  • Page 920 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.
  • Page 921 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 // JavaScript syntax...
  • Page 922 Setting this property to allows a timeout object to continue generating timeout events in TRUE other movies. This is useful when one movie branches to another with the go to movie command. Example This handler creates a timeout object that will remain active after the declaring prepareMovie movie stops playing: on prepareMovie...
  • Page 923 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 (Lingo) or (JavaScript syntax).
  • Page 924 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 See also runMode playBackMode Usage -- Lingo syntax memberOrSpriteObjRef.playBackMode // JavaScript syntax memberOrSpriteObjRef.playBackMode;...
  • Page 925 playing Usage -- Lingo syntax spriteObjRef.playing // JavaScript syntax spriteObjRef.playing; Description Flash sprite property; indicates whether a Flash movie is playing ( ) or stopped ( TRUE 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...
  • Page 926 playlist Usage member(whichCastmember).model(whichModel).keyframePlayer.playlist member(whichCastmember).model(whichModel).bonesPlayer.playlist Description modifier property; returns a linear list of property lists, #keyframePlayer #bonesPlayer 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. #name •...
  • Page 927 Example This statement sets the property of the modifier for the model playRate keyframePlayer 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;...
  • Page 928 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...
  • Page 929 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 command. This property is a linear list of two object-relative vectors, the pointAt first vector in the list defines which direction is considered the object’s front direction, the second defines which direction is considered the object’s up direction.
  • Page 930 Example This example has two parts. The first part is the first line of code, which registers the #explode handler for the event. The second part is the handler. When two models #collideAny #explode in the cast member MyScene collide, the handler is called and the #explode collisionData...
  • Page 931 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.0000) The following statements first store the world transform of the model named Tire in the variable , then they display the position component of that transform.
  • Page 932 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.
  • Page 933 • specifies the Director built-in software renderer that works with both Macintosh #software and Windows platforms. • specifies that the most suitable renderer should be chosen. This is the default value for #auto this property. The value set for this property is used as the default for the Renderer Services object’s property.
  • Page 934 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 can be preloaded into memory ( ) or not ( default). The whichCastMember TRUE FALSE,...
  • Page 935 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;...
  • Page 936 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.
  • Page 937 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 command preLoadBuffer play is issued. -- Lingo syntax on mouseDown member("Louis Armstrong").stop() member("Louis Armstrong").preLoadTime = 6 // JavaScript syntax function mouseDown() { member("Louis Armstrong").stop();...
  • Page 938 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.
  • Page 939 When projection is , the apparent size of objects does not depend on distance #orthographic from the camera, and the property specifies how many world units fit vertically orthoHeight 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 property.
  • Page 940 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.
  • Page 941 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 property can have these values: quality •...
  • Page 942 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 ]. texturelist[ TextureListIndex ].quality Description 3D texture property; lets you get or set the image quality of a texture by controlling the level of mipmapping applied to the texture.
  • Page 943 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 function. random() Using the same seed produces the same sequence of random numbers. This property can be useful for debugging during development.
  • Page 944 The command creates a Shock Font in using the font named in the whichCastMember font argument. The value returned from the command reports whether the operation was successful. Zero indicates success. Example This statement creates a simple Shock Font using only the two arguments for the cast member and the font to record: myNewFontMember = new(#font) recordFont(myNewFontMember, "Lunar Lander")
  • Page 945 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.
  • Page 946 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.
  • Page 947 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.
  • Page 948 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 = member(whichTextMember).line[whichLine].word[firstWord..lastWord].fontStyle = [#bold] But with a property, you can refer to the same chunk as follows: myRef = member(whichTextMember).line[whichLine].word[firstWord..lastWord].ref The variable is now shorthand for the entire chunk expression. This allows something like myRef the following: put myRef.font...
  • Page 949 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.
  • Page 950 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 . Nonvisual members such as sounds do not have a useful point(horizontal, vertical) property.
  • Page 951 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.
  • Page 952 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 property.
  • Page 953 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\ .renderFormat member(whichCastmember).model(whichModel).shader.textureList\ [index].renderFormat member(whichCastmember).model(whichModel).shaderList[index].\ texture(whichTexture).renderFormat member(whichCastmember).model(whichModel).shaderList[index].\ textureList[index].renderFormat Description 3D property; allows you to get or set the for a specific texture by textureRenderFormat specifying one of the following values:...
  • Page 954 See also textureRenderFormat, getHardwareInfo() renderStyle Usage member(whichCastmember).shader(whichShader).renderStyle Description 3D standard shader property; allows you to get or set the for a shader, as renderStyle 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.
  • Page 955 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 #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.
  • Page 956 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 for both models involved in a collision, both models come TRUE to a stop at the point of collision. If only one of the models has the property set to resolve TRUE...
  • Page 957 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...
  • Page 958 rightIndent Usage chunkExpression.rightIndent Description Text cast member property; contains the offset distance, in pixels, of the right margin of from the right side of the text cast member. chunkExpression The value is an integer greater than or equal to 0. This property can be tested and set.
  • Page 959 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 ( ) or are currently being pressed TRUE ).
  • Page 960 Example This statement sets , which causes Lingo to use a single-byte character set: romanLingo TRUE set the romanLingo to TRUE See also inlineImeEnabled rootLock Usage member(whichCastmember).model(whichModel).keyframePlayer.rootLock member(whichCastmember).model(whichModel).bonesPlayer.rootLock Description modifier property; indicates whether the translational #keyframePlayer #bonesPlayer components of a motion are used ( ) or ignored ( FALSE TRUE...
  • Page 961 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.
  • Page 962 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...
  • Page 963 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.
  • Page 964 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.8771 ) See also...
  • Page 965 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;...
  • Page 966 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 of the sampleRate duration...
  • Page 967 When multiple sounds are queued in a sound channel, Director plays them all with the , and of the first sound queued, resampling the rest for channelCount sampleRate sampleSize smooth playback. Director resets these properties only after the channel’s sound queue is exhausted or a method is issued.
  • Page 968 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 Description 3D property; allows you to get or set the scale value used by a specific overlay or backdrop in the referenced camera’s list of overlays or backdrops to display.
  • Page 969 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.
  • Page 970 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 property allows you to scale get and set the degree of scaling of the transform along each of the three axes.
  • Page 971 • (default for Director movies prior to version 7)—Maintains the aspect ratio of the #showAll original Flash movie cast member. If necessary, fill in any gap in the horizontal or vertical dimension using the background color. • —Maintains the aspect ratio of the original Flash movie cast member. If necessary, #noBorder crop the horizontal or vertical dimension.
  • Page 972 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.
  • Page 973 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.
  • Page 974 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. argument can be either a string that specifies the name of the script cast scriptNameOrNum member or an integer that specifies the number of the script cast member.
  • Page 975 // 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.
  • Page 976 Example This handler displays the list of script references attached to a sprite: on showScriptRefs spriteNum put sprite(spriteNum).scriptInstanceList 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;...
  • Page 977 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 or 1) or disabled ( or 0).
  • Page 978 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;...
  • Page 979 The global variable could measure how far the user drags a slider. The statement sliderVal multiplies to give a value that is greater than the newVal = sliderVal * 100 sliderVal distance the user drags the slider. If is positive, the text moves up; if sliderVal sliderVal negative, the text moves down.
  • Page 980 specifies the maximum number of levels of resolution that the model can display when depth using the modifier. indicates the level of error tolerance for the subdivision surfaces functionality. This error property applies only when the property is set to sds.subdivision #adaptive indicates the mode of operation of the subdivision surfaces modifier.
  • Page 981 // 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.
  • Page 982 // 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 selectedText Usage -- Lingo syntax memberObjRef.selectedText // JavaScript syntax...
  • Page 983 // 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.
  • Page 984 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;...
  • Page 985 selStart Usage -- Lingo syntax selStart // JavaScript syntax selStart; Description Cast member property; specifies the starting character of a selection. It is used with selEnd 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 These statements select “cde”...
  • Page 986 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 \ &...
  • Page 987 Shaders are stored in the shader palette of the 3D cast member. They can be referenced by name ) or palette index ( ). A shader can be used by any number of models. whichShader shaderIndex Changes to a shader will appear in all models which use that shader. There are four types of shaders: shaders present their textures realistically.
  • Page 988 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 of the model named Bumper to the shaderList shader named Chrome:...
  • Page 989 shadowStrength Usage member(whichCastmember).model(whichModel).toon.shadowStrength member(whichCastmember).model(whichModel).shader.shadowStrength member(whichCastmember).shader(whichShader).shadowStrength Description modifier and shader property; indicates the brightness of the area of the toon #painter model’s surface where light does not create highlights. The default value of this property is 1.0. Example The following statement sets the property of the modifier for the model shadowStrength...
  • Page 990 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...
  • Page 991 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 property of the modifier for the model silhouettes inker named Sphere to .
  • Page 992 Example In this example, mrFount is a model resource of the type . This statement sets the #particle properties of mrFount. The first line sets the start value to 4, and the second line sets sizeRange 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.
  • Page 993 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;...
  • Page 994 For more information about working with extruder model resources and text cast members, 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.
  • Page 995 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. argument is an integer that specifies the number of the sound channel intSoundChannelNum to access.
  • Page 996 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;...
  • Page 997 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...
  • Page 998 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. Read- only. 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...
  • Page 999 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 , which prevents the sound driver from unloading and TRUE reloading each time a sound needs to play.
  • Page 1000 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 used in a completed movie, see the Sound Control movie in soundLevel the Learning/Lingo Examples folder inside the Director application folder.

This manual is also suitable for:

Director mx 2004

Table of Contents