MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference

Summary of DIRECTOR MX 2004-DIRECTOR SCRIPTING

  • Page 1

    Director ® mx 2004 director scripting reference.

  • Page 2

    Trademarks activeedit, activetest, add life to the web, afterburner, aftershock, andromedia, allaire, animation powerpack, aria, attain, authorware, authorware star, backstage, blue sky software, blue sky, breeze, bright tiger, clustercats, coldfusion, contents tab composer, contribute, design in mo...

  • Page 3: Contents

    3 contents chapter 1: introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 intended audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 what’s new with director scripting . . . . . . . . . ...

  • Page 4

    4 contents chapter 4: debugging scripts in director . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 good scripting habits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 basic debugging. . . . . . . . . . . . . . . . . . . . . . . . . . . ....

  • Page 5: Chapter 1

    5 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 t...

  • Page 6

    6 chapter 1: introduction what’s new with director scripting if you have written scripts in previous versions of director, you should note some new and important changes about scripting in this latest release. Dot syntax scripting format in previous releases of director, you could write lingo script...

  • Page 7

    Finding information about scripting in director 7 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 n...

  • Page 8

    8 chapter 1: introduction 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 ...

  • Page 9: Chapter 2

    9 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 i...

  • Page 10

    10 chapter 2: director scripting essentials • 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 ap...

  • Page 11

    Scripting terminology 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 m...

  • Page 12

    12 chapter 2: director scripting essentials • 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...

  • Page 13

    Scripting syntax 13 • parentheses are required after all method and function names. For example, when calling the sound object’s beep() method, you must include the parentheses after the word beep. Otherwise, a script error will occur. // javascript syntax _sound.Beep(); // this statement will work ...

  • Page 14

    14 chapter 2: director scripting essentials • the const keyword can be used in javascript syntax to specify a constant whose value does not change. Lingo has its own predefined set of constants ( tab , empty , and so on); therefore, the keyword const does not apply to lingo. For example, the followi...

  • Page 15

    Data types 15 • 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("...

  • Page 16

    16 chapter 2: director scripting essentials 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 exist...

  • Page 17

    Data types 17 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. While the director scripting reference may refer to some of these methods and properties, it does not incl...

  • Page 18

    18 chapter 2: director scripting essentials 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 m...

  • Page 19

    Literal values 19 a decimal number, also called a floating-point number, or float, is any number that includes a decimal point. In lingo, the floatprecision property controls the number of decimal places used to display these numbers. Director always uses the complete number, up to 15 significant di...

  • Page 20

    20 chapter 2: director scripting essentials constants a constant is a named value whose content never changes. In lingo, the predefined terms true , false , void , and empty are constants because their values are always the same. The predefined terms backspace , enter , quote , return , space , and ...

  • Page 21

    Variables 21 in javascript syntax, you cannot compare symbols of the same name to determine whether they refer to the same symbol. To compare symbols of the same name, you must first convert them to strings by using the tostring() method, and then perform the comparison. Variables director uses vari...

  • Page 22

    22 chapter 2: director scripting essentials to assign a value to a variable: • use the equals ( = ) operator. For example, the following statement assigns a url to the variable placestogo : // javascript syntax var placestogo = "http://www.Macromedia.Com"; variables can also hold the results of math...

  • Page 23

    Variables 23 to display all current global variables and their current values: • use the global object’s showglobals() method in the message window. For more information on the message window, see “debugging in the message window” on page 87 . To clear all current global variables: • use the global ...

  • Page 24

    24 chapter 2: director scripting essentials • if you declare a variable inside or outside a javascript syntax function by using the syntax _global.Varname , the variable is available to all scripts within a movie. The following example uses the syntax _global.Gmovie in one script to declare the vari...

  • Page 25

    Operators 25 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 ...

  • Page 26

    26 chapter 2: director scripting essentials arithmetic operators arithmetic operators add, subtract, multiply, divide, and perform other arithmetic operations. Parentheses and the minus sign are also arithmetic operators. Note: in lingo, when only integers are used in an operation, the result is an ...

  • Page 27

    Operators 27 assignment operators assignment operators assign a value to its left operand based on the value of its right operand. With the exception of the basic assignment operator, equal ( = ), all of the following shortcut assignment operators apply only to javascript syntax. Logical operators l...

  • Page 28

    28 chapter 2: director scripting essentials the not (lingo) or ! (javascript syntax) operator is useful for toggling a true or false value to its opposite. For example, the following statement turns on the sound if it’s currently off and turns off the sound if it’s currently on: -- lingo syntax _sou...

  • Page 29

    Conditional constructs 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...

  • Page 30

    30 chapter 2: director scripting essentials when writing if...Then structures in lingo, you can place the statement or statements following then in the same line as then , or you can place them on their own line by inserting a carriage return after then . If you insert a carriage return, you must al...

  • Page 31

    Conditional constructs 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" : _movi...

  • Page 32

    32 chapter 2: director scripting essentials 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 ins...

  • Page 33

    Events, messages, and handlers 33 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 dete...

  • Page 34

    34 chapter 2: director scripting essentials when the movie encounters a frame, events occur in the following order: 1 beginsprite this event occurs only if new sprites begin in the frame. 2 stepframe 3 prepareframe 4 enterframe after enterframe and before exitframe , director handles any time delays...

  • Page 35

    Events, messages, and handlers 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...

  • Page 36

    36 chapter 2: director scripting essentials after a handler intercepts a message, the message does not automatically pass on to the remaining locations. However, in lingo you can use the pass() method to override this default rule and pass the message to other objects. If no matching handler is foun...

  • Page 37

    Events, messages, and handlers 37 for example, consider that you wrote a custom sprite method named jump() that takes a single integer as a parameter, and you placed the method in a behavior. When you call jump() from a sprite object reference, the handler must also include a parameter that represen...

  • Page 38

    38 chapter 2: director scripting essentials // 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, ...

  • Page 39

    Linear lists and property lists 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(); // usin...

  • Page 40

    40 chapter 2: director scripting essentials the following statements illustrate defining the linear list workerlist that contains one value, heather , and then adds carlos as the second value in the list. -- lingo syntax workerlist = ["heather"] -- define a linear list workerlist[2] = "carlos" -- se...

  • Page 41

    Linear lists and property lists 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 foo...

  • Page 42

    42 chapter 2: director scripting essentials checking items in lists you can determine the characteristics of a list and the number of items the list contains by using the following methods. • to display the contents of a list, use the put() or trace() functions, passing the variable that contains th...

  • Page 43

    Linear lists and property lists 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 append() method. • to add an item at its proper position in a sorted list, use the add() or addprop() methods. • ...

  • Page 44

    44 chapter 2: director scripting essentials to create a copy of a list that is independent of another list: • use the duplicate() method. For example, the following statements create a list and then make an independent copy of the list. -- lingo syntax oldlist = ["a", "b", "c"] newlist = oldlist.Dup...

  • Page 45

    Javascript syntax arrays 45 // 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...

  • Page 46

    46 chapter 2: director scripting essentials • to delete an item from an array, use the array object’s splice() method. • to replace an item in an array, use the array object’s splice() method. The following example illustrates using the array object’s splice() method to add items to, delete items fr...

  • Page 47

    Javascript syntax arrays 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 sort() method. The following...

  • Page 48

    48 chapter 2: director scripting essentials.

  • Page 49: Chapter 3

    49 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. I...

  • Page 50

    50 chapter 3: writing scripts in director therefore, after you know how to access the scripting apis in one language, you essentially know how to access them in the other language. For example, javascript syntax code can access lingo data types such as symbols, linear lists, property lists, and so o...

  • Page 51

    Introducing the director objects 51 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 wo...

  • Page 52

    52 chapter 3: writing scripts in director 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 ...

  • Page 53

    Object model diagrams 53 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..

  • Page 54

    54 chapter 3: writing scripts in director 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 crea...

  • Page 55

    Object-oriented programming with lingo 55 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 d...

  • Page 56

    56 chapter 3: writing scripts in director 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...

  • Page 57

    Object-oriented programming with lingo 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 synta...

  • Page 58

    58 chapter 3: writing scripts in director the following on new handler creates a new child object from the parent script and initializes the child’s spritenum property with the value passed to it in the aspritenum parameter. The return me statement returns the child object to the handler that origin...

  • Page 59

    Object-oriented programming with lingo 59 creating a child object child objects exist entirely in memory; they are not saved with a movie. Only parent and ancestor scripts exist on disk. To create a new child object, you use the new() method and assign the child object a variable name or position in...

  • Page 60

    60 chapter 3: writing scripts in director 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 ...

  • Page 61

    Object-oriented programming with lingo 61 using scriptinstancelist you can use the scriptinstancelist property to dynamically add new behaviors to a sprite. Normally, scriptinstancelist is the list of behavior instances created from the behavior initializers defined in the score. If you add child ob...

  • Page 62

    62 chapter 3: writing scripts in director to add an object to the actorlist: • use the actorlist property as follows, where childobject is a reference to the child object to add: -- lingo syntax _movie.Actorlist.Add(childobject) the object’s stepframe handler in its parent or ancestor script then ru...

  • Page 63

    Object-oriented programming with lingo 63 this statement uses the following elements: • variablename is the variable you are placing the timeout object into. • timeout indicates which type of lingo object you are creating. • timeoutname is the name you give to the timeout object. This name appears i...

  • Page 64

    64 chapter 3: writing scripts in director 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 ...

  • Page 65

    Object-oriented programming with javascript syntax 65 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 referen...

  • Page 66

    66 chapter 3: writing scripts in director • 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 c...

  • Page 67

    Object-oriented programming with javascript syntax 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 the new expression. Object instances the most co...

  • Page 68

    68 chapter 3: writing scripts in director 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. Inher...

  • Page 69

    Object-oriented programming with javascript syntax 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 ...

  • Page 70

    70 chapter 3: writing scripts in director the following example defines a function named car_increasespeed() . The function name is then assigned to the increasespeed property of the car class’s prototype object. // increase the speed of a car function car_increasespeed(x) { this.Speed += x; return ...

  • Page 71

    Object-oriented programming with javascript syntax 71 the following example defines a function named setinitialspeed() that can change the default speed of new car instances. The function name is assigned to the setinitialspeed property of the car class. Function car(make, model, color) { // define ...

  • Page 72

    72 chapter 3: writing scripts in director deleting variables you can delete a class variable or an instance variable by using the delete operator. The following example illustrates this process. Function car() { // define a car constructor function ... } car.Color = "blue"; // define a color propert...

  • Page 73

    Writing scripts in the script window 73 you can also add properties to object instances after the instances have been created. When you add a property to a specific object instance, that property is available only to that specific object instance. Using the mycar object instance created previously, ...

  • Page 74

    74 chapter 3: writing scripts in director 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 win...

  • Page 75

    Writing scripts in the script window 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 se...

  • Page 76

    76 chapter 3: writing scripts in director • the categorized 3d lingo menu lists categories of all 3d lingo elements according to the features they are used for. • the scripting xtras pop-up menu includes the methods and properties of all scripting xtra extensions found, regardless of whether they ar...

  • Page 77

    Writing scripts in the script window 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 ...

  • Page 78

    78 chapter 3: writing scripts in director to find text in scripts: 1 make the script window active. 2 select edit > find > text. The find text dialog box appears. 3 enter text that you want to find in the find field, and then click find. By default, find is not case-sensitive: thishandler , thishand...

  • Page 79

    Writing scripts in the script window 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 behav...

  • Page 80

    80 chapter 3: writing scripts in director 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...

  • Page 81

    Writing scripts in the script window 81 to cycle through the scripts in the script window: • use the previous cast member and next cast member arrows at the top of the script window to advance or back up to a script. To duplicate a script: • select the script in the cast window and select duplicate ...

  • Page 82

    82 chapter 3: writing scripts in director 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 imp...

  • Page 83: Chapter 4

    83 chapter 4 debugging scripts in director scripts do not always do what you want the first time. The script often has an error in its syntax: possibly a word is misspelled or a small part of the script is missing. Other times, the script might work but does not produce the expected result. Mistakes...

  • Page 84

    84 chapter 4: debugging scripts in director 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 ...

  • Page 85

    Basic debugging 85 locating the problem do the following to start locating a problem: • think backwards through the chain to identify where the unexpected started to happen. • use the message window to trace which frames the movie goes through and the handlers that your scripts run. • determine what...

  • Page 86

    86 chapter 4: debugging scripts in director 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...

  • Page 87

    Debugging in the message window 87 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 ...

  • Page 88

    88 chapter 4: debugging scripts in director managing the message window the message window has an input pane and an output pane. The input pane is editable. The output pane is read-only. The only way to display text in the output pane is by calling the put() or trace() functions. You can adjust the ...

  • Page 89

    Debugging in the message window 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 synt...

  • Page 90

    90 chapter 4: debugging scripts in director like the script window, the message window contains pop-up menus of scripting commands. When you select a command from one of the pop-up menus, the command appears in the message window with the first argument that you must provide selected. Several menus ...

  • Page 91

    Debugging in the object inspector 91 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 --> if leftside --> _movie.Go("game start") indicate t...

  • Page 92

    92 chapter 4: debugging scripts in director understanding object structure the object inspector can be very useful for understanding the structure of complex objects. For example, 3d cast members have many layers of properties. Because the object inspector shows you a visual representation of the ne...

  • Page 93

    Debugging in the object inspector 93 to view an object using the inspect object button: 1 in the script window, highlight the part of a statement that refers to an object. 2 in the script window, click inspect object. If the object has subproperties, a plus sign (+) appears to the left of it. 3 clic...

  • Page 94

    94 chapter 4: debugging scripts in director 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

    Debugging in the debugger window 95 to add a breakpoint that will open the debugger window: 1 in the script window, open the script that should contain the breakpoint. 2 click in the left margin of the script window next to the line of code where you want the breakpoint to appear, or place the inser...

  • Page 96

    96 chapter 4: debugging scripts in director 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 p...

  • Page 97

    Debugging in the debugger window 97 to add an object to the watcher pane whose name does not appear in the script pane: 1 double-click the first empty cell in the object column of the watcher pane. 2 type the name of the object in the cell and press enter (windows) or return (macintosh). If the obje...

  • Page 98

    98 chapter 4: debugging scripts in director when you are finished debugging, you can exit the debugger at any time: to resume normal execution of code an exit the debugger window: • click the run script button. To exit the debugger and stop playback of the movie: • click the stop debugging button. E...

  • Page 99

    Advanced debugging 99 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 ...

  • Page 100

    100 chapter 4: debugging scripts in director.

  • Page 101: Chapter 5

    101 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...

  • Page 102

    102 chapter 5: director core objects property summary for the cast library object see also castlib , castlib() , member , movie , player , sprite , window global provides a location to store and access global variables. These variables are available to both lingo and javascript syntax. You can acces...

  • Page 103

    Key 103 method summary for the global object see also _global key used to monitor a user’s keyboard activity. You can access the key object by using the top level _key property. You can either assign _key to a variable, or use the _key property directly to access the key object’s methods and propert...

  • Page 104

    104 chapter 5: director core objects 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 refer...

  • Page 105

    Mouse 105 property summary for the member object see also media types , member() , member (cast) , member (movie) , member (sprite) , movie , player , scripting objects , sprite , window mouse provides access to a user’s mouse activity, including mouse movement and mouse clicks. You can access the m...

  • Page 106

    106 chapter 5: director core objects see also _mouse movie represents a movie being played within the director player. The director player can contain one or more movies. A movie can consist of one or more cast libraries. A cast library can consist of one or more cast members, which represent the me...

  • Page 107

    Movie 107 property summary for the movie object constrainh() preloadmovie() constrainv() printfrom() delay() puppetpalette() deleteframe() puppetsprite() duplicateframe() puppettempo() endrecording() puppettransition() finishidleload() ramneeded() frameready() (movie) rollover() go() savemovie() gol...

  • Page 108

    108 chapter 5: director core objects see also _movie , cast library , member , movie , player , sprite , window player represents the core playback engine used to manage and execute the authoring environment, movies in a window (miaws), projectors, and shockwave player. The player object provides ac...

  • Page 109

    Player 109 method summary for the player object property summary for the player object see also _player , cast library , member , movie , sprite , window method alert() getpref() appminimize() halt() cursor() open() (player) externalparamname() quit() externalparamvalue() setpref() flushinputevents(...

  • Page 110

    110 chapter 5: director core objects sound controls audio playback in all eight available sound channels. The sound object consists of sound channel objects, which represent individual sound channels. You can create a reference to the sound object by using top level _sound property. • assign _sound ...

  • Page 111

    Sound channel 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...

  • Page 112

    112 chapter 5: director core objects 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 re...

  • Page 113

    Sprite 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 whic...

  • Page 114

    114 chapter 5: director core objects 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 co...

  • Page 115

    System 115 property summary for the sprite channel object 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 t...

  • Page 116

    116 chapter 5: director core objects window represents a window in which a movie is playing, including the stage window and any other movies in a window (miaws) that are in use. You can create a reference to a window object by using the top level window() function, the player object’s window propert...

  • Page 117

    Window 117 property summary for the window object see also cast library , member , movie , player , sprite , window() , window , windowlist property appearanceoptions resizable bgcolor (window) sizestate dockingenabled sourcerect drawrect title (window) filename (window) titlebaroptions image (windo...

  • Page 118

    118 chapter 5: director core objects.

  • Page 119: Chapter 6

    119 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...

  • Page 120

    120 chapter 6: media types method summary for the animated gif media type property summary for the animated gif media type 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, su...

  • Page 121

    Color palette 121 property summary for the bitmap media type see also member button represents a button or check box cast member. You can add a button cast member to a movie by using the movie object’s newmember() method. -- lingo syntax _movie.Newmember(#button) // javascript syntax _movie.Newmembe...

  • Page 122

    122 chapter 6: media types you can associate a bitmap cast member with a color palette cast member by setting the palette property of the bitmap cast member. The following example sets the palette property of the bitmap cast member bmpmember to the color palette cast member colorpalettemember . The ...

  • Page 123

    Dvd 123 dvd represents a dvd cast member. You can add a dvd cast member to a movie by using the movie object’s newmember() method. -- lingo syntax _movie.Newmember(#dvd) // javascript syntax _movie.Newmember("dvd"); some of the following methods or properties may apply only to sprites that are creat...

  • Page 124

    124 chapter 6: media types property summary for the dvd media type see also member field represents a field cast member. You can add a field cast member to a movie by using the movie object’s newmember() method. -- lingo syntax _movie.Newmember(#field) // javascript syntax _movie.Newmember("field");...

  • Page 125

    Flash component 125 property summary for the field media type see also member film loop represents a film loop cast member. You can add a film loop cast member to a movie by using the movie object’s newmember() method. -- lingo syntax _movie.Newmember(#filmloop) // javascript syntax _movie.Newmember...

  • Page 126

    126 chapter 6: media types director supports the following flash components: a flash component has access to the same apis that a regular flash cast member or sprite does, in addition to the functionality that is specific to that component. For more information about using these flash components, se...

  • Page 127

    Flash movie 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 mem...

  • Page 128

    128 chapter 6: media types see also flash component , member font represents a font cast member. You can add a font cast member to a movie by using the movie object’s newmember() method. -- lingo syntax _movie.Newmember(#font) // javascript syntax _movie.Newmember("font"); property summary for the f...

  • Page 129

    Quicktime 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 typ...

  • Page 130

    130 chapter 6: media types property summary for the quicktime media type see also member realmedia represents a realmedia cast member. You can add a realmedia cast member to a movie by using the movie object’s newmember() method. -- lingo syntax _movie.Newmember(#realmedia) // javascript syntax _mov...

  • Page 131

    Shockwave 3d 131 method summary for the realmedia media type property summary for the realmedia media type see also 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 comp...

  • Page 132

    132 chapter 6: media types shockwave audio represents a shockwave audio cast member. You can add a shockwave audio cast member to a movie by using the movie object’s newmember() method. -- lingo syntax _movie.Newmember(#swa) // javascript syntax _movie.Newmember("swa"); event summary for the shockwa...

  • Page 133

    Text 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

    134 chapter 6: media types property summary for the text media type see also member vector shape represents a vector shape cast member. You can add a vector shape cast member to a movie by using the movie object’s newmember() method. -- lingo syntax _movie.Newmember(#vectorshape) // javascript synta...

  • Page 135

    Windows media 135 property summary for the vector shape media type see also member windows media represents a windows media cast member. You can add a windows media cast member to a movie by using the movie object’s newmember() method. -- lingo syntax _movie.Newmember(#windowsmedia) // javascript sy...

  • Page 136

    136 chapter 6: media types method summary for the windows media media type property summary for the windows media media type see also member method pause() (realmedia, swa, windows media) play() (realmedia, swa, windows media) playfromtotime() rewind() (windows media) stop() (realmedia, swa, windows...

  • Page 137: Chapter 7

    137 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 capabilit...

  • Page 138

    138 chapter 7: scripting objects netlingo enables you to perform network operations such as obtaining or streaming media from a network, checking network availability, checking the progress of a network operation, and so on. You can create a reference to a netlingo object by using the new operator. ...

  • Page 139

    Speechxtra 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 new operator. -- lingo syntax objspeech = new xtra("speechxtra") // javascript syntax var objspeech = new xtra("speechxtra"); method summary for the sp...

  • Page 140

    140 chapter 7: scripting objects xml parser enables you to perform xml parsing. You can create a reference to an xml parser object by using the new operator. -- lingo syntax objxml = new xtra("xmlparser") // javascript syntax var objxml = new xtra("xmlparser"); method summary for the xml parser obje...

  • Page 141: Chapter 8

    141 chapter 8 3d objects the 3d objects enable you to add 3d functionality to a movie. These objects are exposed to both lingo and javascript syntax within macromedia director mx 2004, projectors, and the macromedia shockwave player. You access these 3d objects through shockwave 3d (or simply 3d) ca...

  • Page 142

    142 chapter 8: 3d objects camera represents a camera object. A camera controls how a 3d sprite views the 3d world. A 3d sprite displays a particular camera’s view into the world. You can create a reference to a camera by using the camera property of the 3d member object. The camera property gets the...

  • Page 143

    Group 143 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 ...

  • Page 144

    144 chapter 8: 3d objects property summary for the group object 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 refe...

  • Page 145

    Member 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 member() fu...

  • Page 146

    146 chapter 8: 3d objects property summary for the member object see also camera , group , light , model , model resource , motion , shader , sprite , texture model represents a visible object that a user sees within a 3d world. A model makes use of a model resource and occupies a specific position ...

  • Page 147

    Model resource 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 addmodifier() method. After a modifier has been attached to a model, its properties can be manipulated with script. The following mod...

  • Page 148

    148 chapter 8: 3d objects 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 j...

  • Page 149

    Sprite 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 shader property of the 3d member object. The shader property gets the shad...

  • Page 150

    150 chapter 8: 3d objects method summary for the sprite object property summary for the sprite object see also camera , member texture represents the texture applied to a shader. You can create a reference to a texture by using the texture property of the 3d member object. The texture property gets ...

  • Page 151: Chapter 9

    151 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 a...

  • Page 152

    152 chapter 9: constants backspace usage -- lingo syntax backspace // javascript syntax 51 // value of _key.Keycode description constant; represents the backspace key. This key is labeled backspace in windows and delete on the macintosh. Example this on keydown handler checks whether the backspace k...

  • Page 153

    Enter 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 enter refers only to enter on the numeric keypad. For a movie that plays bac...

  • Page 154

    154 chapter 9: constants false usage -- lingo syntax false // javascript syntax false description constant; applies to an expression that is logically false , such as 2 > 3. When treated as a number value, false has the numerical value of 0. Conversely, 0 is treated as false . Example this statement...

  • Page 155

    Quote 155 quote usage --lingo syntax quote // javascript syntax \" description constant; represents the quotation mark character and refers to the literal quotation mark character in a string, because the quotation mark character itself is used by lingo scripts to delimit strings. Example this state...

  • Page 156

    156 chapter 9: constants return (constant) usage -- lingo syntax return // javascript syntax 36 // value of _key.Keycode // 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:...

  • Page 157

    Tab 157 tab usage -- lingo syntax tab // javascript syntax 48 // value of _key.Keycode description constant; represents the tab key. Example this statement checks whether the character typed is the tab character and calls the handler donextfield if it is: -- lingo syntax if (_key.Key = tab) then don...

  • Page 158

    158 chapter 9: constants true usage -- lingo syntax true // javascript syntax true description constant; represents the value of a logically true expression, such as 2 . It has a traditional numerical value of 1, but any nonzero integer evaluates to true in a comparison. Example this statement turns...

  • Page 159: Chapter 10

    159 chapter 10 events and messages this section provides an alphabetical list of all the events and messages available in macromedia director mx 2004. On activateapplication usage -- lingo syntax on activateapplication statement(s) end // javascript syntax function activateapplication() { statement(...

  • Page 160

    160 chapter 10: events and messages example this handler plays a sound each time the user brings the projector back to the foreground: -- lingo syntax on activateapplication sound(1).Queue(member("opensound")) sound(1).Play() end // javascript syntax function activateapplication() { sound(1).Queue(m...

  • Page 161

    On beginsprite 161 see also activewindow , close() , on deactivatewindow , frontwindow , on movewindow , open() (window) on beginsprite usage -- lingo syntax on beginsprite statement(s) end // javascript syntax function beginsprite() { statement(s); } description system message and event handler; co...

  • Page 162

    162 chapter 10: events and messages on closewindow usage -- lingo syntax on closewindow statement(s) end // javascript syntax function closewindow() { statement(s); } description system message and event handler; contains statements that run when the user closes the window for a movie by clicking th...

  • Page 163

    On deactivateapplication 163 • channelid the number of the sound or sprite channel for the file where the cue point occurred. • cuepointnumber the ordinal number of the cue point that triggers the event in the list of the cast member’s cue points. • cuepointname the name of the cue point that was en...

  • Page 164

    164 chapter 10: events and messages example this handler plays a sound each time the user sends the projector to the background: -- lingo syntax on deactivateapplication sound(1).Queue(member("closesound")) sound(1).Play() end // javascript syntax function deactivateapplication() { sound(1).Queue(me...

  • Page 165

    On dvdeventnotification 165 on dvdeventnotification usage -- lingo syntax on dvdeventnotification objectref, event {, eventarg1} {, eventarg2} {, eventarg3} statement(s) end // javascript syntax function dvdeventnotification (objectref, event {, eventarg1} {, eventarg2} {, eventarg3}) { statement(s)...

  • Page 166

    166 chapter 10: events and messages chapterstart occurs when playback of a new program in the title domain starts. The following additional information is passed to dvdeventnotification when this event occurs: • eventarg2 - an integer that indicates the new chapter number. Diskejected occurs when a ...

  • Page 167

    On dvdeventnotification 167 parentallevelchange occurs when the parental level of the authored content is about to change. The following additional information is passed to dvdeventnotification when this event occurs: • eventarg2 . An integer that indicates the new parental level set in the player. ...

  • Page 168

    168 chapter 10: events and messages see also dvd on endsprite usage -- lingo syntax on endsprite statement(s) end // javascript syntax function endsprite() { statement(s); } description system message and event handler; contains lingo that runs when the playhead leaves a sprite and goes to a frame i...

  • Page 169

    On enterframe 169 example this handler runs when the playhead exits a sprite: -- lingo syntax on endsprite me -- clean up gnumberofsharks = gnumberofsharks - 1 sound(5).Stop() end // javascript syntax function endsprite() { // clean up gnumberofsharks--; sound(5).Stop(); } see also on beginsprite , ...

  • Page 170

    170 chapter 10: events and messages example this handler turns off the puppet condition for sprites 1 through 5 each time the playhead enters the frame: -- lingo syntax on enterframe repeat with i = 1 to 5 _movie.Puppetsprite(i, false) end repeat end // javascript syntax function enterframe() { for ...

  • Page 171

    On evalscript 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) end // javascript syntax function evalscript(aparam) { _movie.Go(aparam); } this handler runs the state...

  • Page 172

    172 chapter 10: events and messages on exitframe usage -- lingo syntax on exitframe statement(s) end // javascript syntax function exitframe() { statement(s); } description system message and event handler; contains statements that run each time the playhead exits the frame that the on exitframe han...

  • Page 173

    On getbehaviordescription 173 this handler branches the playhead to a specified frame if the value in the global variable vtotal exceeds 1000 when the playhead exits the frame: // javascript syntax function exitframe() { if (_global.Vtotal > 1000) { _movie.Go("finished"); } } see also on enterframe ...

  • Page 174

    174 chapter 10: events and messages on getbehaviortooltip usage -- lingo syntax on getbehaviortooltip statement(s) end // javascript syntax function getbehaviortooltip() { statement(s); } description system message and event handler; contains lingo that returns the string that appears in a tooltip f...

  • Page 175

    On getpropertydescriptionlist 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 on getpropertydescriptionlist handler within a behavior script. Behaviors tha...

  • Page 176

    176 chapter 10: events and messages on hyperlinkclicked usage -- lingo syntax on hyperlinkclicked me, data, range statement(s) end // javascript syntax function hyperlinkclicked(data, range) { statement(s); } description system message and event handler; used to determine when a hyperlink is actuall...

  • Page 177

    On idle 177 on idle usage -- lingo syntax on idle statement(s) end // javascript syntax function idle() { statement(s); } description system message and event handler; contains statements that run whenever the movie has no other events to handle and is a useful location for lingo statements that you...

  • Page 178

    178 chapter 10: events and messages on isoktoattach usage -- lingo syntax on isoktoattach me, aspritetype, aspritenum statement(s) end // javascript syntax function isoktoattach(aspritetype, aspritenum) { statement(s) } description built-in handler; you can add this handler to a behavior in order to...

  • Page 179

    On keydown 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 ...

  • Page 180

    180 chapter 10: events and messages you can override an on keydown handler by placing an alternative on keydown handler in a location that lingo checks before it gets to the handler you want to override. For example, you can override an on keydown handler assigned to a cast member by placing an on k...

  • Page 181

    On mousedown (event handler) 181 when the movie plays back as an applet, an on keyup handler always traps key presses, even if the handler is empty. If the user is typing in an editable field, an on keyup handler attached to the field must include the pass command for the key to appear in the field....

  • Page 182

    182 chapter 10: events and messages when the mouse button is pressed, lingo searches the following locations, in order, for an on mousedown handler: primary event handler, sprite script, cast member script, frame script, and movie script. Lingo stops searching when it reaches the first location that...

  • Page 183

    On mouseenter 183 on mouseenter usage -- lingo syntax on mouseenter statement(s) end // javascript syntax function mouseenter() { statement(s); } description system message and event handler; contains statements that run when the mouse pointer first contacts the active area of the sprite. The mouse ...

  • Page 184

    184 chapter 10: events and messages on mouseleave usage -- lingo syntax on mouseleave statement(s) end // javascript syntax function mouseleave() { statement(s); } description system message and event handler; contains statements that run when the mouse leaves the active area of the sprite. The mous...

  • Page 185

    On mouseup (event handler) 185 on mouseup (event handler) usage -- lingo syntax on mouseup statement(s) end // javascript syntax function mouseup() { statement(s); } description system message and event handler; contains statements that are activated when the mouse button is released. When the mouse...

  • Page 186

    186 chapter 10: events and messages example this handler, assigned to sprite 10, switches the cast member assigned to sprite 10 when the user releases the mouse button after clicking the sprite: -- lingo syntax on mouseup sprite(10).Member = member("dimmed") end // javascript syntax function mouseup...

  • Page 187

    On movewindow 187 on mousewithin usage -- lingo syntax on mousewithin statement(s) end // javascript syntax function mousewithin() { statement(s); } description system message and event handler; contains statements that run when the mouse is within the active area of the sprite. The mouse button doe...

  • Page 188

    188 chapter 10: events and messages example this handler displays a message in the message window when the window a movie is playing in moves: -- lingo syntax on movewindow put("just moved window containing" && _movie.Name) end // javascript syntax function movewindow() { put("just moved window cont...

  • Page 189

    On preparemovie 189 on prepareframe usage -- lingo syntax on prepareframe statement(s) end // javascript syntax function prepareframe { statement(s); } description system message and event handler; contains statements that run immediately before the current frame is drawn. Unlike beginsprite and end...

  • Page 190

    190 chapter 10: events and messages 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...

  • Page 191

    On rightmousedown (event handler) 191 example this handler moves sprite 3 to the coordinates stored in the variable centerplace when the window that the movie is playing in is resized: -- lingo syntax on resizewindow centerplace sprite(3).Loc = centerplace end // javascript syntax function resizewin...

  • Page 192

    192 chapter 10: events and messages on rightmouseup (event handler) usage -- lingo syntax on rightmouseup statement(s) end // javascript syntax function rightmouseup() { statement(s); } description system message and event handler; in windows, specifies statements that run when the right mouse butto...

  • Page 193

    On savedlocal 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 currentinitializerlist . Normally, the parameters dialog box allows the user to set the mass and gravitational constants. However, t...

  • Page 194

    194 chapter 10: events and messages on sendxml usage -- lingo syntax on sendxml "sendxmlstring", "window", "postdata" statement(s) end // javascript syntax function sendxml(sendxmlstring, window, postdata) { statement(s); } description event handler; functions much like the geturl scripting method, ...

  • Page 195

    On startmovie 195 // javascript syntax function sendxml(theurl, targetwindow, xmldata) { gotonetpage(theurl, targetwindow); postnettext(theurl, xmldata); } on startmovie usage -- lingo syntax on startmovie statement(s) end // javascript syntax function startmovie() { statement(s); } description syst...

  • Page 196

    196 chapter 10: events and messages on stepframe usage -- lingo syntax on stepframe statement(s) end // javascript syntax function stepframe() { statement(s); } description system message and event handler; works in script instances in actorlist because these are the only objects that receive on ste...

  • Page 197

    On streamstatus 197 on stopmovie usage -- lingo syntax on stopmovie statement(s) end // javascript syntax function stopmovie() { statement(s); } description system message and event handler; contains statements that run when the movie stops playing. An on stopmovie handler is a good place to put lin...

  • Page 198

    198 chapter 10: events and messages description system message and event handler; called periodically to determine how much of an object has been downloaded from the internet. The handler is called only if tellstreamstatus (true) has been called, and the handler has been added to a movie script. The...

  • Page 199

    Trayiconmousedoubleclick 199 on timeout usage -- lingo syntax on timeout statement(s) end // javascript syntax function timeout() { statement(s); } description system message and event handler; contains statements that run when the keyboard or mouse is not used for the time period specified in timeo...

  • Page 200

    200 chapter 10: events and messages example the following handler pauses a movie when a user double-clicks the system tray icon. -- lingo syntax on trayiconmousedoubleclick _movie.Delay(500) end // javascript syntax function trayiconmousedoubleclick() { _movie.Delay(500); } see also movie , systemtr...

  • Page 201

    On zoomwindow 201 trayiconrightmousedown usage -- lingo syntax on trayiconrightmousedown statement(s) end // javascript syntax function trayiconrightmousedown() { statement(s); } description movie and window event handler (microsoft windows only). Contains statements that run when a user right-click...

  • Page 202

    202 chapter 10: events and messages an on zoomwindow event handler is a good place to put lingo that rearranges sprites when window dimensions change. Example this handler moves sprite 3 to the coordinates stored in the variable centerplace when the window that the movie is playing in is resized: --...

  • Page 203: Chapter 11

    203 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 ...

  • Page 204

    204 chapter 11: keywords description keyword; starts a multiple branching logic structure that is easier to write than repeated if...Then statements. Lingo compares the value in case expression to the expressions in the lines beneath it, starting at the beginning and continuing through each line in ...

  • Page 205

    Char...Of 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...

  • Page 206

    206 chapter 11: keywords end usage -- lingo syntax end description keyword; marks the end of handlers and multiple-line control structures. Example the following mousedown handler ends with an end mousedown statement. On mousedown _player.Alert("the mouse was pressed") end mousedown end case usage -...

  • Page 207

    Field 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 end see also abort , halt() , quit() , pass , return (keyword) exit repeat usage -- lingo synta...

  • Page 208

    208 chapter 11: keywords the term field was used in earlier versions of director and is maintained for backward compatibility. For new movies, use member to refer to field cast members. Example this statement places the characters 5 through 10 of the field name entry in the variable mykeyword : myke...

  • Page 209

    If 209 see also showglobals() , property , gotonetmovie if usage if logicalexpression then statement if logicalexpression then statement else statement end if if logicalexpression then statement(s) end if if logicalexpression then statement(s) else statement(s) end if if logicalexpression1 then stat...

  • Page 210

    210 chapter 11: keywords 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 key...

  • Page 211

    Line...Of 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 itemdelimiter property. The terms whichitem , firstitem , and lastitem must be integers or integer ...

  • Page 212

    212 chapter 11: keywords chunk expressions refer to any character, word, item, or line in any source of characters. Sources of characters include field cast members and variables that hold strings. Example this statement assigns the first four lines of the variable action to the field cast member to...

  • Page 213

    Menu 213 on new me return me end the following two sets of handlers make up a parent script. The first set uses me to refer to the child object. The second set uses the variable myaddress to refer to the child object. In all other respects, the parent scripts are the same. This is the first set: pro...

  • Page 215

    Next 215 nan usage -- lingo syntax nan description return value; indicates that a specified lingo expression is not a number. This statement attempts to display the square root of -1, which is not a number, in the message window: -- lingo syntax put((-1).Sqrt) -- nan see also inf next usage -- lingo...

  • Page 216

    216 chapter 11: keywords next repeat usage -- lingo syntax next repeat description keyword; sends lingo to the next step in a repeat loop in a script. This function differs from that of the exit repeat keyword. Example this repeat loop displays only odd numbers in the message window: repeat with i =...

  • Page 217

    Property 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 of keyword. • if the user pressed any other key, the movie executes the statement that follo...

  • Page 218

    218 chapter 11: keywords this parent script handler declares pmyspritenum a property to make it available: -- script elder property pmychannel on new me, whichsprite me.Pmychannel = whichsprite return me end the original behavior script sets up the ancestor and passes the spritenum property to all b...

  • Page 219

    Put...Into 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 chunkex...

  • Page 220

    220 chapter 11: keywords 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 ...

  • Page 221

    Repeat with...Down to 221 repeat with usage -- lingo syntax repeat with counter = start to finish statement(s) end repeat description keyword; executes the lingo specified by statement(s) the number of times specified by counter . The value of counter is the difference between the value specified by...

  • Page 222

    222 chapter 11: keywords while in a repeat loop, lingo ignores other events. To check the current key in a repeat loop, use the keypressed property. If you need to process something for several seconds or more, evaluate the function in a loop with some type of counter or test to track progress. If t...

  • Page 223

    Return (keyword) 223 return (keyword) usage -- lingo syntax return expression description keyword; returns the value of expression and exits from the handler. The expression argument can be any lingo value. When calling a handler that serves as a user-defined function and has a return value, you mus...

  • Page 224

    224 chapter 11: keywords set...To, set...= usage -- lingo syntax lingoproperty = expression variable = expression description command; evaluates an expression and puts the result in the property specified by lingoproperty or the variable specified by variable . Example this statement sets the name o...

  • Page 225

    Version 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 sprite1 is entirely inside the quad of sprite2 ( true ) or not ( false ). If both...

  • Page 226

    226 chapter 11: keywords 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(w...

  • Page 227: Chapter 12

    227 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 remainin...

  • Page 228

    228 chapter 12: methods abs() usage --lingo syntax abs (numericexpression) // javascript syntax math.Abs (numericexpression) description math function (lingo only); calculates the absolute value of a numerical expression. The abs() function has several uses. It can simplify the tracking of mouse and...

  • Page 229

    Activatebutton() 229 parameters point(x, y) required. A point in stage coordinates that specifies the location of the embedded dvd menu item. Example this statement activates the hilite of the menu item at a specified stage location: -- lingo syntax member("movie1").Activateatloc(point(100, 200)) //...

  • Page 230

    230 chapter 12: methods add usage -- lingo syntax linearlist.Add(value) // javascript syntax array.Push(value) description list command; for linear lists only, adds a value to a linear list. For a sorted list, the value is placed in its proper order. For an unsorted list, the value is added to the e...

  • Page 231

    Addat 231 description 3d meshdeform modifier command; adds an empty texture layer to the model’s mesh. You can copy texture coordinates between layers using the following code: modelreference.Meshdeform.Texturelayer[a].Texturecoordinatelist = modelreference.Meshdeform.Texturelayer[b].Texturecoordina...

  • Page 232

    232 chapter 12: methods 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)}.Addbackdr...

  • Page 233

    Addchild 233 parameters whichcamera required. A reference to the camera to add to the list of cameras for the sprite. Index required. An integer that specifies the index in the list of cameras at which whichcamera is added. If index is greater than the value of cameracount() , the camera is added to...

  • Page 234

    234 chapter 12: methods 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 ...

  • Page 235

    Addoverlay 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 (modifi...

  • Page 236

    236 chapter 12: methods // 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(prope...

  • Page 237

    Addvertex() 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(w...

  • Page 238

    238 chapter 12: methods 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. Par...

  • Page 239

    Append 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 ...

  • Page 240

    240 chapter 12: methods 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, ...

  • Page 241

    Beep() 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: -- l...

  • Page 242

    242 chapter 12: methods // javascript syntax function mouseup() { _sound.Beep(1); } see also sound beginrecording() usage -- lingo syntax _movie.Beginrecording() // javascript syntax _movie.Beginrecording(); description movie method; starts a score generation session. When you call beginrecording() ...

  • Page 243

    Bitand() 243 // javascript syntax function animball(numberofframes) { _movie.Beginrecording(); var horizontal = 0; var vertical = 100; for (var i = 1; i _movie.Go(1); sprite(20).Member = member("ball"); sprite(20).Loch = horizontal; sprite(20).Locv = vertical; sprite(20).Forecolor = 255; horizontal ...

  • Page 244

    244 chapter 12: methods 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 d...

  • Page 245

    Bitxor() 245 parameters integer1 required. The first integer. Integer2 required. The second integer. 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...

  • Page 246

    246 chapter 12: methods breakloop() usage -- lingo syntax soundchannelobjref.Breakloop() // javascript syntax soundchannelobjref.Breakloop(); description sound channel method; causes the currently looping sound in channel soundchannelobjref to stop looping and play through to its endtime . If there ...

  • Page 247

    Build() 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" this statement di...

  • Page 248

    248 chapter 12: methods line 7 calls the build() command to construct the mesh. -- lingo syntax nm = member("shapes").Newmesh("plane",1,3,0,3,0) nm.Vertexlist = [vector(0,0,0), vector(20,0,0), vector(20, 20, 0)] nm.Face[1].Vertices = [1,2,3] nm.Colorlist = [rgb(255,255,0), rgb(0, 255, 0), rgb(0,0,25...

  • Page 249

    Cachesize() 249 // javascript syntax function resetcache() { current = cachedocverify(); if (current == symbol("once")) { alert("turning cache verification on"); cachedocverify(symbol("always")) } } parameters cachesetting optional. A symbol that specifies how often the contents of a page on the int...

  • Page 250

    250 chapter 12: methods // javascript syntax function checkcache() { if (cachesize() alert("increasing cache to 1mb"); cachesize(1000); } } see also cachedocverify() , clearcache call usage call #handlername, script, {args...} call (#handlername, scriptinstance, {args...}) description command; sends...

  • Page 251

    Call 251 the following example shows how a call statement can call handlers in a behavior or parent 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 end on run me, newtool put "man running...

  • Page 252

    252 chapter 12: methods callancestor usage callancestor handlername, script, {args...} description command; sends a message to a child object’s ancestor script. Ancestors can, in turn, have their own ancestors. When you use callancestor , the name of the handler can be a variable, and you can explic...

  • Page 253

    Callframe() 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 stateme...

  • Page 254

    254 chapter 12: methods 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).C...

  • Page 255

    Castlib() 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) // java...

  • Page 256

    256 chapter 12: methods the default cast library number is 1. To specify a cast member in a cast library other than cast 1, set castlib() to specify the alternative cast library. Parameters castnameornum required. A string that specifies the cast library name, or an integer that specifies the cast l...

  • Page 257

    Chaptercount() 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 sound() method. Para...

  • Page 258

    258 chapter 12: methods 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 closes...

  • Page 259

    Chartonum() 259 parameters stringexpression required. A string that specifies the expression from which a substring is returned. Firstcharacter required. An integer that specifies the point at which the substring starts. Lastcharacter required. An integer that specifies the point at which the substr...

  • Page 260

    260 chapter 12: methods 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 che...

  • Page 261

    Clearcache 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 netwo...

  • Page 262

    262 chapter 12: methods 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 se...

  • Page 263

    Clearglobals() 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 ...

  • Page 264

    264 chapter 12: methods this method is useful when initializing global variables or when opening a new movie that requires a new set of global variables. Parameters none. Example the following handlers set all global variables to void (lingo) or null (javascript): -- lingo syntax on mousedown _globa...

  • Page 265

    Clonemodelfromcastmember 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) d...

  • Page 266

    266 chapter 12: methods 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 ...

  • Page 267

    Closefile() 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 open() (window) method. This allows rapid access to windows that you want to keep ...

  • Page 268

    268 chapter 12: methods closexlib usage closexlib whichfile description command; closes an xlibrary file. Xtra extensions are stored in xlibrary files. Xlibrary files are resource files that contain xtra extensions. Hypercard xcmds and xfcns can also be stored in xlibrary files. The closexlib comman...

  • Page 269

    Constrainh() 269 parameters intpaletteindex required if using 8-bit palette values. An integer that specifies the 8-bit palette value to use. Valid values range from 0 to 255. All other values are truncated. Intred required if using rgb values. An integer that specifies the red color component in th...

  • Page 270

    270 chapter 12: methods parameters intspritenum required. An integer that specifies the sprite whose horizontal coordinates are evaluated against intposn . Intposn required. An integer to be evaluated against by the horizontal coordinates of the left and right sides of the sprite identified by intsp...

  • Page 271

    Copypixels() 271 both the constrainv() and constrainh() s constrain only one axis each. Parameters intspritenum required. An integer that identifies the sprite whose vertical coordinates are evaluated against intposn . Intposn required. An integer to be evaluated against by the vertical coordinates ...

  • Page 272

    272 chapter 12: methods to see an example of quad used in a completed movie, see the quad movie in the learning/lingo folder inside the director application folder. Parameters sourceimgobj required. A reference to the source image object from which pixels are copied. Destrectorquad required if copyi...

  • Page 273

    Copytoclipboard() 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 i...

  • Page 274

    274 chapter 12: methods cos() usage (angle).Cos cos (angle) description function (lingo only); calculates the cosine of the specified angle, which must be expressed in radians. In javascript syntax, use the math object’s cos() function. Parameters angle required. An integer that specifies the angle ...

  • Page 275

    Createmask() 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 fileio...

  • Page 276

    276 chapter 12: methods creatematte() syntax imageobject.Creatematte({alphathreshold}) description this function creates and returns a matte object that you can use with copypixels() to duplicate the effect of the matte sprite ink. The matte object is created from the specified image object’s alpha ...

  • Page 277

    Cross 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 crop to trim existing cast members, or i...

  • Page 278

    278 chapter 12: methods 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 ...

  • Page 279

    Cursor() 279 • use the syntax _player.Cursor(cursormemref) for the custom cursors available through the cursor xtra. Note: although the cursor xtra allows cursors of different cast library types, text cast members cannot be used as cursors. • use the syntax _player.Cursor(intcursornum) to specify de...

  • Page 280

    280 chapter 12: methods during system events such as file loading, the operating system may display the watch cursor and then change to the pointer cursor when returning control to the application, overriding the cursor command settings from the previous movie. To use cursor() at the beginning of an...

  • Page 281

    Cursor() 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 ch...

  • Page 282

    282 chapter 12: methods 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({millis...

  • Page 283

    Date() (formats) 283 intformat optional when creating a lingo date object. An integer that specifies the new date object. Intyearformat optional when creating a lingo date object. An integer that specifies the four- digit year of the new date object. Intmonthformat optional when creating a lingo dat...

  • Page 284

    284 chapter 12: methods 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 c...

  • Page 285

    Delay() 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, delay() is useful for controlling the playback rate of a sequence of frames. Th...

  • Page 286

    286 chapter 12: methods 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 ...

  • Page 287

    Deleteframe() 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 ...

  • Page 288

    288 chapter 12: methods 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.De...

  • Page 289

    Deletemodel 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 lightnameornum...

  • Page 290

    290 chapter 12: methods 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 becom...

  • Page 291

    Deleteprop 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, deleteone also deletes the property associated with the deleted value. If the value appears in the list more than once, deleteone ...

  • Page 292

    292 chapter 12: methods see also deleteat deleteshader usage member(whichcastmember).Deleteshader(whichshader) member(whichcastmember).Deleteshader(index) description 3d command; removes the shader from the cast member. Parameters shadernameornum required. A string or integer that specifies the name...

  • Page 293

    Displayopen() 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 indext...

  • Page 294

    294 chapter 12: methods 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...

  • Page 295

    Dot() 295 doneparsing() usage parserobject.Doneparsing() description function; returns 1 (true) when the parser has completed parsing a document using parseurl() . The return value is 0 (false) until the parsing is complete. Parameters none. See also parseurl() dot() usage vector1.Dot(vector2) descr...

  • Page 296

    296 chapter 12: methods dotproduct() usage vector1.Dotproduct(vector2) description 3d vector method; returns the sum of the products of the x, y, and z components of two vectors. If both vectors are normalized, the dotproduct is the cosine of the angle between the two vectors. To manually arrive at ...

  • Page 297

    Draw() 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 downloadnetthing command...

  • Page 298

    298 chapter 12: methods x2 required if drawing a line using x and y coordinates. An integer that specifies the x coordinate of the end of the line. Y2 required if drawing a line using x and y coordinates. An integer that specifies the y coordinate of the end of the line. Colorobjorparamlist required...

  • Page 299

    Duplicate() (member) 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...

  • Page 300

    300 chapter 12: methods parameters intposn optional. An integer that specifies the cast window for the duplicate cast member. If omitted, the duplicate cast member is placed in the first open cast window position. Example this statement makes a copy of cast member desk and places it in the first emp...

  • Page 301

    Endrecording() 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 _movie.Duplicateframe(); } _movie.Endrecording(); } see also insert...

  • Page 302

    302 chapter 12: methods example when used in the following handler, the endrecording keyword ends the score generation session: -- lingo syntax on animball(numberofframes) _movie.Beginrecording() horizontal = 0 vertical = 100 repeat with i = 1 to numberofframes _movie.Go(i) sprite(20).Member = membe...

  • Page 303

    Error() 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 start through finish : -- lingo syn...

  • Page 304

    304 chapter 12: methods 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 wo...

  • Page 305

    Extrude3d 305 alternatively, define a script for the event: event="externalevent(aparam)" language="vbscript"> 'script here within the movie, include the function and any parameters as part of the string for externalevent : externalevent ("myfunction ('parm1','parm2')") see also on evalscript extrud...

  • Page 306

    306 chapter 12: methods 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 or tag. If ...

  • Page 307

    Externalparamvalue() 307 parameters paramnameornum required. A string that specifies the name of the parameter name to return, or an integer that specifies the index location of the parameter name to return. Example this statement places the value of a given external parameter in the variable myvari...

  • Page 308

    308 chapter 12: methods 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. Parameters paramnameornum required. A string tha...

  • Page 309

    Fadein() 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") == "sw...

  • Page 310

    310 chapter 12: methods 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); ...

  • Page 311

    Filename() 311 fadeto() usage -- lingo syntax soundchannelobjref.Fadeto(intvolume {, intmilliseconds}) // javascript syntax soundchannelobjref.Fadeto(intvolume {, intmilliseconds}); description sound channel method; gradually changes the volume of a sound channel to a specified volume over a given n...

  • Page 312

    312 chapter 12: methods 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 imageobj...

  • Page 313

    Findempty() 313 point(x, y), point(x, y) required if filling a region using points. Two points that specify the upper-left and lower-right corners of region to fill, relative to the upper-left corner of the given image object. Rect required if filling a region using a rectangle. A rectangle that spe...

  • Page 314

    314 chapter 12: methods 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) fi...

  • Page 315

    Finishidleload() 315 the findposnear command is similar to the findpos command, except that when the specified property is not in the list, the findposnear command identifies the position of the value with the most similar alphanumeric name. This command is useful in finding the name that is the clo...

  • Page 316

    316 chapter 12: methods 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 ...

  • Page 317

    Floatp() 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 the floatprecision propert...

  • Page 318

    318 chapter 12: methods 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, in...

  • Page 319

    Forget() (timeout) 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 forget() on a wi...

  • Page 320

    320 chapter 12: methods 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...

  • Page 321

    Frameready() (movie) 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 ...

  • Page 322

    322 chapter 12: methods 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 pl...

  • Page 323

    Freebytes() 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 // javascript syntax if (freeblock alert("not enough memory!") } see also freebytes() , memorysize , ramneeded() , size fr...

  • Page 324

    324 chapter 12: methods generatenormals() usage member(whichcastmember).Modelresource(whichmodelresource). Generatenormals(style) description 3d #mesh model resource command; calculates the normal vectors for each vertex of the mesh. If the style parameter is set to #flat , each vertex receives a no...

  • Page 325

    Getaprop 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 by item , listposition , or pr...

  • Page 326

    326 chapter 12: methods getat usage getat(list, position) list [position] description list command; identifies the item in a specified position of a specified list. If the list contains fewer elements than the specified position, a script error occurs. The getat command works with linear and propert...

  • Page 327

    Geterror() (flash, swa) 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 getat , brackets can be nested: firstpersondept = employeeinfolist[1][...

  • Page 328

    328 chapter 12: methods parameters none. Example this handler uses geterror to determine whether an error involving the shockwave audio cast member norma desmond speaks occurred and displays the appropriate error string in a field if it did: -- lingo syntax on exitframe if member("norma desmond spea...

  • Page 329

    Geterrorstring() 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() , geterror...

  • Page 330

    330 chapter 12: methods possible geterror() integer values and corresponding geterrorstring() messages are: parameters none. Example this handler uses geterror() to determine whether an error occurred for shockwave audio cast member norma desmond speaks, and if so, uses geterrorstring to obtain the ...

  • Page 331

    Getflashproperty() 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 ...

  • Page 332

    332 chapter 12: methods 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 labe...

  • Page 333

    Gethotspotrect() 333 #maxtexturesize is a linear list containing the maximum width and height of a texture, in pixels. Textures that exceed this size are downsampled until they do not. To avoid texture sampling artifacts, author textures of various sizes and choose the ones that do not exceed the #m...

  • Page 334

    334 chapter 12: methods 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]: pu...

  • Page 335

    Getnettext() 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 openfile() before using getlength() to return the length of the file. Parame...

  • Page 336

    336 chapter 12: methods to see an example of getnettext() used in a completed movie, see the forms and post movie in the learning/lingo folder inside the director application folder. Parameters url required. The url to the file that contains the text to get. Propertylist optional. Specifies a proper...

  • Page 337

    Getnthfilenameinfolder() 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 ...

  • Page 338

    338 chapter 12: methods 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 g...

  • Page 339

    Getpixel() 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 col...

  • Page 340

    340 chapter 12: methods 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 play...

  • Page 341

    Getpref() 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 en...

  • Page 342

    342 chapter 12: methods to see an example of getpref() used in a completed movie, see the read and write text movie in the learning/lingo folder inside the director application folder. Parameters stringprefname required. A string that specifies the file for which content is retrieved. Example this h...

  • Page 343

    Getprop() 343 getpref() usage getpref(preffilename) description function; retrieves the content of the specified file. When you use this function, replace preffilename with the name of a file created by the setpref function. If no such file exists, getpref returns void . The filename used for preffi...

  • Page 344

    344 chapter 12: methods example this statement identifies the value associated with the property #c in the property list answers, which consists of [#a:10, #b:12, #c:15, #d:22]: getprop(answers, #c) the result is 15, because 15 is the value associated with #c . See also getone() getpropat() usage li...

  • Page 345

    Getstreamstatus() 345 • depthbufferdepth indicates the bit depth of the hardware output buffer. • colorbufferdepth indicates the bit depth of the color buffer. This property can be tested but not set. • modifiers is a linear list of modifiers available for use by models in 3d cast members. Possible ...

  • Page 346

    346 chapter 12: methods example this statement displays in the message window the current status of a download begun with getnettext() and the resulting net id placed in the variable netid : put getstreamstatus(netid) -- [#url: "www.Macromedia.Com", #state: "inprogress", #bytessofar: 250, \ #bytesto...

  • Page 347

    Getworldtransform() 347 this statement sets the variable tobject to refer to the same object that the variable named gvar refers to in the flash movie in sprite 3: -- lingo syntax tobject = sprite(3).Getvariable("gvar",false) // javascript syntax var tobject = sprite(3).Getvariable("gvar",0); this s...

  • Page 348

    348 chapter 12: methods 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,...

  • Page 349

    Goloop() 349 parameters framenameornum required. A string that specifies the marker label of the frame to which the playhead branches, or an integer that specifies the number of the frame to which the playhead branches. Moviename optional. A string that specifies the movie that contains the frame sp...

  • Page 350

    350 chapter 12: methods if no markers are to the left of the playhead, the playhead branches to: • the next marker to the right if the current frame does not have a marker. • the current frame if the current frame has a marker. • frame 1 if the movie contains no markers. Parameters none. Example thi...

  • Page 351

    Gotoframe() 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...

  • Page 352

    352 chapter 12: methods example the following handler branches to different points within a flash movie in channel 5. It accepts a parameter that indicates which frame to go to. -- lingo syntax on navigate(whereto) sprite(5).Gotoframe(whereto) end // javascript syntax function navigate(whereto) { sp...

  • Page 353

    Gotonetpage 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, t...

  • Page 354

    354 chapter 12: methods 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 can...

  • Page 355

    Handlers() 355 handler() usage scriptobject.Handler(#handlersymbol) description this function returns true if the given scriptobject contains a specified handler, and false if it does not. The script object must be a parent script, a child object, or a behavior. Parameters symhandler required. Speci...

  • Page 356

    356 chapter 12: methods 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 hig...

  • Page 357

    Hmstoframes() 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 th...

  • Page 358

    358 chapter 12: methods dropframe required. Logical expression that determines whether the frame is a drop frame ( true ) or not ( false ). If the string hms ends in a d, the time is treated as a drop frame, regardless of the value of dropframe . Fractionalseconds required. Logical expression that d...

  • Page 359

    Identity() 359 // javascript syntax function enterframe() { var i = 5; while (i sprite(i).Hold(); i++; } } see also playrate (quicktime, avi) identity() usage member(whichcastmember).Model(whichmodel).Transform.Identity() member(whichcastmember).Group(whichgroup).Transform.Identity() member(whichcas...

  • Page 360

    360 chapter 12: methods idleloaddone() usage -- lingo syntax _movie.Idleloaddone(intloadtag) // javascript syntax _movie.Idleloaddone(intloadtag); description movie method; reports whether all cast members with the given tag have been loaded ( true ) or are still waiting to be loaded ( false ). Para...

  • Page 361

    Ilk() 361 example these lingo statements leave ignorewhitespace() set to the default of true and parse the given xml into a list. The element has no children in the list. Xmltext = "" parserobj.Parsestring(xmltext) thelist = parserobj.Makelist() put thelist -- ["root of xml document": ["!Attributes"...

  • Page 362

    362 chapter 12: methods the following table shows the return value for each type of object recognized by ilk() : parameters object required. Specifies the object to test. Type optional. Specifies the type to which object is compared. If the object is of the specified type, the ilk() function returns...

  • Page 363

    Ilk (3d) 363 example the following ilk statement identifies the type of the object named bids: bids = [:] put ilk( bids ) -- #proplist the following ilk statement tests whether the variable total is a list and displays the result in the message window: total = 2+2 put ilk( total, #list ) -- 0 in thi...

  • Page 364

    364 chapter 12: methods parameters object required. Specifies the object to test. Type optional. Specifies the type to which object is compared. If the object is of the specified type, the ilk() function returns true . It the object is not of the specified type, the ilk() function returns false . Ex...

  • Page 365

    Importfileinto() 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 bla...

  • Page 366

    366 chapter 12: methods • when downloading files from the internet, use it to download the file at a specific url and set the filename of linked media. Note: to import a file from a url, it is usually more efficient to use the preloadnetthing() to download the file to a local disk first, and then im...

  • Page 367

    Insertframe() 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, locwithinspri...

  • Page 368

    368 chapter 12: methods parameters none. Example the following handler generates a frame that has the transition cast member fog assigned in the transition channel followed by a set of empty frames. The argument numberofframes sets the number of frames. -- lingo syntax on animball(numberofframes) _m...

  • Page 369

    Installmenu 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...

  • Page 370

    370 chapter 12: methods parameters fieldmemberobjref optional. Specifies the field cast member to which a menu is installed. Example this statement installs the menu defined in field cast member 37: installmenu 37 this statement installs the menu defined in the field cast member named menubar: insta...

  • Page 371

    Interface() 371 integerp() usage expression.Integerp (numericexpression).Integerp integerp(expression) description function (lingo only); indicates whether a specified expression can be evaluated to an integer ( 1 or true ) or not ( 0 or false ). P in integerp stands for predicate. Parameters expres...

  • Page 372

    372 chapter 12: methods interpolate() usage transform1.Interpolate(transform2,percentage) description 3d transform method; returns a copy of transform1 created by interpolating from the position and rotation of transform1 to the position and rotation of transform2 by the specified percentage. The or...

  • Page 373

    Inverse() 373 intersect() usage rectangle1. Intersect(rectangle2) intersect(rectangle1, rectangle2) description function; determines the rectangle formed where two rectangles intersect. Parameters rectangle2 required. Specifies the second rectangle in the intersection test. Example this statement as...

  • Page 374

    374 chapter 12: methods 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(whichcastmembe...

  • Page 375

    Isinworld() 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 sy...

  • Page 376

    376 chapter 12: methods 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 ...

  • Page 377

    Keypressed() 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.” -...

  • Page 378

    378 chapter 12: methods example the following statement checks whether the user pressed the enter key in windows or the return key on a macintosh and runs the handler updatedata if the key was pressed: -- lingo syntax if (_key.Keypressed(return)) then updatedata end if // javascript syntax if (_key....

  • Page 379

    Last() 379 parameters stringmarkername required. A string that specifies the name of the marker label associated with a frame. Example this statement sends the playhead to the tenth frame after the frame labeled start: -- lingo syntax _movie.Go(_movie.Label("start") + 10) // javascript syntax _movie...

  • Page 380

    380 chapter 12: methods 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 th...

  • Page 381

    Light() 381 length() usage string.Length length(string) description function; returns the number of characters in the string specified by string , including spaces and control characters such as tab and return. Parameters none. Example this statement displays the number of characters in the string “...

  • Page 382

    382 chapter 12: methods 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. This...

  • Page 383

    List() 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) // javascri...

  • Page 384

    384 chapter 12: methods when creating a list using the syntax [] , with or without parameters, the index of list values begins with 0. The maximum length of a single line of executable script is 256 characters. Large lists cannot be created using list() . To create a list with a large amount of data...

  • Page 385

    Loctocharpos() 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 state property must be either -1 (error) or 4 (loaded) before the loadfile com...

  • Page 386

    386 chapter 12: methods 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 ...

  • Page 387

    Makelist() 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 log() function. Parameters number required. A number from which the natural logarithm is calculated. This number must be ...

  • Page 388

    388 chapter 12: methods end if return parsedlist end // javascript syntax function converttolist(xmlstring) { parserobject = new xtra("xmlparser"); // check syntax errorcode = parserobject.Parsestring(xmlstring); errorstring = parserobject.Geterror(); if (voidp(errorstring)) { parsedlist = parserobj...

  • Page 389

    Map() 389 makesublist() usage xmlnode.Makesublist() description function; returns a property list from a child node the same way that makelist() returns the root of an xml document in list format. Parameters none. Example beginning with the following xml: element 2 element 3 this statement returns a...

  • Page 390

    390 chapter 12: methods 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 large...

  • Page 391

    Marker() 391 if the specified point on the stage is not within the sprite, a void is returned. Parameters whichpointinmember required. A point from which an equivalent point is returned. See also map() , mapstagetomember() mapstagetomember() usage sprite(whichspritenumber). Mapstagetomember(whichpoi...

  • Page 392

    392 chapter 12: methods • marker(-1) — returns the frame number of the first marker before the marker(0). • marker(-2) — returns the frame number of the second marker before the marker(0). If the parameter markernameornum is a string, marker() returns the frame number of the first frame whose marker...

  • Page 393

    Maximize() 393 -- lingo syntax on findwinner bids winner = bids.Max() member("congratulations").Text = \ "you have won, with a bid of $" & winner &"!" end // javascript syntax function findwinner(bids) { winner = bids.Max(); member("congratulations").Text = "you have won, with a bid of $" + \ winner...

  • Page 394

    394 chapter 12: methods mci usage mci "string" description command; for windows only, passes the strings specified by string to the windows media control interface (mci) for control of multimedia extensions. Note: microsoft no longer recommends using the 16-bit mci interface. Consider using third-pa...

  • Page 395

    Mergedisplaytemplate() 395 castnameornum optional. A string that specifies the cast library name to which the member belongs, or an integer that specifies the index position of the cast library to which the member belongs. If omitted, member() searches all cast libraries until a match is found. Exam...

  • Page 396

    396 chapter 12: methods 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 propli...

  • Page 397

    Meshdeform (modifier) 397 • normallist allows you to get or set the list of normal vectors used by the specified mesh. • texturecoordinatelist allows you to get or set the texture coordinates used by the first texture layer of the specified mesh. To get or set the texture coordinates for any other t...

  • Page 398

    398 chapter 12: methods • mesh[index] allows access to the properties of the specified mesh. Parameters none. Example the following statement displays the number of faces in the model named gbface: put member("3d world").Model("gbface").Meshdeform.Face.Count -- 432 the following statement displays t...

  • Page 399

    Model 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 alrea...

  • Page 400

    400 chapter 12: methods parameters whichmodel optional. A string that specifies the name of the model to return. Example this statement stores a reference to the model named player avatar in the variable thismodel : thismodel = member("3dworld").Model("player avatar") this statement stores a referen...

  • Page 401

    Modelsunderloc 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 ...

  • Page 402

    402 chapter 12: methods modellist optional. A list of model references that are included if they are found under the specified ray. Model references not included in this list are ignored, even if they are under the specified ray. Use the model references, not the string names of the models. Specify ...

  • Page 403

    Modelsunderray 403 parameters locationvector required. A vector from which a ray is drawn and under which a list of models is found. Directionvector required. A vector that specifies the direction the ray is pointing. Optionslist optional. A list that specifies the maximum number of models to return...

  • Page 404

    404 chapter 12: methods this statement builds a list of options that would return a maximum of ten models, include simple detail, draw results from tmodellist , and have a maximum ray distance of 50: toptionslist = [#maxnumberofmodels: 10, #levelofdetail: #simple, #modellist: tmodellist, #maxdistanc...

  • Page 405

    Move() 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 whichmotion , or is found at the index po...

  • Page 406

    406 chapter 12: methods 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 sy...

  • Page 407

    Movevertex() 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 windowlist in front of all othe...

  • Page 408

    408 chapter 12: methods parameters vertexindex required. Specifies the index position of the vertex to move. Xchange required. Specifies the amount to move the vertex horizontally. Ychange required. Specifies the amount to move the vertex vertically. Example this statement shifts the first vertex po...

  • Page 409

    Neighbor 409 see also addvertex() , deletevertex() , originmode , vertexlist multiply() usage transform.Multiply(transform2) description 3d command; applies the positional, rotational, and scaling effects of transform2 after the original transform. Parameters transform2 required. Specifies the trans...

  • Page 410

    410 chapter 12: methods netabort usage netabort(url) netabort(netid) description command; cancels a network operation without waiting for a result. Using a network id is the most efficient way to stop a network operation. The id is returned when you use a network function such as getnettext() or pos...

  • Page 411

    Netdone() 411 parameters netid optional. Specifies the id of the network operation to test. Example the following handler uses the netdone function to test whether the last network operation has finished. If the operation is finished, text returned by nettextresult is displayed in the field cast mem...

  • Page 412

    412 chapter 12: methods 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 th...

  • Page 413

    Netlastmoddate() 413 example this statement passes a network id to neterror to check the error status of a particular network operation: --lingo syntax on exitframe global mynetid if neterror(mynetid)"ok" then beep end // javascript syntax function exitframe() { global mynetid; if (neterror(mynetid)...

  • Page 414

    414 chapter 12: methods // 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 las...

  • Page 415

    Nettextresult() 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 , preloadnetthi...

  • Page 416

    416 chapter 12: methods if the specified network operation was getnettext() , the text is the text of the file on the network. If the specified network operation was postnettext , the result is the server’s response. After the next operation starts, director discards the results of the previous oper...

  • Page 417

    New() 417 for cast members, the type parameter sets the cast member’s type. Possible predefined values correspond to the existing cast member types: #bitmap , #field , and so on. The new function can also create xtra cast member types, which can be identified by any name that the author chooses. It’...

  • Page 418

    418 chapter 12: methods after the line has been executed, newmember will contain the member reference to the cast member just created: put newmember -- (member 1 of castlib 1) if you are using javascript syntax to create a new cast members, use the movie object's newmember() method. This statement c...

  • Page 419

    Newcamera 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").Ne...

  • Page 420

    420 chapter 12: methods newcurve() usage -- lingo syntax memberobjref.Newcurve(positioninvertexlist) // javascript syntax memberobjref.Newcurve(positioninvertexlist); description function; adds a #newcurve symbol to the vertexlist of vectorcastmember , which adds a new shape to the vector shape. You...

  • Page 421

    Newmember() 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 newlightname required. Specifies the name of the new light. The name of the new light must be ...

  • Page 422

    422 chapter 12: methods when the argument for the new() function is a parent script, the new function creates a child object. The parent script should include an on new handler that sets the child object’s initial state or property values and returns the me reference to the child object. The child o...

  • Page 423

    Newmesh 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 vertexlist and face[index].Vertices properties of t...

  • Page 424

    424 chapter 12: methods line 17 calls the build command to construct the mesh. Nm = member("shapes").Newmesh("pyramid",6 , 5, 0, 3) nm.Vertexlist = [ vector(0,0,0), vector(40,0,0), \ vector(40,0,40), vector(0,0,40), vector(20,50,20) ] nm.Colorlist = [ rgb(255,0,0), rgb(0,255,0), rgb(0,0,255) ] nm.Fa...

  • Page 425

    Newmodelresource 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 ...

  • Page 426

    426 chapter 12: methods 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...

  • Page 427

    Newshader 427 parameters objecttype required. Specifies the type of new object to create. Arg1, arg2, ... Optional. Specifies any initialization arguments required by the object. Each argument must be separated by a comma. Example this lingo sets the variable tlocalconobject to a reference to a new ...

  • Page 428

    428 chapter 12: methods parameters newshadername required. Specifies the name of the new shader. The name of the new shader must be unique in the shader list. Shadertype required. A symbol that determines the style in which the shader is applied. Valid values include the following: • #standard shade...

  • Page 429

    Normalize 429 typeindicator optional. Specifies the type of the new texture. If omitted, the new texture is created with no specific type. Valid values include the following: • #fromcastmember (a cast member) • #fromimageobject (a lingo image object) sourceobjectreference optional. Specifies a refer...

  • Page 430

    430 chapter 12: methods nothing usage nothing description command; does nothing. This command is useful for making the logic of an if...Then statement more obvious. A nested if...Then...Else statement that contains no explicit command for the else clause may require else nothing , so that lingo does...

  • Page 431

    Nudge() 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 spri...

  • Page 432

    432 chapter 12: methods 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 r...

  • Page 433

    Offset() (string function) 433 objectp() usage objectp(expression) description function; indicates whether a specified expression is an object produced by a parent script, xtra, or window ( true ) or not ( false ). The p in objectp stands for predicate. It is good practice to use objectp to determin...

  • Page 434

    434 chapter 12: methods parameters stringexpression1 required. Specifies the sub-string to search for in stringexpression2 . Stringexpression2 required. Specifies the string that contains the sub-string stringexpression1 . Example this statement displays in the message window the beginning position ...

  • Page 435

    Open() (player) 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 horizontalchange required. Sp...

  • Page 436

    436 chapter 12: methods parameters stringdocpath optional. A string that specifies the document to open when the application specified by stringapppath opens. Stringapppath required. A string that specifies the path to the application to open. Example this statement opens the textedit application, w...

  • Page 437

    Openxlib 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 -- lin...

  • Page 438

    438 chapter 12: methods in windows, the .Dll extension is optional. Note: this command is not supported in shockwave player. Parameters whichfile required. Specifies the xlibrary file to open. If the file is not in the folder containing the current movie, whichfile must include the pathname. Example...

  • Page 439

    Parsestring() 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...

  • Page 440

    440 chapter 12: methods 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 p...

  • Page 441

    Parseurl() 441 the movie script contains the on parsedone handler: on parsedone global gparserobject if voidp(gparserobject.Geterror()) then put "successful parse" else put "parse error:" put " " & gparserobject.Geterror() end if end this javascript syntax parses the file sample.Xml and calls the pa...

  • Page 442

    442 chapter 12: methods 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 =...

  • Page 443

    Pasteclipboardinto() 443 end // javascript syntax function keydown() { legalcharacters = "1234567890"; if (legalcharacters.Indexof(_key.Key) >= 0) { pass(); } else { _sound.Beep(); } } see also stopevent() pasteclipboardinto() usage -- lingo syntax memberobjref.Pasteclipboardinto() // javascript syn...

  • Page 444

    444 chapter 12: methods 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 d...

  • Page 445

    Pause() (realmedia, swa, windows media) 445 pause() (3d) usage member(whichcastmember).Model(whichmodel).Bonesplayer.Pause() member(whichcastmember).Model(whichmodel).Keyframeplayer.Pause() description 3d #keyframeplayer and #bonesplayer modifier command; halts the motion currently being executed by...

  • Page 446

    446 chapter 12: methods // 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 vec...

  • Page 447

    Play() (3d) 447 example the first statement in this example assigns the value of the picture member property for the cast member shrine, which is a bitmap, to the variable picturevalue . The second statement checks whether shrine is a picture by checking the value assigned to picturevalue . -- lingo...

  • Page 448

    448 chapter 12: methods endtime optional. Measured in milliseconds from the beginning of the motion. When looped is false , the motion begins at offset and ends at endtime . When looped is true , the first iteration of the loop begins at offset and ends at endtime with all subsequent repetitions beg...

  • Page 449

    Play() (dvd) 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 starttimelist property. Playback continues until the value specified by the stoptimelist property, if set. With the begintitle , begincha...

  • Page 450

    450 chapter 12: methods 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() soun...

  • Page 451

    Play() (sound channel) 451 example this statement plays cast member intromusic in sound channel 1: -- lingo syntax sound(1).Play(member("intromusic")) // javascript syntax sound(1).Play(member("intromusic")); the following statement plays cast member creditsmusic in sound channel 2. Playback begins ...

  • Page 452

    452 chapter 12: methods 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 o...

  • Page 453

    Playfile() 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 m...

  • Page 454

    454 chapter 12: methods 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 ...

  • Page 455

    Playnext() (3d) 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(whi...

  • Page 456

    456 chapter 12: methods playerparentallevel() usage -- lingo syntax dvdobjref.Playerparentallevel() // javascript syntax dvdobjref.Playerparentallevel(); description dvd method; returns the parental level of the player. Possible parental levels range from 1 to 8. Parameters none. See also dvd point(...

  • Page 457

    Pointat 457 parameters inth required. An integer that specifies the horizontal coordinate of the point. Intv required. An integer that specifies the vertical coordinate of the point. Example this statement sets the variable lastlocation to the point (250, 400): -- lingo syntax lastlocation = point(2...

  • Page 458

    458 chapter 12: methods parameters vectorposition required. Specifies the world relative position. This value can also be a node reference. Vectorup optional. Specfies a world relative vector that hints at where the object’s up vector should point. If this parameter isn’t specified, then pointat def...

  • Page 459

    Pointtochar() 459 parameters point required. Specifies the point to test. See also cursor() , mouseloc pointtochar() usage -- lingo syntax spriteobjref.Pointtochar(pointtotranslate) // javascript syntax spriteobjref.Pointtochar(pointtotranslate); description function; returns an integer representing...

  • Page 460

    460 chapter 12: methods 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...

  • Page 461

    Pointtoline() 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 r...

  • Page 462

    462 chapter 12: methods 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...

  • Page 463

    Pointtoword() 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 c...

  • Page 464

    464 chapter 12: methods postnettext usage postnettext(url, propertylist {,serverosstring} {,servercharsetstring}) postnettext(url, posttext {,serverosstring} {,servercharsetstring}) description command; sends a post request to a url, which is an http url, with specified data. This command is similar...

  • Page 465

    Preload() (member) 465 example this statement omits the servercharsetstring parameter: netid = postnettext("www.Mydomain.Com\database.Cgi", "bill jones", "win") this example generates a form from user-entry fields for first and last name, along with a score. Both serverosstring and servercharsetstri...

  • Page 466

    466 chapter 12: methods example this statement reports in the message window whether the quicktime movie rotating chair can be preloaded into memory: -- lingo syntax put(member("rotating chair").Preload()) // javascript syntax put(member("rotating chair").Preload()); this startmovie handler sets up ...

  • Page 467

    Preloadbuffer() 467 parameters framenameornum optional. A string that specifies the specific frame to preload, or an integer that specifies the number of the specific frame to preload. Fromframenameornum required if preloading a range of frames. A string that specifies the name of the label of the f...

  • Page 468

    468 chapter 12: methods 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}) _m...

  • Page 469

    Preloadnetthing() 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 ...

  • Page 470

    470 chapter 12: methods the preloadnetthing() function does not parse a director file’s links. Thus, even if a director file is linked to casts and graphic files, preloadnetthing() downloads only the director file. You still must preload other linked objects separately. Parameters url required. Spec...

  • Page 471

    Prerotate 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 ...

  • Page 472

    472 chapter 12: methods the above is equivalent to: member("scene").Model("bip01").Rotate(20,20,20). Generally prerotate() is only useful when dealing with transform variables. This line will orbit the camera about the point (100, 0, 0) in space, around the y axis, by 180°. T = transform() t.Positio...

  • Page 473

    Pretranslate() 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 ) transf...

  • Page 474

    474 chapter 12: methods 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 spri...

  • Page 475

    Printfrom() 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 ...

  • Page 476

    476 chapter 12: methods 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, ...); descript...

  • Page 477

    Pttohotspotid() 477 proxyserver usage proxyserver servertype, "ipaddress", portnum proxyserver() description command; sets the values of an ftp or http proxy server. Without parameters, proxyserver() returns the settings of an ftp or http proxy server. Parameters servertype optional. A symbol that s...

  • Page 478

    478 chapter 12: methods 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 setti...

  • Page 479

    Puppetsprite() 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 cont...

  • Page 480

    480 chapter 12: methods 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 -- l...

  • Page 481

    Puppettransition() 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;...

  • Page 482

    482 chapter 12: methods transitions marked with an asterisk (*) do not work on monitors set to 32 bits. There is no direct relationship between a low time value and a fast transition. The actual speed of the transition depends on the relation of size and time . For example, if size is 1 pixel, the t...

  • Page 483

    Put() 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 p...

  • Page 484

    484 chapter 12: methods 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...

  • Page 485

    Queue() 485 once a sound has been queued, it can be played immediately with the play() method. This is because director preloads a certain amount of each sound that is queued, preventing any delay between the play() method and the start of playback. The default amount of sound that is preloaded is 1...

  • Page 486

    486 chapter 12: methods 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\ (mo...

  • Page 487

    Quit() 487 the following lingo adds the motion named kick to the end of the bonesplayer playlist of the model named walker. When all motions before kick in the playlist have been executed, a section of kick will play in a continuous loop. The first iteration of the loop will begin 2000 milliseconds ...

  • Page 488

    488 chapter 12: methods 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 // javas...

  • Page 489

    Random() 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("...

  • Page 490

    490 chapter 12: methods this handler randomly chooses which of two movie segments to play: -- lingo syntax on selectscene if (random(2) = 2) then _movie.Go("11a") else _movie.Go("11b") end if end // javascript syntax function selectscene() { if (random(2) == 1) { _movie.Go("11a"); } else { _movie.Go...

  • Page 491

    Rawnew() 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 + "" + vec2); ...

  • Page 492

    492 chapter 12: methods 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.Ne...

  • Page 493

    Readtoken() 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 o...

  • Page 494

    494 chapter 12: methods readword() usage -- lingo syntax fileioobjref.Readword() // javascript syntax fileioobjref.Readword(); description fileio method; reads the next word of a file and returns it as a string. You must first open a file by calling openfile() before using readword() to read a word....

  • Page 495

    Realplayerprompttoinstall() 495 example the following code shows that the realplayernativeaudio() function is set to false , which means that audio in the realmedia cast member will be processed by director: -- lingo syntax put(realplayernativeaudio()) -- 0 // javascript syntax trace(realplayernativ...

  • Page 496

    496 chapter 12: methods example the following code shows that the realplayerprompttoinstall() function is set to true , which means users who do not have realplayer will be prompted to install it: -- lingo syntax put(realplayerprompttoinstall()) -- 1 // javascript syntax -- lingo syntax trace(realpl...

  • Page 497

    Recordfont 497 to view the realplayer build number in windows: 1 launch realplayer. 2 choose about realplayer from the help menu. In the window that appears, the build number appears at the top of the screen in the second line. To view the realplayer build number on the macintosh: 1 launch realplaye...

  • Page 498

    498 chapter 12: methods face optional. Specifies a list of symbols indicating the face of the original font. Possible values are #plain , #bold , #italic . If you do not provide a value for this parameter, #plain is used. Bitmapsizes optional. Specifies a list of integers specifying the sizes for wh...

  • Page 499

    Rect() 499 var myrectwidth1 = myrect.Right - myrect.Left; // 50 var myrectwidth2 = myrect[3] - myrect[1]; // 50 to see an example of rect() used in a completed movie, see the imaging movie in the learning/ lingo folder inside the director application folder. Parameters intleft required. An integer t...

  • Page 500

    500 chapter 12: methods 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 cas...

  • Page 501

    Registerscript() 501 • duration is the total number of milliseconds that will elapse between the registerforevent call and the last #timems event. For example, if there are five iterations with a period of 500 ms, the duration is 2500 ms. For tasks with unlimited iterations, the duration is 0. • sys...

  • Page 502

    502 chapter 12: methods parameters eventname required. Specifies the name of the event. The event can be any of the following predefined events, or any custom event that you define: • #collideany is a collision event. • #collidewith is a collision event involving this specific model. The setcollisio...

  • Page 503

    Removefromworld 503 example this statement registers the messagereceived event handler found in a movie script to be called when the model named player receives the custom user defined event named #message : member("scene").Model("player").Registerscript(#message, \ #messagereceived, 0) this stateme...

  • Page 504

    504 chapter 12: methods 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).Keyf...

  • Page 505

    Removescriptedsprite() 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 index required. Specifies the index position of the over...

  • Page 506

    506 chapter 12: methods resetworld usage member(whichcastmember).Resetworld() member(whichtextcastmember).Resetworld() description 3d command; resets the member’s properties of the referenced 3d cast member to the values stored when the member was first loaded into memory. The member’s state propert...

  • Page 507

    Restart() 507 resolveb usage collisiondata.Resolveb(bresolve) description 3d collision method; overrides the collision behavior set by the collision.Resolve property for collisiondata.Modelb . Call this function only if you wish to override the behavior set for modelb using collision.Resolve. Parame...

  • Page 508

    508 chapter 12: methods 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 t...

  • Page 509

    Returntotitle() 509 in the following example, the two statements diceroll roll = the result are equivalent to this statement: set roll = diceroll() the statement set roll = diceroll would not call the handler because there are no parentheses following diceroll ; diceroll here is considered a variabl...

  • Page 510

    510 chapter 12: methods example this statement resumes playback after a menu has been displayed: -- lingo syntax member(1).Returntotitle() // javascript syntax member(1).Returntotitle(); see also dvd reverttoworlddefaults usage member(whichcastmember).Reverttoworlddefaults() description 3d command; ...

  • Page 511

    Rewind() (animated gif, flash) 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) u...

  • Page 512

    512 chapter 12: methods 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 o...

  • Page 513

    Rootmenu() 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)) { membe...

  • Page 514

    514 chapter 12: methods parameters none. Example this statement displays the root menu: -- lingo syntax member(1).Rootmenu() // javascript syntax member(1).Rootmenu(); see also dvd rotate usage member(whichcastmember).Node(whichnode).Rotate(xangle, yangle, \ zangle {, relativeto}) member(whichcastme...

  • Page 515

    Runmode 515 angle required if applying a rotation about an arbitrary axis passing through a point in space. Specifies the amount of rotation about the axis axis . Relativeto optional. Specifies which coordinate system axes are used to apply the desired rotational changes. The relativeto parameter ca...

  • Page 516

    516 chapter 12: methods 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...

  • Page 517

    Scale (command) 517 savemovie() usage -- lingo syntax _movie.Savemovie({stringfilepath}) // javascript syntax _movie.Savemovie({stringfilepath}); description movie method; saves the current movie. Including the optional stringfilepath parameter saves the movie to the file specified. This method does...

  • Page 518

    518 chapter 12: methods parameters xscale required if specifying three scalings. Specifies the scale along the x -axis. Yscale required if specifying three scalings. Specifies the scale along the y -axis. Zscale required if specifying three scalings. Specifies the scale along the z -axis. Uniformsca...

  • Page 519

    Scrollbyline() 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 actionmember to the script cast membe...

  • Page 520

    520 chapter 12: methods 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 line...

  • Page 521

    Selectatloc() 521 if the seek command is called when mediastatus is #paused , the stream rebuffers and returns to #paused at the new location specified by seek . If seek is called when mediastatus is #playing , the stream rebuffers and automatically begins playing at the new location in the stream. ...

  • Page 522

    522 chapter 12: methods example this statement moves focus to the button under a specified point: -- lingo syntax member(10).Selectatloc(point(50, 75)) // javascript syntax member(10).Selectatloc(point(50, 75)); see also dvd selectbutton() usage -- lingo syntax dvdobjref.Selectbutton(intbutton) // j...

  • Page 523

    Sendallsprites() 523 parameters direction required. A symbol (lingo) or a string (javascript syntax) that specifies the direction to move from the current button position. Valid values are left or right . Example this statement specifies the button to the left of the current button: -- lingo syntax ...

  • Page 524

    524 chapter 12: methods for best results, send the message only to those sprites that will properly handle the message through the sendsprite() method. No error will occur if the message is sent to all the sprites, but performance may decrease. There may also be problems if different sprites have th...

  • Page 525

    Sendsprite() 525 example the first line in this example creates an instance of a parent script named "tester" . The second line sets the handler of the script instance, jumppluto, as the handler to be called when the #jump event is sent. The third line registers a movie script handler named jumpmars...

  • Page 526

    526 chapter 12: methods see also movie setalpha() usage imageobject.Setalpha(alphalevel) imageobject.Setalpha(alphaimageobject) description function; sets the alpha channel of an image object to a flat alphalevel or to an existing alphaimageobject . The alphalevel must be a number from 0–255. Lower ...

  • Page 527

    Setat 527 • the setaprop command can also set ancestor properties. Parameters listproperty required. A symbol (lingo only) or a string that specifies the name of the property whose value is changing. Newvalue required. The new value for the listproperty property. Example these statements create a pr...

  • Page 528

    528 chapter 12: methods 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 en...

  • Page 529

    Setcollisioncallback() 529 example this statement sets a the lingo handler named myonstatus in the lingo script object me to be called when an onstatus event is generated by the actionscript object tlocalconobject in the flash movie in sprite 3: -- lingo syntax sprite(3).Setcallback(tlocalconobject,...

  • Page 530

    530 chapter 12: methods this command is a shorter alternative to using the registerscript command for collisions, but there is no difference in the overall result. This command can be considered to perform a small subset of the registerscript command functionality. Parameters handlername required. S...

  • Page 531

    Setflashproperty() 531 parameters stringattrs required. A string that specifies the finder information. See also fileio setflashproperty() usage -- lingo syntax spriteobjref.Setflashproperty(targetname, #property, newvalue) // javascript syntax spriteobjref.Setflashproperty(targetname, #property, ne...

  • Page 532

    532 chapter 12: methods 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. Pa...

  • Page 533

    Setplaylist() 533 colorobjorintvalue required if setting the color to a color object or an integer value. A reference to a color object that specifies the color of the pixel, or an integer that specifies the color value of the pixel. Example this lingo statement draws a horizontal black line 50 pixe...

  • Page 534

    534 chapter 12: methods 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("i...

  • Page 535

    Setprop 535 after setpref() runs, if the movie is playing in a browser, a folder named prefs is created in the plug-in support folder. The setpref() method can write only to that folder. If the movie is playing in a projector or director, a folder is created in the same folder as the application. Th...

  • Page 536

    536 chapter 12: methods this command is similar to the setaprop command, except that setprop returns an error when the property is not already in the list. Parameters property required. A symbol (lingo only) or a string that specifies the property whose value is replaced by newvalue . Newvalue requi...

  • Page 537

    Setpref() 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 di...

  • Page 538

    538 chapter 12: methods 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 encoun...

  • Page 539

    Setvariable() 539 trueorfalse required. Specifies whether the track in the digital video is enabled ( true ) or not ( false ). Example this statement enables track 3 of the digital video assigned to sprite channel 8: -- lingo syntax sprite(8).Settrackenabled(3, true) // javascript syntax sprite(8).S...

  • Page 540

    540 chapter 12: methods 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 pr...

  • Page 541

    Showprops() 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 wi...

  • Page 542

    (casttype = "vectorshape")) { trace (casttype + " cast member " + i + ": " + member(i, whichcast).Name) + ; member(i ,whichcas...

  • Page 543

    Sin() 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 (mac...

  • Page 544

    544 chapter 12: methods 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 maint...

  • Page 545

    Spritespacetoworldspace 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 scriptexecutionstyle property is set to a v...

  • Page 546

    546 chapter 12: methods parameters loc required. Specifies the location in the referenced sprite. This location should be a point relative to the sprite’s upper-left corner. Example this statement shows that the point (50, 50) within sprite 5 is equivalent to the vector (-1993.6699, 52.0773, 2263.74...

  • Page 547

    Stageleft 547 stagebottom usage the stagebottom description function; along with stageleft , stageright , and stagetop , indicates where the stage is positioned on the desktop. It returns the bottom vertical coordinate of the stage relative to the upper left corner of the main screen. The height of ...

  • Page 548

    548 chapter 12: methods example this statement checks whether the left edge of the stage is beyond the left edge of the screen and calls the handler leftmonitorprocedure if it is: if the stageleft see also stagebottom , stageright , stagetop , loch , locv stageright usage the stageright description ...

  • Page 549

    Stagetop 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 originpoint property is not used to calculate movie coordi...

  • Page 550

    550 chapter 12: methods parameters none. Example this statement checks whether the top of the stage is beyond the top of the screen and calls the handler uppermonitorprocedure if it is: if the stagetop see also stageleft , stageright , stagebottom , loch , locv status() usage -- lingo syntax fileioo...

  • Page 551

    Stop() (sound channel) 551 example this statement stops playback: -- lingo syntax member(1).Stop() // javascript syntax member(1).Stop(); see also dvd stop() (sound channel) usage -- lingo syntax soundchannelobjref.Stop() // javascript syntax soundchannelobjref.Stop(); description sound channel meth...

  • Page 552

    552 chapter 12: methods 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 c...

  • Page 553

    Stopevent() 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.Stopeve...

  • Page 554

    554 chapter 12: methods // 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...

  • Page 555

    String() 555 -- lingo syntax on exitframe if member(10).Percentstreamed bytesreceived = member(10).Stream(32000) if bytesreceived member("message line").Text = "received only" && bytesreceived \ && "of 32,000 bytes requested." _movie.Updatestage() else member("message line").Text = "received all 32,...

  • Page 556

    556 chapter 12: methods stringp() usage stringp(expression) description function; determines whether an expression is a string ( true ) or not ( false ). The p in stringp stands for predicate. Parameters expression required. The expression to test. Example this statement checks whether 3 is a string...

  • Page 557

    Substitutefont 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 dvd substitutefont usage textmemberref.Substitutefont(originalfont, newfont) substitutefont(textm...

  • Page 558

    558 chapter 12: methods 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 v...

  • Page 559

    Symbolp() 559 symbol() usage -- lingo syntax symbol(stringvalue) // javascript syntax symbol(stringvalue); description top level function; takes a string and returns a symbol. Parameters stringvalue required. The string to convert to a symbol. Example this statement displays the symbol #hello : --li...

  • Page 560

    560 chapter 12: methods example this statement checks whether the variable myvariable is a symbol: put myvariable.Symbolp see also ilk() tan() usage tan(angle) description math function; yields the tangent of the specified angle expressed in radians as a floating-point number. In javascript syntax, ...

  • Page 561

    Telltarget() 561 example this on preparemovie handler turns the on streamstatus handler on when the movie starts: -- lingo syntax on preparemovie tellstreamstatus(true) end // javascript syntax function preparemovie() { tellstreamstatus(true); } this statement determines the status of the stream sta...

  • Page 562

    562 chapter 12: methods 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(); t...

  • Page 563

    Texture() 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(whichcas...

  • Page 564

    564 chapter 12: methods 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 out...

  • Page 565

    Top (3d) 565 example this handler deletes the timeout object named random lightning: -- lingo syntax on exitframe timeout("random lightning").Forget() end // javascript syntax function exitframe() { timeout("random lightning").Forget(); } see also new() , timeoutlist , timeouthandler , time (timeout...

  • Page 566

    566 chapter 12: methods parameters none. Example this statement sets the top property of the model resource gift box to false , meaning the top of this box will be open: member("3d world").Modelresource("gift box").Top = false see also back , bottom (3d) , front topcap usage modelresourceobjectrefer...

  • Page 567

    Transform (command) 567 example the following statement sets the topradius property of the model resource tube to 0.0. If the bottom radius has a value greater than 0, models using tube will be conical. Member("3d world").Modelresource("tube").Topradius = 0.0 trace() usage -- lingo syntax trace(valu...

  • Page 568

    568 chapter 12: methods 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(which...

  • Page 569

    Union() 569 • #world applies the increments relative to the world coordinate system. If a model’s parent is the world, than this is equivalent to using #parent . • nodereference allows you to specify a node to base your translation upon, the command applies the translations relative to the coordinat...

  • Page 570

    570 chapter 12: methods 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 recen...

  • Page 571

    Unloadmember() 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 ...

  • Page 572

    572 chapter 12: methods • when used with one argument, memberobjref , the unloadmember() method clears from memory the cast members in that frame. • when used with two arguments, frommembernameornum and tomembernameornum , the unloadmember() method unloads all cast members in the range specified. Yo...

  • Page 573

    Unregisterallevents 573 parameters stringmoviename required. A string that specifies the name of the movie to unload from memory. Example this statement checks whether the largest contiguous block of free memory is less than 100k and unloads the movie parsifal if it is: -- lingo syntax if (_system.F...

  • Page 574

    574 chapter 12: methods 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 positi...

  • Page 575

    Updatestage() 575 // javascript syntax function animball(numberofframes) { _movie.Beginrecording(); var horizontal = 0; var vertical = 100; for (var i = 1; i _movie.Go(1); sprite(20).Member = member("ball"); sprite(20).Loch = horizontal; sprite(20).Locv = vertical; sprite(20).Forecolor = 255; horizo...

  • Page 576

    576 chapter 12: methods urlencode usage urlencode(proplist_or_string {, serverosstring} {, characterset}) description function; returns the url-encoded string for its first argument. Allows cgi parameters to be used in other commands. The same translation is done as for postnettext and getnettext() ...

  • Page 577

    Value() 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. The result is the value of the initial port...

  • Page 578

    578 chapter 12: methods 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 refer...

  • Page 579

    Voiceget() 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() and voiceget() to specify a particula...

  • Page 580

    580 chapter 12: methods example this statement sets the variable oldvoice to the property list describing the current text-to- speech voice: oldvoice = voiceget() this statement displays the property list of the current text-to-speech voice: put voiceget() -- [#name: "mary", #age: "teen", #gender: "...

  • Page 581

    Voicegetrate() 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 pi...

  • Page 582

    582 chapter 12: methods see also voicespeak() , voicepause() , voiceresume() , voicestop() , voicesetrate() , voicegetpitch() , voicesetpitch() , voicegetvolume() , voicesetvolume() , voicestate() , voicewordpos() voicegetvolume() usage voicegetvolume() description function: returns the current volu...

  • Page 583

    Voicepause() 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 voicespeak() command to speak the phrase “welcome to shockwave.”: -- lingo syntax err = voiceinitialize() if err = 1 then vo...

  • Page 584

    584 chapter 12: methods 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 n...

  • Page 585

    Voicesetrate() 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 integer required. An integer that specifies the pitch f...

  • Page 586

    586 chapter 12: methods voicesetvolume() usage voicesetvolume(integer) description command; sets the volume of the text-to-speech synthesis. Parameters integer required. An integer that specifies the volume of text-to-speech synthesis. The range of valid values depends on the operating system platfo...

  • Page 587

    Voicestop() 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 #playing , #paused , and #stopped . Parameters none. Example these stateme...

  • Page 588

    588 chapter 12: methods 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() , voicegetra...

  • Page 589

    Window() 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 is void , this function returns true . If the variable has a value other than void , t...

  • Page 590

    590 chapter 12: methods example this statement sets the variable mywindow to the window named collections: -- lingo syntax mywindow = window("collections") // javascript syntax var mywindow = window("collections"); see also window windowpresent() usage -- lingo syntax _player.Windowpresent(stringwin...

  • Page 591

    Writechar() 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 re...

  • Page 592

    592 chapter 12: methods 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) //...

  • Page 593

    Zoombox 593 parameters xtranameornum required. A string that specifies the name of the xtra to return, or an integer that specifies the index position of the xtra to return. String names are not case sensitive. Example this statement sets the variable mynetlingo to the netlingo xtra extension: -- li...

  • Page 594

    594 chapter 12: methods.

  • Page 595: Chapter 13

    595 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 her...

  • Page 596

    596 chapter 13: operators • 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) 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 expressi...

  • Page 598

    598 chapter 13: operators -- (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...

  • Page 599

    &&, + (concatenation operator) 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 c...

  • Page 600

    600 chapter 13: operators 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) // javas...

  • Page 601

    * (multiplication) 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; performs an arithmetic multip...

  • Page 602

    602 chapter 13: operators + (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 express...

  • Page 603

    * (multiplication) 603 - (subtraction) usage -- lingo syntax vector1 - vector2 vector - scalar // javascript syntax vector1 - vector2 vector - scalar description 3d vector operator; subtracts the components of vector2 from the corresponding components of vector1 , or subtracts the scalar value from ...

  • Page 604

    604 chapter 13: operators / (division) usage -- lingo syntax expression1 / expression2 // javascript syntax expression1 / expression2 description math operator; performs an arithmetic division on two numerical expressions, dividing expression1 by expression2 . If both expressions are integers, the q...

  • Page 605

    (not equal) 605 usage -- lingo syntax expression1 expression2 // javascript syntax expression1 expression2 description comparison operator; compares two expressions and determines whether expression1 is less than expression2 ( true ), or whether expression1 is greater than or equal to expression2 ( ...

  • Page 606

    606 chapter 13: operators 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 lis...

  • Page 607

    [ ] (list) 607 >= (greater than or equal to) usage -- lingo syntax expression1 >= expression2 // javascript syntax expression1 >= expression2 description comparison operator; compares two expressions and determines whether expression1 is greater than or equal to expression2 ( true ), or whether expr...

  • Page 608

    608 chapter 13: operators 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 ...

  • Page 609

    @ (pathname) 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 sortlist machine...

  • Page 610

    610 chapter 13: operators 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 thi...

  • Page 611

    Contains 611 and usage -- lingo syntax logicalexpression1 and logicalexpression2 // javascript syntax logicalexpression1 && logicalexpression2 description logical operator; determines whether both logicalexpression1 and logicalexpression2 are true (1), or whether either or both expressions are false...

  • Page 612

    612 chapter 13: operators the contains comparison operator is useful for checking whether the user types a specific character or string of characters. You can also use the contains operator to search one or more fields for specific strings of characters. Example this example determines whether a cha...

  • Page 613

    Mod 613 // javascript syntax put(7 % 4); the result is 3. The following handler sets the ink effect of all odd-numbered sprites to copy , which is the ink effect specified by the number 0. First the handler checks whether the sprite in the variable mysprite is an odd-numbered sprite by dividing the ...

  • Page 614

    614 chapter 13: operators not usage -- lingo syntax not logicalexpression // javascript syntax ! Logicalexpression description operator; performs a logical negation on a logical expression. This is the equivalent of making a true value false , and making a false value true . It is useful when testin...

  • Page 615

    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 wit...

  • Page 616

    616 chapter 13: operators starts usage -- lingo syntax string1 starts string2 // javascript syntax string1.Indexof(string2) == 0; description operator; compares to determines whether string1 starts with string2 ( true or 1) or not ( false or 0). The string comparison is not sensitive to case or diac...

  • Page 617: Chapter 14

    _key 617 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 gl...

  • Page 618

    618 chapter 14: properties description top-level property; provides a reference to the key object, which is used to monitor a user’s keyboard activity. Read-only. Example this statement sets the variable objkey to the _key property: -- lingo syntax objkey = _key // javascript syntax var objkey = _ke...

  • Page 619

    _movie 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 le...

  • Page 620

    620 chapter 14: properties _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 o...

  • Page 621

    Aboutinfo 621 this statement uses the _sound property directly to access the soundlevel property: -- lingo syntax thelevel = _sound.Soundlevel // javascript syntax var thelevel = _sound.Soundlevel; see also sound _system usage -- lingo syntax _system // javascript syntax _system; description top-lev...

  • Page 622

    622 chapter 14: properties example these statements display movie information in the message window. -- lingo syntax trace(_movie.Aboutinfo) // javascript syntax trace(_movie.Aboutinfo); see also copyrightinfo (movie) , movie actionsenabled usage -- lingo syntax memberorspriteobjref.Actionsenabled /...

  • Page 623

    Activecastlib 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 getrendererservices().Renderer pr...

  • Page 624

    624 chapter 14: properties 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 castlibo...

  • Page 625

    Actorlist 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 actorlist receive a stepframe message each time the playh...

  • Page 626

    626 chapter 14: properties alerthook usage -- lingo syntax _player.Alerthook // javascript syntax _player.Alerthook; description player property; specifies a parent script that contains the alerthook handler. Read/write. Use alerthook to control the display of alerts about file errors or script erro...

  • Page 627

    Alignment 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 memberobj...

  • Page 628

    628 chapter 14: properties allowcustomcaching usage -- lingo syntax _movie.Allowcustomcaching // javascript syntax _movie.Allowcustomcaching; description movie property; will contain information regarding a private cache in future versions of director. Read/write. This property defaults to true . Se...

  • Page 629

    Allowvolumecontrol 629 this property defaults to true . See also allowcustomcaching , allowgraphicmenu , allowtransportcontrol , allowvolumecontrol , allowzooming , movie allowtransportcontrol usage -- lingo syntax _movie.Allowtransportcontrol // javascript syntax _movie.Allowtransportcontrol; descr...

  • Page 630

    630 chapter 14: properties 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 pro...

  • Page 631

    Ancestor 631 for example, if the color of the ambient light is rgb(255, 255, 255) and the value of the ambient property of the shader is rgb(255, 0, 0) , the shader will reflect all of the red component of the light that the shader’s colors can reflect. However, it will reflect none of the blue and ...

  • Page 632

    632 chapter 14: properties for child objects, the ancestor property is usually assigned in the on new handler within the parent script. Sending a message to a child object that does not have a defined handler forwards that message to the script defined by the ancestor property. If a behavior has an ...

  • Page 633

    Angle (dvd) 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 direct...

  • Page 634

    634 chapter 14: properties 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 th...

  • Page 635

    Antialiasingenabled 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. The antialias property is true by default. For vector shapes, true is th...

  • Page 636

    636 chapter 14: properties example this lingo checks whether the currently running 3d renderer for sprite 2 supports anti-aliasing with the antialiasingsupported property. If anti-aliasing is supported, the second statement turns on anti-aliasing for the sprite with the antialiasingenabled property....

  • Page 637

    Appearanceoptions 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 fol...

  • Page 638

    638 chapter 14: properties 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 ...

  • Page 639

    Attenuation 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): -- l...

  • Page 640

    640 chapter 14: properties the default value for this property is vector(1.0, 0.0, 0.0). Example this statement sets the attenuation property of the light named houselight to the vector (.5, 0, 0), darkening it slightly. Member("3d world").Light("houselight").Attenuation = \ vector(.5, 0, 0) see als...

  • Page 641

    Audio (realmedia) 641 here is some text this lingo returns the value of the first attribute of the tag called tagname : put gparserobject.Child[1].Child[1].Attributevalue[1] -- "val1" see also attributename audio (dvd) usage -- lingo syntax dvdobjref.Audio // javascript syntax dvdobjref.Audio; descr...

  • Page 642

    642 chapter 14: properties example the following examples show that the audio properties for sprite 2 and the cast member real is set to true , which means that the audio portion of the realmedia stream will be played. -- lingo syntax put(sprite(2).Audio) -- 1 put(member("real").Audio) -- 1 // javas...

  • Page 643

    Audioextension 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).A...

  • Page 644

    644 chapter 14: properties 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: see also dvd aud...

  • Page 645

    Auto 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 dvd audiostreamcount usage -- lingo syntax dvdobjref.Audiostreamcount...

  • Page 646

    646 chapter 14: properties example this statement sets the auto property of the lod modifier of the model named spaceship to true . The modifier will automatically set the model’s level of detail. Member("3d world").Model("spaceship").Lod.Auto = true see also lod (modifier) , bias , level autoblend ...

  • Page 647

    Automask 647 example this statement sets the autocameraposition property of the cast member named headline to false . When the cast member is displayed in 3d mode, the camera will not be positioned automatically. Member("headline").Autocameraposition = false see also displaymode automask usage membe...

  • Page 648

    648 chapter 14: properties autotab usage -- lingo syntax memberobjref.Autotab // javascript syntax memberobjref.Autotab; description cast member property; determines the effect that pressing the tab key has on the editable field or text cast member specified by whichcastmember . The property can be ...

  • Page 649

    Backcolor 649 back usage member(whichcastmember).Modelresource(whichmodelresource).Back description 3d #box model resource property; indicates whether the side of the box intersected by its +z axis is sealed ( true ) or open ( false ). The default value for this property is true . Example this state...

  • Page 650

    650 chapter 14: properties example the following statement sets the variable oldcolor to the background color of sprite 5: -- lingo syntax oldcolor = sprite(5).Backcolor // javascript syntax var oldcolor = sprite(5).Backcolor; the following statement randomly changes the background color of a random...

  • Page 651

    Beepon 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. ...

  • Page 652

    652 chapter 14: properties description movie property; determines whether the computer automatically beeps when the user clicks on anything except an active sprite ( true ), or not ( false , default). Read/write. Scripts that set beepon should be placed in frame or movie scripts. Example this statem...

  • Page 653

    Bgcolor (window) 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,...

  • Page 654

    654 chapter 14: properties // 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 descr...

  • Page 655

    Bitrate 655 the #lod modifier can only be added to models created outside of director in 3d modeling programs. The value of the type property of the model resources used by these models is #fromfile . The modifier cannot be added to primitives created within director. Example this statement sets the...

  • Page 656

    656 chapter 14: properties example this behavior outputs the bit rate of an swa cast member when the sprite is first encountered. -- lingo syntax property spritenum on beginsprite (me) memname = sprite(spritenum).Member.Name put("the bitrate of member"&&memname&&"is"&&member(memname).Bitrate) end //...

  • Page 657

    Blend (sprite) 657 description 3d backdrop, overlay, and #standard shader property; indicates the opacity of the backdrop, overlay, or shader. Setting the blend property of a shader will have no effect unless the shader’s transparent property is set to true . The range of this property is 0 to 100, ...

  • Page 658

    658 chapter 14: properties blendconstant usage member(whichcastmember).Shader(whichshader).Blendconstant member(whichcastmember).Model(whichmodel).Shader.Blendconstant member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ blendconstant description 3d #standard shader property; indicates th...

  • Page 659

    Blendfactor 659 the blendconstantlist property works only when the blendsource property of the corresponding texture layer is set to #constant . The range of this property is 0 to 100; the default is 50. Example in this example, the shader list of the model named mysterybox contains six shaders. Thi...

  • Page 660

    660 chapter 14: properties blendfunction usage member(whichcastmember).Shader(whichshader).Blendfunction member(whichcastmember).Model(whichmodel).Shader.Blendfunction member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ blendfunction description 3d #standard shader property; indicates th...

  • Page 661

    Blendfunctionlist 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 ...

  • Page 662

    662 chapter 14: properties 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 in...

  • Page 663

    Blendsourcelist 663 blendsource usage member(whichcastmember).Shader(whichshader).Blendsource member(whichcastmember).Model(whichmodel).Shader.Blendsource member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ blendsource description 3d #standard shader property; indicates whether blending ...

  • Page 664

    664 chapter 14: properties description 3d #standard shader property; indicates whether blending of a texture layer with the texture layers below it is based on the texture’s alpha information or a constant ratio. The shader’s texture list and the blend source list both have eight index positions. Ea...

  • Page 665

    Bonesplayer (modifier) 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 membe...

  • Page 666

    666 chapter 14: properties playrate (3d) is a number that is multiplied by the scale parameter of the play() or queue() command to determine the playback speed of the motion. Playlist. Count (3d) returns the number of motions currently queued in the playlist. Rootlock indicates whether the translati...

  • Page 667

    Bottom 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 tit...

  • Page 668

    668 chapter 14: properties bottom (3d) usage member(whichcastmember).Modelresource(whichmodelresource).Bottom description 3d #box model resource property; indicates whether the side of the box intersected by its -y axis is sealed ( true ) or open ( false ). The default value for this property is tru...

  • Page 669

    Boundary 669 example this statement sets the bottomradius property of the model resource named tube to 38.5. Member("3d world").Modelresource("tube").Bottomradius = 38.5 see also topradius , bottomcap bottomspacing usage -- lingo syntax chunkexpression.Bottomspacing // javascript syntax chunkexpress...

  • Page 670

    670 chapter 14: properties example this statement sets the boundary property of the inker modifier applied to the model named box to true . Lines will be drawn at the edges of the surface of the model. Member("shapes").Model("box").Inker.Boundary = true see also linecolor , lineoffset , silhouettes ...

  • Page 671

    Brightness 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.Boxty...

  • Page 672

    672 chapter 14: properties 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 current...

  • Page 673

    Buttonsenabled 673 example this startmovie handler sets up a flash movie cast member for streaming and then sets its buffersize property. -- lingo syntax on startmovie member.("flash demo").Preload = false member.("flash demo").Buffersize = 65536 end // javascript syntax function startmovie() { memb...

  • Page 674

    674 chapter 14: properties example this handler accepts a sprite reference and toggles the sprite’s buttonsenabled property on or off. -- lingo syntax on togglebuttons(whichsprite) sprite(whichsprite).Buttonsenabled = \ not(sprite(whichsprite).Buttonsenabled) end // javascript syntax function toggle...

  • Page 675

    Bytesstreamed 675 this statement remembers the current setting of the buttonstyle property by putting the current buttonstyle value in the variable buttonstylevalue : -- lingo syntax buttonstylevalue = _movie.Buttonstyle // javascript syntax var buttonstylevalue = _movie.Buttonstyle; see also movie ...

  • Page 676

    676 chapter 14: properties -- lingo syntax on fetchmovie(whichflashmovie) repeat while member(whichflashmovie).Percentstreamed stream(member(whichflashmovie)) put("number of bytes streamed:" && member(whichflashmovie).Bytesstreamed) end repeat end // javascript syntax function fetchmovie(whichflashm...

  • Page 677

    Cameraposition 677 cameras are stored in the camera palette of the cast member. Use the newcamera and deletecamera commands to create and delete cameras in a 3d cast member. The camera property of a sprite is the first camera in the list of cameras of the sprite. The camera referred to by sprite(whi...

  • Page 678

    678 chapter 14: properties 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 d...

  • Page 679

    Castmemberlist 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...

  • Page 680

    680 chapter 14: properties 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...

  • Page 681

    Centerstage 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 ( true, defa...

  • Page 682

    682 chapter 14: properties 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...

  • Page 683

    Chapter 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 us...

  • Page 684

    684 chapter 14: properties see also dvd.

  • Page 685

    Characterset 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 synta...

  • Page 686

    686 chapter 14: properties charspacing usage -- lingo syntax chunkexpression.Charspacing // javascript syntax chunkexpression.Charspacing; description text cast member property; enables specifying any additional spacing applied to each letter in the chunkexpression portion of the text cast member. A...

  • Page 687

    Child (xml) 687 example this handler turns off any items that are checked in the custom menu specified by the argument themenu . For example, uncheck ("format") turns off all the items in the format menu. On uncheck themenu set n = the number of menuitems of menu themenu repeat with i = 1 to n set t...

  • Page 688

    688 chapter 14: properties example beginning with the following xml: element 2 element 3 here is some text this lingo returns the name of the first child node of the preceding xml: put gparserobject.Child[1].Name -- "e1" chunksize usage member(whichcastmember).Chunksize the chunksize of member which...

  • Page 689

    Clickloc 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).Colorbuf...

  • Page 690

    690 chapter 14: properties // javascript syntax function mousedown() { put(_mouse.Clickloc); } if the click were 50 pixels from the left end of the stage and 100 pixels from the top of the stage, the message window would display the following: point(50, 100) see also clickon , mouse clickmode usage ...

  • Page 691

    Clickon 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 clickmode is set to #opaque . Otherwise (because ink effects are ...

  • Page 692

    692 chapter 14: properties 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 set...

  • Page 693

    Collision (modifier) 693 example these statements try to set closedcaptions to true, and display an alert if they cannot be enabled: -- lingo syntax member(3).Closedcaptions = true if (member(3).Closedcaptions = false) then _player.Alert("closed captions cannot be enabled.") end if // javascript syn...

  • Page 694

    694 chapter 14: properties collisiondata usage on myhandlername me, collisiondata description 3d data object; sent as an argument with the #collidewith and #collideany events to the handler specified in the registerforevent , registerscript , and setcollisioncallback commands. The collisiondata obje...

  • Page 695

    Collisionnormal 695 collisionnormal usage collisiondata.Collisionnormal description 3d collisiondata property; a vector indicating the direction of the collision. The collisiondata object is sent as an argument with the #collidewith and #collideany events to the handler specified in the registerfore...

  • Page 696

    696 chapter 14: properties 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-b...

  • Page 697

    Color (light) 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 colo...

  • Page 698

    698 chapter 14: properties see also fog colorbufferdepth usage getrendererservices().Colorbufferdepth description 3d rendererservices property; indicates the color precision of the hardware output buffer of the user’s system. The value is either 16 or 32, depending on the user’s hardware settings. T...

  • Page 699

    Colordepth 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 colordepth property refers to the monitor displaying the stage. If the stage spans more than one monitor, the colo...

  • Page 700

    700 chapter 14: properties colorlist usage member(whichcastmember).Modelresource(whichmodelresource).\ colorlist member(whichcastmember).Modelresource(whichmodelresource).\ colorlist[index] member(whichcastmember).Model(whichmodel).Meshdeform.Mesh\ [meshindex].Colorlist member(whichcastmember).Model...

  • Page 701

    Colors 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 d...

  • Page 702

    702 chapter 14: properties see also face , vertices , vertices , flat.

  • Page 703

    Commanddown 703 colorsteps usage member(whichcastmember).Model(whichmodel).Toon.Colorsteps member(whichcastmember).Model(whichmodel).Shader.Colorsteps member(whichcastmember).Shader(whichshader).Colorsteps description 3d toon modifier and painter shader property; the maximum number of colors availab...

  • Page 704

    704 chapter 14: properties example these statements pause a projector when the playhead enters a frame and the user is pressing control+a (windows) or command+a (macintosh). -- lingo syntax on enterframe if (_key.Commanddown and _key.Key = "a") then _movie.Go(_movie.Frame) end if end // javascript s...

  • Page 705

    Constraint 705 compressed usage member(whichcastmember).Texture(whichtexture).Compressed description 3d texture property; indicates whether the source cast member of the texture is compressed ( true ) or not ( false ). The value of the compressed property changes automatically from true to false whe...

  • Page 706

    706 chapter 14: properties example this statement removes a constraint sprite property: -- lingo syntax sprite(5).Constraint = 0 // javascript syntax sprite(5).Constraint = 0; this statement constrains sprite (i + 1) to the boundary of sprite 14: -- lingo syntax sprite(i + 1).Constraint = 14 // java...

  • Page 707

    Controller 707 example this on keydown handler checks whether the pressed key is the control key, and if it is, the handler activates the on docontrolkey handler. The argument (_key.Key) identifies which key was pressed in addition to the control key. -- lingo syntax on keydown if (_key.Controldown)...

  • Page 708

    708 chapter 14: properties 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.Copyrightinf...

  • Page 709

    Count 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 put(member("info display") = member("swafile").Copyr...

  • Page 710

    710 chapter 14: properties 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 mem...

  • Page 711

    Creaseangle 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].\ texture...

  • Page 712

    712 chapter 14: properties the creases property of the modifier must be set to true for the creaseangle property to have an effect. Creaseangle has a range of -1.0 to +1.0. The default setting is 0.01. Example this statement sets the creaseangle property of the inker modifier applied to the model na...

  • Page 713

    Cuepointnames 713 example although you typically inspect the creationdate property using the property inspector or the cast window list view, you can check it in the message window: -- lingo syntax put(member(1).Creationdate) // javascript syntax put(member(1).Creationdate); see also member crop usa...

  • Page 714

    714 chapter 14: properties 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...

  • Page 715

    Currentspritenum 715 currentloopstate usage member(whichcastmember).Model(whichmodel).Keyframeplayer.\ currentloopstate member(whichcastmember).Model(whichmodel).Bonesplayer.\ currentloopstate description 3d keyframeplayer and bonesplayer modifier property; indicates whether the motion being execute...

  • Page 716

    716 chapter 14: properties example the following handler in a cast member or movie script switches the cast member assigned to the sprite involved in the mousedown event: -- lingo syntax on mousedown sprite(_player.Currentspritenum).Member = member("downpict") end // javascript syntax function mouse...

  • Page 717

    Currenttime (quicktime, avi) 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...

  • Page 718

    718 chapter 14: properties // 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 dura...

  • Page 719

    Currenttime (sprite) 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) us...

  • Page 720

    720 chapter 14: properties 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....

  • Page 721

    Cursor 721 258 select 259 bucket 260 hand 261 rectangle tool 262 rounded rectangle tool 263 circle tool 264 line tool 265 rich text tool 266 text field tool 267 button tool 268 check box tool 269 radio button tool 270 placement tool 271 registration point tool 272 lasso 280 finger 281 dropper 282 wa...

  • Page 722

    722 chapter 14: properties to use custom cursors, set the cursor property to a list containing the cast member to be used as a cursor or to the number that specifies a system cursor. In windows, a cursor must be a cast member, not a resource; if a cursor is not available because it is a resource, di...

  • Page 723

    Curve 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 . Bitmap cast members smaller than the specified size are displa...

  • Page 724

    724 chapter 14: properties 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...

  • Page 725

    Decaymode 725 debugplaybackenabled usage -- lingo syntax _player.Debugplaybackenabled // javascript syntax _player.Debugplaybackenabled; description player property; in windows, opens a message window for debugging purposes in shockwave and projectors. On the macintosh, a log file is generated to al...

  • Page 726

    726 chapter 14: properties example this statement sets the decaymode property of the fog of the camera defaultview to #linear . If the fog’s enabled property is set to true , the density of the fog will steadily increase between the distances set by the fog’s near and far properties. If the near pro...

  • Page 727

    Defaultrectmode 727 // javascript syntax function setdefaultflashrect(whichcast, whichrect) { var i = 1; while( i var tp = member(i, whichcast).Type; if (tp = "flash") { member(i, whichcast).Defaultrect = whichrect; i++; } } } see also defaultrectmode , flashrect defaultrectmode usage -- lingo synta...

  • Page 728

    728 chapter 14: properties -- lingo syntax on setdefaultrectsize(whichcast) repeat with i = 1 to castlib(whichcast).Member.Count if member(i, whichcast).Type = #flash then member(i, whichcast).Defaultrectmode = #fixed member(i, whichcast).Defaultrect = rect(0,0,320,240) end if end repeat end // java...

  • Page 729

    Depth (bitmap) 729 depth (3d) usage member(whichcastmember).Model(whichmodel).Sds.Depth description 3d subdivision surfaces ( sds ) modifier property; specifies the maximum number of levels of resolution that the model can display when using the sds modifier. If the sds modifier’s error and tension ...

  • Page 730

    730 chapter 14: properties // 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().D...

  • Page 731

    Diffuse 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: -...

  • Page 732

    732 chapter 14: properties 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 usediffusewithtexture property...

  • Page 733

    Digitalvideotype 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. The di...

  • Page 734

    734 chapter 14: properties 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 usa...

  • Page 735

    Directionalpreset 735 example this statement sets the directionalcolor property of the cast member named room to rgb(0, 255, 0). The default directional light of the cast member will be green. This property can also be set in the property inspector. Member("room").Directionalcolor = rgb(0, 255, 0) s...

  • Page 736

    736 chapter 14: properties 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 ...

  • Page 737

    Displayface 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 ...

  • Page 738

    738 chapter 14: properties in this example, the model resource of the model named slogan is extruded text. This statement sets the displayface property of slogan's model resource to [#back, #tunnel] . The front face of slogan will not be drawn. Member("scene").Model("slogan").Resource.Displayface = ...

  • Page 739

    Displaytemplate 739 example the following examples show that the displayreallogo property for sprite 2 and the cast member real is set to true , which means that the realnetworks logo is displayed when the movie starts to play and when it is stopped or rewound. -- lingo syntax put(sprite(2).Displayr...

  • Page 740

    740 chapter 14: properties example these statements display the displaytemplate properties and their corresponding values in the message window. -- lingo syntax trace(_movie.Displaytemplate) // javascript syntax trace(_movie.Displaytemplate); these statements set various displaytemplate properties. ...

  • Page 741

    Dither 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 #ga...

  • Page 742

    742 chapter 14: properties 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 (mia...

  • Page 743

    Doubleclick 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 // javas...

  • Page 744

    744 chapter 14: properties drag usage member(whichcastmember).Modelresource(whichmodelresource).Drag description 3d #particle model resource property; indicates the percentage of each particle’s velocity that is lost in each simulation step. This property has a range of 0 (no velocity lost) to 100 (...

  • Page 745

    Duration (3d) 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.Des...

  • Page 746

    746 chapter 14: properties 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 (memb...

  • Page 747

    Duration (realmedia, swa) 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(mem...

  • Page 748

    748 chapter 14: properties editable usage -- lingo syntax spriteobjref.Editable // javascript syntax spriteobjref.Editable; description sprite property; determines whether a specified sprite can be edited on the stage ( true ) or not ( false ). Read/write. When the cast member property is set, the s...

  • Page 749

    Elapsedtime 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 ...

  • Page 750

    750 chapter 14: properties 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).Elapsedti...

  • Page 751

    Emulatemultibuttonmouse 751 member(whichcastmember).Modelresource(whichmodelresource).\ emitter.Distribution member(whichcastmember).Modelresource(whichmodelresource).\ emitter.Angle member(whichcastmember).Modelresource(whichmodelresource).\ emitter.Path member(whichcastmember).Modelresource(whichm...

  • Page 752

    752 chapter 14: properties enabled usage the enabled of menuitem whichitem of menu whichmenu description menu item property; determines whether the menu item specified by whichitem is displayed in plain text and is selectable ( true, default) or appears dimmed and is not selectable ( false ). The ex...

  • Page 753

    Enabled (sds) 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 th...

  • Page 754

    754 chapter 14: properties enableflashlingo usage -- lingo syntax _movie.Enableflashlingo // javascript syntax _movie.Enableflashlingo; description movie property; determines whether a sprite with flash content can make any direct scripting callbacks when using the flash geturl() method. Read/write....

  • Page 755

    Endframe 755 example for this example, assume that the cast member named mymember contains a model that uses the model resource named sphere4, whose endangle value is 310, leaving an opening of 50°. The handler closesphere closes that opening in a way that makes it look like it is sliding shut. The ...

  • Page 756

    756 chapter 14: properties 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 fram...

  • Page 757

    Environmentproplist 757 environmentproplist usage -- lingo syntax _system.Environmentproplist // javascript syntax _system.Environmentproplist; description system property; contains a list with information about the environment under which the director content is currently running. Read-only. This d...

  • Page 758

    758 chapter 14: properties error usage member(whichcastmember).Model(whichmodel).Sds.Error description 3d #sds modifier property; indicates the percentage of error tolerated by the modifier when synthesizing geometric detail in models. This property works only when the modifier’s subdivision propert...

  • Page 759

    Exitlock 759 -- lingo syntax on enterframe if sprite(5).Buttonsenabled = true then sprite(5).Eventpassmode= #passnotbutton else sprite(5).Eventpassmode = #passalways end if end // javascript syntax function enterframe() { var bten = sprite(5).Buttonsenabled; if (bten = 1) { sprite(5).Eventpassmode= ...

  • Page 761

    Face 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(whichmodelre...

  • Page 762

    762 chapter 14: properties face[ ] usage member(whichcastmember).Model(whichmodel).Meshdeform.\ mesh[meshindex].Face[faceindex] description 3d meshdeform modifier property; indicates which indices in the vertex list of the model resource were used to define the face. This property can be tested but ...

  • Page 763

    Fieldofview (3d) 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(whichcast...

  • Page 764

    764 chapter 14: properties filefreesize usage -- lingo syntax _movie.Filefreesize // javascript syntax _movie.Filefreesize; description movie property; returns the number of unused bytes in the current movie caused by changes to the cast libraries and cast members within a movie. Read-only. The save...

  • Page 765

    Filename (cast) 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 ...

  • Page 766

    766 chapter 14: properties 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 fil...

  • Page 767

    Filename (window) 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 in...

  • Page 768

    768 chapter 14: properties 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 inf...

  • Page 769

    Fillcycles 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 fillcolor when the fillmode property of the shape is set to ...

  • Page 770

    770 chapter 14: properties example this statement sets the fillcycles of member archie to 3: -- lingo syntax member("archie").Fillcycles = 3 // javascript syntax member("archie").Fillcycles = 3; see also endcolor , fillcolor , fillmode filldirection usage -- lingo syntax memberobjref.Filldirection /...

  • Page 771

    Filloffset 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: • #none —the shape is transparent • #solid —the shape uses a si...

  • Page 772

    772 chapter 14: properties 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 = poin...

  • Page 773

    Fixedlinespace 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 is offset from the left margin of the chunkexpression . The valu...

  • Page 774

    774 chapter 14: properties fixedrate usage -- lingo syntax memberorspriteobjref.Fixedrate // javascript syntax memberorspriteobjref.Fixedrate; description cast member property and sprite property; controls the frame rate of a flash movie or animated gif. The fixedrate property can have integer value...

  • Page 775

    Flashrect 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 ( true , default), or not ( false ), regardless of the stage size saved with that mo...

  • Page 776

    776 chapter 14: properties for linked flash cast members, the flashrect member property returns a valid value only when the cast member’s header has finished loading into memory. This property can be tested but not set. Example this sprite script resizes a flash movie sprite so that it is equal to t...

  • Page 777

    Flipv 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 ( true ) or not ( false ). Read-only. The image itself is flipped around its registration point...

  • Page 778

    778 chapter 14: properties floatprecision usage the floatprecision description movie property; rounds off the display of floating-point numbers to the number of decimal places specified. The value of floatprecision must be an integer. The maximum value is 15 significant digits; the default value is ...

  • Page 779

    Folder 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 ...

  • Page 780

    780 chapter 14: properties // 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...

  • Page 781

    Fontstyle 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...

  • Page 782

    782 chapter 14: properties 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 prope...

  • Page 783

    Frame 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 resul...

  • Page 784

    784 chapter 14: properties // 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 mem...

  • Page 785

    Framepalette 785 example the following statement checks the label of the current frame. In this case, the current framelabel value is start: -- lingo syntax put(_movie.Framelabel) // javascript syntax put(_movie.Framelabel); see also labellist , movie framepalette usage -- lingo syntax _movie.Framep...

  • Page 786

    786 chapter 14: properties 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 ...

  • Page 787

    Framerate (dvd) 787 -- lingo syntax property spritenum on beginsprite me if sprite(spritenum).Member.Framerate sprite(spritenum).Playbackmode = #fixed sprite(spritenum).Fixedrate = 15 end if end // javascript syntax function beginsprite () { var fr = sprite(this.Spritenum).Member.Framerate; if (fr s...

  • Page 788

    788 chapter 14: properties 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 sc...

  • Page 789

    Frametempo 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 framesou...

  • Page 790

    790 chapter 14: properties 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 sy...

  • Page 791

    Fullscreen 791 example this statement sets the front property of the model resource named crate to false , meaning the front of this box will be open: member("3d world").Modelresource("crate").Front = false see also back , bottom (3d) , top (3d) , left (3d) , right (3d) frontwindow usage -- lingo sy...

  • Page 792

    792 chapter 14: properties see also dvd getboneid usage memberreference.Modelresource.Getboneid("bonename") description 3d model resource property; returns the index number of the bone named bonename in the model resource. This property returns 0 if no bone by that name can be found. Example this st...

  • Page 793

    Gravity 793 glossmap usage member(whichcastmember).Shader(whichshader).Glossmap member(whichcastmember).Model(whichmodel).Shader.Glossmap member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ glossmap description 3d #standard shader property; specifies the texture to use for gloss mapping....

  • Page 794

    794 chapter 14: properties gradienttype usage -- lingo syntax memberobjref.Gradienttype // javascript syntax memberobjref.Gradienttype; description vector shape cast member property; specifies the actual gradient used in the cast member’s fill. Possible values are #linear or #radial . The gradientty...

  • Page 795

    Height 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...

  • Page 796

    796 chapter 14: properties 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(whichcas...

  • Page 797

    Highlightstrength 797 example the following statement sets the heightvertices property of the model resource named tower to 10. Nine polygons will be used to define the geometry of the model resource along its z axis; therefore, there will be ten vertices. Member("3d world").Modelresource("tower").H...

  • Page 798

    798 chapter 14: properties example the following statement sets the highlightstrength property of the toon modifier for the model named teapot to 0.5. The model’s highlights will be moderately bright. Member("shapes").Model("teapot").Toon.Highlightstrength = 0.5 see also highlightpercentage , bright...

  • Page 799

    Hotspot 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 hither are not drawn. The value of this property must be greater than or equal to 1.0 and has a default value of 5.0. Example the followi...

  • Page 800

    800 chapter 14: properties 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 ...

  • Page 801

    Hyperlink 801 description cast member property; accesses text and tags that control the layout of the text within an html-formatted text cast member. This property can be tested and set. Example this statement displays in the message window the html formatting information embedded in the text cast m...

  • Page 802

    802 chapter 14: properties 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 ...

  • Page 803

    Hyperlinkstate 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: #normal , #active , and #visited . This p...

  • Page 804

    804 chapter 14: properties idlehandlerperiod usage -- lingo syntax _movie.Idlehandlerperiod // javascript syntax _movie.Idlehandlerperiod; description movie property; determines the maximum number of ticks that passes until the movie sends an idle message. Read/write. The default value is 1, which t...

  • Page 805

    Idleloadperiod 805 idleloadmode usage -- lingo syntax _movie.Idleloadmode // javascript syntax _movie.Idleloadmode; description movie property; determines when the preload() and preloadmember() methods try to load cast members during idle periods. Read/write. Idle periods can be one of the following...

  • Page 806

    806 chapter 14: properties the default value for idleloadperiod is 0, which instructs director to service the load queue as frequently as possible. Example this statement instructs director to try loading every 1/2 second (30 ticks) any cast members waiting to be loaded: -- lingo syntax _movie.Idlel...

  • Page 807

    Image (image) 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 idlereadchunksize is 32k. Example this statement specifies that 500k is the maximum number of bytes ...

  • Page 808

    808 chapter 14: properties these statements place a reference to the image of the stage into the variable myimage and then put that image into cast member flower: -- lingo syntax myimage = _movie.Stage.Image member("flower").Image = myimage // javascript syntax var myimage = _movie.Stage.Image; memb...

  • Page 809

    Imagecompression 809 if you plan to make a lot of changes to the image property, it is faster to copy the image property into a new image object using the member object’s duplicate() method, apply your changes to the new image object, and then set the original item’s image to the new image object. F...

  • Page 810

    810 chapter 14: properties // 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 whet...

  • Page 811

    Immovable 811 // javascript syntax function exitframe() { var stmsp = sprite(_global.Gstreamingsprite).Member.Percentstreamed; if (stmsp _movie.Go(_movie.Frame); } else { sprite(_global.Gstreamingsprite).Imageenabled = 1; _movie.Updatestage(); } } imagequality usage -- lingo syntax _movie.Imagequali...

  • Page 812

    812 chapter 14: properties example this statement sets the immovable property of the collision modifier attached to the first model of the cast member named scene to true : member("scene").Model[1].Collision.Immovable = true see also collision (modifier) ink usage -- lingo syntax spriteobjref.Ink //...

  • Page 813

    Inker (modifier) 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() inker (modifier)...

  • Page 814

    814 chapter 14: properties inlineimeenabled usage -- lingo syntax _player.Inlineimeenabled // javascript syntax _player.Inlineimeenabled; description player property; determines whether the director inline ime feature is turned on. Read/write. When true , this property allows the user to enter doubl...

  • Page 815

    Invertmask 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 prop...

  • Page 816

    816 chapter 14: properties 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 ( t...

  • Page 817

    Kerning 817 itemdelimiter usage the itemdelimiter description player property; indicates the special character used to separate items. You can use the itemdelimiter to parse filenames by setting itemdelimiter to a backslash (\) in windows or a colon (:) on the macintosh. Restore the itemdelimiter ch...

  • Page 818

    818 chapter 14: properties 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 o...

  • Page 819

    Keyboardfocussprite 819 -- lingo syntax on preparemovie keydownscript = "checkkey" end on checkkey if (_key.Key = "q") then _movie.Go("main menu") end if end // javascript syntax function preparemovie() { keydownscript = checkkey(); } function checkkey() { if (_key.Key == "q") { _movie.Go("main menu...

  • Page 820

    820 chapter 14: properties 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 insti...

  • Page 821

    Keydownscript 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 , key keydownscript usage the keydo...

  • Page 822

    822 chapter 14: properties see also on keydown , keyupscript , mousedownscript , mouseupscript keyframeplayer (modifier) syntax member(whichcastmember).Model(whichmodel).\ keyframeplayer.Keyframeplayermodifierproperty description 3d modifier; manages the use of motions by models. The motions managed...

  • Page 823

    Keyupscript 823 • playnext() initiates playback of the next motion in the playlist. • queue() adds a motion to the end of the playlist. The keyframeplayer modifier generates the following events, which are used by handlers declared in the registerforevent() and registerscript() commands. The call to...

  • Page 824

    824 chapter 14: properties 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-delimite...

  • Page 825

    Lasterror 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 ...

  • Page 826

    826 chapter 14: properties 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 synt...

  • Page 827

    Lastroll 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; descripti...

  • Page 828

    828 chapter 14: properties 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.L...

  • Page 829

    Length (3d) 829 left (3d) usage member(whichcastmember).Modelresource(whichmodelresource).Left description 3d #box model resource property; indicates whether the side of the box intersected by its -x axis is sealed ( true ) or open ( false ). The default value for this property is true . Example thi...

  • Page 830

    830 chapter 14: properties the length of a vector is its distance in world units from vector(0, 0, 0) . This is the same as the magnitude of the vector. Example this statement sets the variable myboxlength to the length of the model resource named giftbox. Myboxlength = member("3d world").Modelresou...

  • Page 831

    Light 831 the #lod modifier can only be added to models created outside of director in 3d modeling programs. The value of the type property of the model resources used by these models is #fromfile . The modifier cannot be added to primitives created within director. Example the following statement s...

  • Page 832

    832 chapter 14: properties see also newlight , deletelight linecolor usage member(whichcastmember).Model(whichmodel).Inker.Linecolor member(whichcastmember).Model(whichmodel).Toon.Linecolor description 3d toon and inker modifier property; indicates the color of the lines drawn on the model by the mo...

  • Page 833

    Lineheight 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 prop...

  • Page 834

    834 chapter 14: properties lineoffset usage member(whichcastmember).Model(whichmodel).Toon.Lineoffset member(whichcastmember).Model(whichmodel).Inker.Lineoffset description 3d toon and inker modifier property; indicates the apparent distance from the model’s surface at which lines are drawn by the m...

  • Page 835

    Loaded 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 ( true , default), or inside the director cast library ( false ). Read/write f...

  • Page 836

    836 chapter 14: properties 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").Load...

  • Page 837

    Locv 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() locktransla...

  • Page 838

    838 chapter 14: properties 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).Lo...

  • Page 839

    Lod (modifier) 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.Lodmodi...

  • Page 840

    840 chapter 14: properties loop (3d) usage member(whichcastmember).Loop description 3d cast member property; indicates whether motions applied to the first model in the cast member repeat continuously ( true ) or play once and stop ( false ). The default setting for this property is true . Example t...

  • Page 841

    Loop (flash) 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 ( true ) or not ( false ). Example this statement sets the...

  • Page 842

    842 chapter 14: properties loop (windows media) usage -- lingo syntax windowsmediaobjref.Loop // javascript syntax windowsmediaobjref.Loop; description windows media property. Determines whether a movie loops ( true , default) or not ( false ) after completion. Read/write. Example this statement spe...

  • Page 843

    Loopcount 843 if the loop property is turned off while the movie is playing, the movie continues to play. Director stops when it reaches the end of the movie. This property can be tested and set. The default setting is [0,0]. Example this sprite script sets the starting and ending times for looping ...

  • Page 844

    844 chapter 14: properties // 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, "loopc...

  • Page 845

    Loopstarttime 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 so...

  • Page 846

    846 chapter 14: properties 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 s...

  • Page 847

    Mask 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 mar...

  • Page 848

    848 chapter 14: properties masking is an advanced feature; you may need to experiment to achieve your goal. This property can be tested and set. To remove a mask, set the mask property to 0. Example this frame script sets a mask for a quicktime sprite before director begins to draw the frame: -- lin...

  • Page 849

    Media 849 maxspeed usage member(whichcastmember).Modelresource(whichmodelresource).\ emitter.Maxspeed description 3d property; when used with a model resource whose type is #particle , allows you to get and set the maximum speed at which particles are emitted. Each particle’s initial velocity is ran...

  • Page 850

    850 chapter 14: properties example this statement copies the content of the cast member sunrise into the cast member dawn by setting the media member property value for dawn to the media member property value for sunrise: -- lingo syntax member("dawn").Media = member("sunrise").Media // javascript s...

  • Page 851

    Mediastatus (realmedia, windows media) 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: see a...

  • Page 852

    852 chapter 14: properties • #connecting indicates that a connection to the realmedia or windows media stream is being established. • #opened indicates that a connection to the realmedia or windows media stream has been established and is open. This is a transitory state that is very quickly followe...

  • Page 853

    Member (cast) 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.Memb...

  • Page 854

    854 chapter 14: properties // 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...

  • Page 855

    Member (sprite) 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 librar...

  • Page 856

    856 chapter 14: properties // javascript syntax sprite(15).Member = member(3, 4);.

  • Page 857

    Memorysize 857 the following handler uses the mousemember function with the sprite.Member property to find if the mouse is over a particular sprite: -- lingo syntax on exitframe mm = _mouse.Mousemember target = sprite(1).Member if (target = mm) then put("above the hotspot.") _movie.Go(_movie.Frame) ...

  • Page 858

    858 chapter 14: properties 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 #meshdeform modifier (using the addmodifier comm...

  • Page 859

    Minspeed 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 = current...

  • Page 860

    860 chapter 14: properties 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 r...

  • Page 861

    Model 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 v...

  • Page 862

    862 chapter 14: properties 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 ...

  • Page 863

    Modelb 863 modelb usage collisiondata.Modelb description 3d collisiondata property; indicates one of the models involved in a collision, the other model being modela . The collisiondata object is sent as an argument with the #collidewith and #collideany events to the handler specified in the registe...

  • Page 864

    864 chapter 14: properties modelresource usage member(whichcastmember).Modelresource(whichmodelresource) member(whichcastmember).Modelresource[index] member(whichcastmember).Modelresource.Count member(whichcastmember).Modelresource(whichmodelresource).\ propertyname member(whichcastmember).Modelreso...

  • Page 865

    Modifiedby 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")...

  • Page 866

    866 chapter 14: properties 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 pro...

  • Page 867

    Mostrecentcuepoint 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 foun...

  • Page 868

    868 chapter 14: properties 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...

  • Page 869

    Mousechar 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 valu...

  • Page 870

    870 chapter 14: properties 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 = "pleas...

  • Page 871

    Mousedownscript 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...

  • Page 872

    872 chapter 14: properties mouseh usage -- lingo syntax _mouse.Mouseh // javascript syntax _mouse.Mouseh; description mouse property; indicates the horizontal position of the mouse pointer. Read-only. The value of mouseh is the number of pixels the cursor is positioned from the left edge of the stag...

  • Page 873

    Mouseitem 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 del...

  • Page 874

    874 chapter 14: properties 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 ...

  • Page 875

    Mouseline 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 f...

  • Page 876

    876 chapter 14: properties 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 ...

  • Page 877

    Mouseoverbutton 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 ...

  • Page 878

    878 chapter 14: properties _movie.Updatestage() end // javascript syntax function enterframe() { switch(sprite(3).Mouseoverbutton) case 1: member("message line").Text = "click here to go to the next page."; break; case 0: member("message line").Text = " "; break; } _movie.Updatestage(); } mouseup us...

  • Page 879

    Mousev 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 call...

  • Page 880

    880 chapter 14: properties description mouse property; indicates the vertical position of the mouse cursor, in pixels, from the top of the stage. Read-only. The value of this property increases as the cursor moves down and decreases as the cursor moves up. The mousev property is useful for moving sp...

  • Page 881

    Moveablesprite 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. The value of the...

  • Page 882

    882 chapter 14: properties 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(...

  • Page 883

    Name (3d) 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 synta...

  • Page 884

    884 chapter 14: properties 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 ca...

  • Page 885

    Name (sprite channel) 885 example this statement sets the variable itemname to the name of the eighth item in the edit menu: set itemname = the name of menuitem(8) of menu("edit") this statement causes a specific filename to follow the word open in the file menu: the name of menuitem("open") of menu...

  • Page 886

    886 chapter 14: properties // javascript syntax spritechannelobjref.Name; description sprite channel property; identifies the name of a sprite channel. Read/write during a score recording session only. Set the name of a sprite channel during a score recording session—between calls to the movie objec...

  • Page 887

    Near (fog) 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: element 2 element ...

  • Page 888

    888 chapter 14: properties nearfiltering usage member(whichcastmember).Texture(whichtexture).Nearfiltering member(whichcastmember).Shader(whichshader).\ texture(whichtexture).Nearfiltering member(whichcastmember).Model(whichmodel).Shader.Texture\ (whichtexture).Nearfiltering member(whichcastmember)....

  • Page 889

    Netpresent 889 _player.Alert("sorry, the network support xtras could not be found."); } see also player.

  • Page 890

    890 chapter 14: properties 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 defa...

  • Page 891

    Nodetype 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 t...

  • Page 892

    892 chapter 14: properties normallist usage member(whichcastmember).Modelresource(whichmodelresource).\ normallist model.Meshdeform.Mesh[index].Normallist description 3d property; when used with a model resource whose type is #mesh , this property allows you to get or set the normallist property of ...

  • Page 893

    Number (characters) 893 example this statement sets the normals property of the fifth face of the model resource named player to a list of integer values: member(“3d”).Modelresource(“player”).Face[5].Normals = [2,32,14] see also face , normallist , vertices number (cast) usage -- lingo syntax castob...

  • Page 894

    894 chapter 14: properties example this statement displays the number of characters in the string “macromedia, the multimedia company” in the message window: put the number of chars in "macromedia, the multimedia company" the result is 34. This statement sets the variable charcounter to the number o...

  • Page 895

    Number (member) 895 number (lines) usage the number of lines in chunkexpression description chunk expression; returns a count of the lines in a chunk expression. (lines refers to lines delimited by carriage returns, not lines formed by line wrapping.) chunk expressions are any character, word, item,...

  • Page 896

    896 chapter 14: properties // 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; t...

  • Page 897

    Number (sprite channel) 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 whichmenu . The whichmenu parameter can be a menu name or menu number. This menu property can be tested but no...

  • Page 898

    898 chapter 14: properties number (system) usage the number of castlibs description system property; returns the number of casts that are in the current movie. This property can be tested but not set. Example this repeat loop uses the message window to display the number of cast members that are in ...

  • Page 899

    Numchannels 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...

  • Page 900

    900 chapter 14: properties 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 = "mo...

  • Page 901

    Optiondown 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 numsegments property of the model resource named cylinder03 to 10: member("3d wo...

  • Page 902

    902 chapter 14: properties in windows, optiondown does not work in projectors if alt is pressed without another nonmodifier key. Avoid using optiondown if you intend to distribute a movie as a windows projector and need to detect only the modifier key press; use controldown or shiftdown instead. On ...

  • Page 903

    Originh 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 cas...

  • Page 904

    904 chapter 14: properties example this sprite script uses the originmode property to set up a flash movie sprite so it’s origin point can be set to a specific point. It then sets the horizontal and vertical origin points. -- lingo syntax property spritenum on beginsprite me sprite(spritenum).Origin...

  • Page 905

    Originpoint 905 example this sprite script uses the originmode property to set up a flash movie sprite so its origin point can be set to a specific point. It then sets the horizontal and vertical origin points. -- lingo syntax property spritenum on beginsprite me sprite(spritenum).Originmode = #poin...

  • Page 906

    906 chapter 14: properties example this sprite script uses the originmode property to set up a flash movie sprite so its origin point can be set to a specific point. It then sets the origin points. -- lingo syntax property spritenum on beginsprite me sprite(spritenum).Scalemode = #showall sprite(spr...

  • Page 907

    Orthoheight 907 example this sprite script uses the originmode property to set up a flash movie sprite so its origin point can be set to a specific point. It then sets the horizontal and vertical origin points. -- lingo syntax property spritenum on beginsprite me sprite(spritenum).Scalemode = #showa...

  • Page 908

    908 chapter 14: properties 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 l...

  • Page 909

    Palettemapping 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 // java...

  • Page 910

    910 chapter 14: properties 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...

  • Page 911

    Paragraph 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, pan affects which speaker (lef...

  • Page 912

    912 chapter 14: properties 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 m...

  • Page 913

    Path (movie) 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); // "*******...

  • Page 914

    914 chapter 14: properties 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:...

  • Page 915

    Pathstrength 915 setting the path of an unlinked cast member converts it to a linked cast member. This property can be tested and set. The pathname property of an unlinked member is an empty string. This property is the same as the filename property for other member types, and you can use filename i...

  • Page 916

    916 chapter 14: properties 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 ...

  • Page 917

    Pausedatstart (realmedia, windows media) 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 whe...

  • Page 918

    918 chapter 14: properties the following example uses the pausedatstart property to buffer a realmedia sprite off the stage, and then play it on the stage once the buffering is complete. In this example, the realmedia member has its pausedatstart property set to true . An instance of this member is ...

  • Page 919

    Percentstreamed (3d) 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); //...

  • Page 920

    920 chapter 14: properties 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;...

  • Page 921

    Persistent 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 _movie.Go(_movie.Frame) end if end // javascript sy...

  • Page 922

    922 chapter 14: properties setting this property to true allows a timeout object to continue generating timeout events in other movies. This is useful when one movie branches to another with the go to movie command. Example this preparemovie handler creates a timeout object that will remain active a...

  • Page 923

    Platform 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 res...

  • Page 924

    924 chapter 14: properties example this statement checks whether a projector was created for windows 95 or windows nt: on exitframe if the platform contains "windows,32" then castlib("win95 art").Name = "interface" end if end see also runmode playbackmode usage -- lingo syntax memberorspriteobjref.P...

  • Page 925

    Playing (3d) 925 playing usage -- lingo syntax spriteobjref.Playing // javascript syntax spriteobjref.Playing; description flash sprite property; indicates whether a flash movie is playing ( true ) or stopped ( false ). This property can be tested but not set. Example this frame script checks to see...

  • Page 926

    926 chapter 14: properties playlist usage member(whichcastmember).Model(whichmodel).Keyframeplayer.Playlist member(whichcastmember).Model(whichmodel).Bonesplayer.Playlist description 3d #keyframeplayer and #bonesplayer modifier property; returns a linear list of property lists, each representing a m...

  • Page 927

    Playrate (quicktime, avi) 927 example this statement sets the playrate property of the keyframeplayer modifier for the model named greenalien to 3: member("newaliens").Model("greenalien").Keyframeplayer.Playrate = 3 see also play() (3d) , queue() (3d) , playlist , currenttime (3d) playrate (dvd) usa...

  • Page 928

    928 chapter 14: properties 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: -- lin...

  • Page 929

    Pointofcontact 929 pointatorientation usage member(whichcastmember).Model(whichmodel).Pointatorientation member(whichcastmember).Group(whichgroup).Pointatorientation member(whichcastmember).Light(whichlight).Pointatorientation member(whichcastmember).Camera(whichcamera).Pointatorientation descriptio...

  • Page 930

    930 chapter 14: properties example this example has two parts. The first part is the first line of code, which registers the #explode handler for the #collideany event. The second part is the #explode handler. When two models in the cast member myscene collide, the #explode handler is called and the...

  • Page 931

    Positionreset 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(...

  • Page 932

    932 chapter 14: properties 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 correspon...

  • Page 933

    Preload (3d) 933 • #software specifies the director built-in software renderer that works with both macintosh and windows platforms. • #auto specifies that the most suitable renderer should be chosen. This is the default value for this property. The value set for this property is used as the default...

  • Page 934

    934 chapter 14: properties see also state (3d) preload (member) usage -- lingo syntax memberobjref.Preload // javascript syntax memberobjref.Preload; description cast member property; determines whether the digital video cast member specified by whichcastmember can be preloaded into memory ( true ) ...

  • Page 935

    Preloadmode 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.Pr...

  • Page 936

    936 chapter 14: properties 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 amou...

  • Page 937

    Productname 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 preloadbuffer or play command is issued. -- lingo syntax on mousedown member("louis armstrong").Stop() member("louis armstrong...

  • Page 938

    938 chapter 14: properties 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...

  • Page 939

    Purgepriority 939 when projection is #orthographic , the apparent size of objects does not depend on distance from the camera, and the orthoheight property specifies how many world units fit vertically into the sprite (which determines how much of the world you see). The orthographic projection widt...

  • Page 940

    940 chapter 14: properties 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 point...

  • Page 941

    Quality 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 slow...

  • Page 942

    942 chapter 14: properties 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...

  • Page 943

    Recordfont 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 ...

  • Page 944

    944 chapter 14: properties the command creates a shock font in whichcastmember using the font named in the font argument. The value returned from the command reports whether the operation was successful. Zero indicates success. Example this statement creates a simple shock font using only the two ar...

  • Page 945

    Rect (image) 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. Ther...

  • Page 946

    946 chapter 14: properties 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...

  • Page 947

    Ref 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 prope...

  • Page 948

    948 chapter 14: properties example without references, you would need statements like these: member(whichtextmember).Line[whichline].Word[firstword..Lastword].Font = "palatino" member(whichtextmember).Line[whichline].Word[firstword..Lastword].Fontsize = 36 member(whichtextmember).Line[whichline].Wor...

  • Page 949

    Region 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 p...

  • Page 950

    950 chapter 14: properties 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 poi...

  • Page 951

    Regpointvertex 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. T...

  • Page 952

    952 chapter 14: properties 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 rendere...

  • Page 953

    Renderformat 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(whic...

  • Page 954

    954 chapter 14: properties see also texturerenderformat , gethardwareinfo() renderstyle usage member(whichcastmember).Shader(whichshader).Renderstyle description 3d standard shader property; allows you to get or set the renderstyle for a shader, as determined by the geometry of the underlying model ...

  • Page 955

    Resolution (dvd) 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 or #cylinder . Resolution controls the number of ...

  • Page 956

    956 chapter 14: properties resolve usage member(whichcastmember).Model(whichmodel).Collision.Resolve description 3d collision property; allows you to get or set whether collisions are resolved when two models collide. If this property is set to true for both models involved in a collision, both mode...

  • Page 957

    Right (3d) 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 cor...

  • Page 958

    958 chapter 14: properties rightindent usage chunkexpression.Rightindent description text cast member property; contains the offset distance, in pixels, of the right margin of chunkexpression from the right side of the text cast member. The value is an integer greater than or equal to 0. This proper...

  • Page 959

    Romanlingo 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 ( true ) or are currently bei...

  • Page 960

    960 chapter 14: properties example this statement sets romanlingo to true , which causes lingo to use a single-byte character set: set the romanlingo to true see also inlineimeenabled rootlock usage member(whichcastmember).Model(whichmodel).Keyframeplayer.Rootlock member(whichcastmember).Model(which...

  • Page 961

    Rotation 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 ...

  • Page 962

    962 chapter 14: properties 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(whichs...

  • Page 963

    Rotation (transform) 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 ...

  • Page 964

    964 chapter 14: properties 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...

  • Page 965

    Safeplayer 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 _p...

  • Page 966

    966 chapter 14: properties 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 n...

  • Page 967

    Samplesize 967 when multiple sounds are queued in a sound channel, director plays them all with the channelcount , samplerate , and samplesize of the first sound queued, resampling the rest for smooth playback. Director resets these properties only after the channel’s sound queue is exhausted or a s...

  • Page 968

    968 chapter 14: properties 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\ [backdropin...

  • Page 969

    Scale (member) 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 sc...

  • Page 970

    970 chapter 14: properties } } 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 ...

  • Page 971

    Scalemode 971 • #showall (default for director movies prior to version 7)—maintains the aspect ratio of the original flash movie cast member. If necessary, fill in any gap in the horizontal or vertical dimension using the background color. • #noborder —maintains the aspect ratio of the original flas...

  • Page 972

    972 chapter 14: properties 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 ...

  • Page 973

    Scoreselection 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...

  • Page 974

    974 chapter 14: properties script usage -- lingo syntax _movie.Script[scriptnameornum] // javascript syntax _movie.Script[scriptnameornum]; description movie property; provides indexed or named access to the script cast members of a movie. Read-only. The scriptnameornum argument can be either a stri...

  • Page 975

    Scriptinstancelist 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; retu...

  • Page 976

    976 chapter 14: properties example this handler displays the list of script references attached to a sprite: on showscriptrefs spritenum put sprite(spritenum).Scriptinstancelist end these statements attach the script big noise to sprite 5: x = script("big noise").New() sprite(5).Scriptinstancelist.A...

  • Page 977

    Scripttext 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 ...

  • Page 978

    978 chapter 14: properties 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.Scriptt...

  • Page 979

    Sds (modifier) 979 the global variable sliderval could measure how far the user drags a slider. The statement set newval = sliderval * 100 multiplies sliderval to give a value that is greater than the distance the user drags the slider. If sliderval is positive, the text moves up; if sliderval is ne...

  • Page 980

    980 chapter 14: properties depth specifies the maximum number of levels of resolution that the model can display when using the sds modifier. Error indicates the level of error tolerance for the subdivision surfaces functionality. This property applies only when the sds.Subdivision property is set t...

  • Page 981

    Searchpathlist 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...

  • Page 982

    982 chapter 14: properties // 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 propert...

  • Page 983

    Selection (text cast member property) 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 usa...

  • Page 984

    984 chapter 14: properties 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...

  • Page 985

    Serialnumber 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 to identify a selection in the current editable field, counting from the beginning character. This propert...

  • Page 986

    986 chapter 14: properties 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 \ & retur...

  • Page 987

    Shaderlist 987 shaders are stored in the shader palette of the 3d cast member. They can be referenced by name ( whichshader ) or palette index ( shaderindex ). A shader can be used by any number of models. Changes to a shader will appear in all models which use that shader. There are four types of s...

  • Page 988

    988 chapter 14: properties 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 shade...

  • Page 989

    Shiftdown 989 shadowstrength usage member(whichcastmember).Model(whichmodel).Toon.Shadowstrength member(whichcastmember).Model(whichmodel).Shader.Shadowstrength member(whichcastmember).Shader(whichshader).Shadowstrength description 3d toon modifier and #painter shader property; indicates the brightn...

  • Page 990

    990 chapter 14: properties 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 , ke...

  • Page 991

    Sizerange 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 silhouettes property of the inker modifier for the model named sphere to false . Lines will not be drawn arou...

  • Page 992

    992 chapter 14: properties example in this example, mrfount is a model resource of the type #particle . This statement sets the sizerange properties of mrfount. The first line sets the start value to 4, and the second line sets the end value to 1. The effect of this statement is that the particles o...

  • Page 993

    Smoothness 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...

  • Page 994

    994 chapter 14: properties for more information about working with extruder model resources and text cast members, see extrude3d . Example in this example, the cast member logo is a text cast member. This statement sets the smoothness of logo to 8. When logo is displayed in 3d mode, the edges of its...

  • Page 995

    Soundchannel (swa) 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. The intsoundchannelnum argument ...

  • Page 996

    996 chapter 14: properties 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 memberorspr...

  • Page 997

    Sounddevice 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 realplayer...

  • Page 998

    998 chapter 14: properties 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, ma...

  • Page 999

    Soundlevel 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 proper...

  • Page 1000

    1000 chapter 14: properties these values correspond to the settings in the macintosh sound control panel. Using this property, script can change the sound volume directly or perform some other action when the sound is at a specified level. To see an example of soundlevel used in a completed movie, s...

  • Page 1001

    Sourcerect 1001 source usage sprite(whichsprite).Camera.Backdrop[backdropindex].Source member(whichcastmember).Camera(whichcamera).Backdrop [backdropindex].Source sprite(whichsprite).Camera.Overlay[overlayindex].Source member(whichcastmember).Camera(whichcamera).Overlay [overlayindex].Source descrip...

  • Page 1002

    1002 chapter 14: properties example this statement displays the original coordinates of the stage named control_panel in the message window: -- lingo syntax put(window("control_panel").Sourcerect) // javascript syntax put(window("control_panel").Sourcerect); see also window specular (light) usage me...

  • Page 1003

    Specularlightmap 1003 example put member("scene").Shader("plutomat").Specular -- rgb(11, 11, 11) see also silhouettes , specular (light) , specularcolor , emissive specularcolor usage member(whichcastmember).Specularcolor description 3d cast member property; allows you to get or set the rgb value of...

  • Page 1004

    1004 chapter 14: properties all shaders have access to the #standard shader properties; in addition to these standard shader properties shaders of the types #engraver , #newsprint , and #painter have properties unique to their type. For more information, see the newshader . Example this statement se...

  • Page 1005

    Sprite (sprite channel) 1005 sprite (movie) usage -- lingo syntax _movie.Sprite[spritenameornum] // javascript syntax _movie.Sprite[spritenameornum]; description movie property; provides indexed or named access to a movie sprite. Read-only. The spritenameornum argument can be either a string that sp...

  • Page 1006

    1006 chapter 14: properties spritenum usage -- lingo syntax spriteobjref.Spritenum // javascript syntax spriteobjref.Spritenum; description sprite property; determines the channel number the behavior’s sprite is in and makes it available to any behaviors. Read-only. Simply declare the property at th...

  • Page 1007

    Stage 1007 this approach allows the use of the reference pmyspriteref later in the script, with the handler using the syntax: -- lingo syntax currmember = pmyspriteref.Member // javascript syntax var currmember = pmyspriteref.Member instead of the following syntax which is somewhat longer: -- lingo ...

  • Page 1008

    1008 chapter 14: properties startangle usage member(whichcastmember).Modelresource(whichmodelresource). Startangle modelresourceobjectreference.Startangle description 3d property; when used with a model resource whose type is #cylinder or #sphere , this command allows you to both get and set the sta...

  • Page 1009

    Starttimelist 1009 starttime usage -- lingo syntax soundchannelobjref.Starttime // javascript syntax soundchannelobjref.Starttime; description sound channel property; indicates the start time of the currently playing or paused sound as set when the sound was queued. Read-only. This property cannot b...

  • Page 1010

    1010 chapter 14: properties a time based starttimelist contains the following properties: • title. Specifies the title. • hours . Specifies the hour at which playback starts. • min . Specifies the minute at which playback starts. • sec . Specifies the second at which playback starts. • frames . Spec...

  • Page 1011

    State (flash, swa) 1011 example this statement shows that the cast member named partyscene has finished loading and preparing for playback, and no errors occurred during the load: put member("partyscene").State -- 4 state (flash, swa) usage -- lingo syntax memberobjref.State // javascript syntax mem...

  • Page 1012

    1012 chapter 14: properties example this statement issues an alert if an error is detected for the swa streaming cast member: -- lingo syntax on mousedown if member("ella fitzgerald").State = 9 then _player.Alert("sorry, can't find an audio file to stream.") end if end // javascript syntax function ...

  • Page 1013

    State (realmedia) 1013 the streaming process is initiated when the playhead enters the span of the realmedia sprite in the score, the play method is invoked on a realmedia sprite or cast member, or a user clicks the play button in the realmedia viewer. Calling this property returns a numeric value i...

  • Page 1014

    1014 chapter 14: properties // javascript syntax put(sprite(2).State); // 0 put(member("real").State); // 0 see also mediastatus (realmedia, windows media) , percentbuffered , lasterror static usage -- lingo syntax memberorspriteobjref.Static // javascript syntax memberorspriteobjref.Static; descrip...

  • Page 1015

    Status 1015 staticquality usage -- lingo syntax spriteobjref.Staticquality // javascript syntax spriteobjref.Staticquality; description quicktime vr sprite property; specifies the codec quality used when the panorama image is static. Possible values are #minquality , #maxquality , and #normalquality...

  • Page 1016

    1016 chapter 14: properties stilldown usage -- lingo syntax _mouse.Stilldown // javascript syntax _mouse.Stilldown; description mouse property; indicates whether the user is pressing the mouse button ( true ) or not ( false ). Read-only. This function is useful within a mousedown script to trigger c...

  • Page 1017

    Streammode 1017 stoptimelist usage -- lingo syntax dvdobjref.Stoptimelist // javascript syntax dvdobjref.Stoptimelist; description dvd property; a property list that specifies the time or chapter at which playback stops. Read/write. A stoptimelist is a property list that can be either chapter based ...

  • Page 1018

    1018 chapter 14: properties description flash cast member property; controls the way a linked flash movie cast member is streamed into memory, as follows: • #frame ( default ) —streams part of the cast member each time the director frame advances while the sprite is on the stage. • #idle —streams pa...

  • Page 1019

    Streamsize 1019 example the following statement links the file bigband.Swa to an swa streaming cast member. The linked file is on the disk mydisk in the folder named sounds. -- lingo syntax member("swastream").Streamname = "mydisk/sounds/bigband.Swa" // javascript syntax member("swastream").Streamna...

  • Page 1020

    1020 chapter 14: properties streamsize (3d) usage member(whichcastmember).Streamsize description 3d property; allows you to get the size of the data stream to be downloaded, from 0 to maxinteger. This command refers to the initial file import or the last loadfile() requested. Example this statement ...

  • Page 1021

    Style 1021 strokewidth usage -- lingo syntax memberobjref.Strokewidth // javascript syntax memberobjref.Strokewidth; description vector shape cast member property; indicates the width, in pixels, of the shape’s framing stroke. The value is a floating-point number between 0 and 100 and can be tested ...

  • Page 1022

    1022 chapter 14: properties subdivision usage member(whichcastmember).Model(whichmodel).Sds.Subdivision description 3d sds modifier property; allows you to get or set the subdivision surfaces mode of operation. Possible values are as follows: • #uniform specifies that the mesh is uniformly scaled up...

  • Page 1023

    Switchcolordepth 1023 subpicturecount usage -- lingo syntax dvdobjref.Subpicturecount // javascript syntax dvdobjref.Subpicturecount; description dvd property. Returns the number of available sub pictures. Read-only. See also dvd suspendupdates usage sprite(which3dsprite).Suspendupdates description ...

  • Page 1024

    1024 chapter 14: properties the value of this property can also be set using the reset monitor to movie’s color depth option in the general preferences dialog box. Example this statement sets the variable named switcher to the current setting of switchcolordepth : -- lingo syntax switcher = _player....

  • Page 1025

    Tabs 1025 systemtraytooltip usage -- lingo syntax _movie.Displaytemplate.Systemtraytooltip windowobjref.Systemtraytooltip // javascript syntax _movie.Displaytemplate.Systemtraytooltip; windowobjref.Systemtraytooltip; description movie and windows property (microsoft windows only). Determines the str...

  • Page 1026

    1026 chapter 14: properties example this statement retrieves and displays in the message window all the tabs for the text cast member intro credits: put member("intro credits").Tabs -- [[#type: #left, #position: 36], [#type: #decimal, #position: 141], \ [#type: #right, #position: 216]] target usage ...

  • Page 1027

    Text 1027 tension usage member(whichcastmember).Model(whichmodel).Sds.Tension description 3d subdivision surface property; allows you to get or set a floating-point percentage between 0.0 and 100.0 that controls how tightly the newly generated surface matches the original surface. The higher this va...

  • Page 1028

    1028 chapter 14: properties example this statement places the phrase “thank you.” in the empty cast member response: --lingo syntax if (member("response").Text = empty) then member("response").Text = "thank you." end if // javascript syntax if (member("response").Text = " ") { member("response").Tex...

  • Page 1029

    Texturecoordinatelist 1029 for more information about texture properties, see the using director topics in the director help panel. The texture of a particle system is a property of the model resource, whose type is #particle . Example this statement sets the texture property of the shader named wal...

  • Page 1030

    1030 chapter 14: properties texturecoordinates usage member(whichcastmember).Modelresource(whichmodelresource).\ face[faceindex].Texturecoordinates modelresourceobject.Face[faceindex].Texturecoordinates description 3d property; identifies which elements in the texturecoordinatelist to use for the fa...

  • Page 1031

    Texturemember 1031 texturelist usage member(whichmember).Model(whichmodel).Shader(whichshader).Texturelist member(whichmember).Model(whichmodel).Shader(whichshader).Texturelist[index] description 3d shader property; determines the list of textures applied to the shader. A shader can have up to 8 lay...

  • Page 1032

    1032 chapter 14: properties texturemode usage member(whichcastmember).Shader(whichshader).Texturemode member(whichcastmember).Model(whichmodel).Shader.Texturemode member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ texturemode description 3d #standard shader property; specifies how the f...

  • Page 1033

    Texturemodelist 1033 • #wrapcylindrical wraps the texture around the surface as though the surface were placed in the middle of the texture and then the texture were rolled around the surface to form a cylinder. The wraptransformlist[texturelayerindex] is applied to the mapping space before the text...

  • Page 1034

    1034 chapter 14: properties texturerenderformat usage getrenderservices().Texturerenderformat description 3d rendererservices property; allows you to get or set the default bit format used by all textures in all 3d cast members. Use a texture's texture.Renderformat property to override this setting ...

  • Page 1035

    Texturerepeatlist 1035 texturerepeat usage member(whichcastmember).Shader(whichshader).Texturerepeat member(whichcastmember).Model(whichmodel).Shader.Texturerepeat member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ texturerepeat description 3d #standard shader property; controls the tex...

  • Page 1036

    1036 chapter 14: properties description 3d standard shader property; allows you to get or set the texture clamping behavior of any texture layer. When true , the default, the texture in texturelayerindex can be tiled (repeated) several times across model surfaces. This can be accomplished by setting...

  • Page 1037

    Texturetransformlist 1037 to tile the image twice along its horizontal axis, use shaderreference.Texturetransform.Scale(0.5, 1.0, 1.0) . Scaling on the z axis is ignored. To offset the image by point(xoffset,yoffset) , use shaderreference.Texturetransform.Translate(xoffset,yoffset,0.0) . Translating...

  • Page 1038

    1038 chapter 14: properties description 3d standard shader property; this property provides access to a transform which modifies the texture coordinate mapping of a texture layer. Manipulate this transform to tile, rotate, or translate a texture image before applying it to the surface of models. The...

  • Page 1039

    Thumbnail 1039 these statements rotate the third texture used by the shader gbcyl3 by 90× around its center, assuming that texturelist[3] is a 128x128 sized texture: s = member("scene").Shader("gbcyl3") s.Texturetransformlist[3].Translate(-64,-64,0) s.Texturetransformlist[3].Rotate(0,0,90) s.Texture...

  • Page 1040

    1040 chapter 14: properties example the following statement shows how to use a placeholder cast member to display another thumbnail on the stage. The placeholder cast member is placed on the stage, then the picture of that member is set to the thumbnail of member 10. This makes it possible to show a...

  • Page 1041

    Timeoutlist 1041 see also milliseconds , period , persistent , target , timeout() , timeouthandler timeouthandler usage timeoutobject.Timeouthandler description system property; represents the name of the handler that will receive timeout messages from the given timeoutobject . Its value is a symbol...

  • Page 1042

    1042 chapter 14: properties timescale usage member(whichcastmember).Timescale the timescale of member whichcastmember description cast member property; returns the time unit per second on which the digital video’s frames are based. For example, a time unit in a quicktime digital video is 1/600 of a ...

  • Page 1043

    Titlebaroptions 1043 example this statements assigns the title planets to the fifth window: -- lingo syntax _player.Windowlist[5].Title = "planets" // javascript syntax _player.Windowlist[5].Title = "planets"; see also window titlebaroptions usage -- lingo syntax windowobjref.Titlebaroptions // java...

  • Page 1044

    1044 chapter 14: properties example this statement displays in the message window the available titlebar options for the window named elements: -- lingo syntax trace(window("elements").Titlebaroptions) // javascript syntax trace(window("elements").Titlebaroptions); these statements set the icon prop...

  • Page 1045

    Toon (modifier) 1045 // javascript syntax put(_player.Toolxtralist); see also mediaxtralist , player , scriptingxtralist , transitionxtralist , xtralist (player) toon (modifier) usage member(whichcastmember).Model(whichmodel).Toon.Toonmodifierproperty description 3d modifier; once you have added the...

  • Page 1046

    1046 chapter 14: properties • linecolor allows you to get or set the color of lines drawn by the inker. Possible values are any valid lingo color object. The default value is rgb (0, 0, 0) , which is black. • creases allows you to get or set whether lines are drawn in creases. This is a boolean valu...

  • Page 1047

    Traceload 1047 topspacing usage chunkexpression.Topspacing description text cast member property; allows you to specify additional spacing applied to the top of each paragraph in the chunkexpression portion of the text cast member. The value itself is an integer, with less than 0 indicating less spa...

  • Page 1048

    1048 chapter 14: properties tracelogfile usage -- lingo syntax _movie.Tracelogfile // javascript syntax _movie.Tracelogfile; description movie property; specifies the name of the file in which the message window display is written. Read/write. You can close the file by setting the tracelogfile prope...

  • Page 1049

    Trackcount (sprite) 1049 example this statement turns the tracescript property on. -- lingo syntax _movie.Tracescript = true // javascript syntax _movie.Tracescript = true; see also movie trackcount (member) usage -- lingo syntax memberobjref.Trackcount() // javascript syntax memberobjref.Trackcount...

  • Page 1050

    1050 chapter 14: properties example this statement determines the number of tracks in the digital video sprite assigned to channel 10 and displays the result in the message window: -- lingo syntax put(sprite(10).Trackcount()) // javascript syntax trace(sprite(10).Trackcount()); trackenabled usage --...

  • Page 1051

    Trackpreviouskeytime 1051 example this statement determines the time of the keyframe that follows the current time in track 5 of the digital video assigned to sprite channel 15 and displays the result in the message window: -- lingo syntax put(sprite(15).Tracknextkeytime(5)) // javascript syntax put...

  • Page 1052

    1052 chapter 14: properties // javascript syntax put(sprite(15).Trackpreviouskeytime(5)); trackprevioussampletime usage -- lingo syntax spriteobjref.Trackprevioussampletime(whichtrack) // javascript syntax spriteobjref.Trackprevioussampletime(whichtrack); description digital video sprite property; i...

  • Page 1053

    Trackstoptime (member) 1053 trackstarttime (sprite) usage -- lingo syntax spriteobjref.Trackstarttime(whichtrack) // javascript syntax spriteobjref.Trackstarttime(whichtrack); description digital video sprite property; sets the starting time of a digital video movie in the specified sprite channel. ...

  • Page 1054

    1054 chapter 14: properties trackstoptime (sprite) usage -- lingo syntax spriteobjref.Trackstoptime(whichtrack) // javascript syntax spriteobjref.Trackstoptime(whichtrack); description digital video sprite property; returns the stop time of the specified track of the specified digital video sprite. ...

  • Page 1055

    Tracktype (sprite) 1055 // javascript syntax member("archives").Text = sprite(20).Tracktext(5).Tostring(); tracktype (member) usage -- lingo syntax memberobjref.Tracktype(whichtrack) // javascript syntax memberobjref.Tracktype(whichtrack); description digital video cast member property; indicates wh...

  • Page 1056

    1056 chapter 14: properties if sprite(10).Tracktype(5) = #text then textformat end if end // javascript syntax function checkfortext() { var tt = sprite(10).Tracktype(5); if (tt = "text") { textformat(); } } trails usage sprite(whichsprite).Trails the trails of sprite whichsprite description sprite ...

  • Page 1057

    Transform (property) 1057 for bones within models using the bonesplayer modifier, this property defaults in value to the transform assigned to the bone upon creation of the model file. The transform of a bone represents the bone’s rotation relative to its parent bone and its position relative to its...

  • Page 1058

    1058 chapter 14: properties see also interpolateto() , scale (transform) , rotation (transform) , position (transform) , bone , worldtransform , prerotate , prescale() , pretranslate() transitiontype usage member(whichcastmember).Transitiontype the transitiontype of member whichcastmember descriptio...

  • Page 1059

    Translation 1059 translation usage -- lingo syntax memberorspriteobjref.Translation // javascript syntax memberorspriteobjref.Translation; description quicktime cast member and sprite property; controls the offset of a quicktime sprite’s image within the sprite’s bounding box. This offset is express...

  • Page 1060

    1060 chapter 14: properties transparent usage member(whichcastmember).Shader(whichshader).Transparent member(whichcastmember).Model(whichmodel).Shader.Transparent member(whichcastmember).Model(whichmodel).Shaderlist\ [shaderlistindex].Transparent description 3d standard shader property; lets you get...

  • Page 1061

    Trimwhitespace 1061 example the following statement sets the callback handler for a quicktime vr sprite to the handler named myhotspotcallback when the playhead first enters the sprite span. Every time that hotspot is triggered, the myhotspotcallback handler is executed. When the playhead leaves the...

  • Page 1062

    1062 chapter 14: properties tunneldepth usage member(whichtextmember).Tunneldepth member(whichcastmember).Modelresource(whichextrudermodel\ resource).Tunneldepth description a 3d extruder model resource property, as well as a text cast member property. Using this property allows you to get or set th...

  • Page 1063

    Type (light) 1063 tweenmode usage member(whichcastmember).Modelresource(whichmodelresource).Tweenmode modelresourceobjectreference.Tweenmode description 3d particle property; allows you to get or set whether the color of a particle varies according to it’s speed or age. The tweenmode property can ha...

  • Page 1064

    1064 chapter 14: properties type (member) usage -- lingo syntax memberobjref.Type // javascript syntax memberobjref.Type; description member property; indicates a cast member’s type. Read-only. The type property can be one of the following values: this list includes those types of cast members that ...

  • Page 1065

    Type (model resource) 1065 // javascript syntax function checkformat() { if (member("today’s news").Type != "field") { _player.Alert("sorry, this cast member must be a field."); } } see also member type (model resource) usage member(whichcastmember).Modelresource(whichmodelresource).Type description...

  • Page 1066

    1066 chapter 14: properties type (motion) usage member(whichcastmember).Motion(whichmotion).Type description 3d motion property; the motion type of the referenced motion object. This property’s possible values are: • #bonesplayer indicates that this motion is a bones based animation and it requires ...

  • Page 1067

    Type (texture) 1067 type (sprite) usage sprite(whichsprite).Type the type of sprite whichsprite description sprite property; clears sprite channels during score recording by setting the type sprite property value for that channel to 0. Note: switch the member of a sprite only to another member of th...

  • Page 1068

    1068 chapter 14: properties type (window) usage -- lingo syntax windowobjref.Type // javascript syntax windowobjref.Type; description window property; specifies the window type. Read/write. If the type property is set, all properties pertaining to the new window are set accordingly. This property ca...

  • Page 1069

    Updatemovieenabled 1069 updatelock usage -- lingo syntax _movie.Updatelock // javascript syntax _movie.Updatelock; description movie property; determines whether the stage is updated during score recording ( false ) or not ( true ). Read/write. You can keep the stage display constant during a score ...

  • Page 1070

    1070 chapter 14: properties url usage -- lingo syntax memberobjref.Url // javascript syntax memberobjref.Url; description cast member property; specifies the url for shockwave audio (swa) and flash movie cast members. For flash movie members, this property is synonymous with the pathname member prop...

  • Page 1071

    Usediffusewithtexture 1071 example this toggles the alpha channel of cast member “foreground” on and off: -- lingo syntax member("foreground").Usealpha = not(member("foreground").Usealpha) // javascript syntax switch(member("foreground").Usealpha) { case 0: member("foreground").Usealpha = 1; break; ...

  • Page 1072

    1072 chapter 14: properties usefastquads usage -- lingo syntax _movie.Usefastquads // javascript syntax _movie.Usefastquads; description movie property; determines whether to use faster ( true ) or slower ( false , default) quad calculation operations. Read/write. When set to true , director uses a ...

  • Page 1073

    Userdata 1073 example this behavior toggles the formatting of hypertext on and off in text cast member “mytext”: --lingo syntax on mouseup member("mytext").Usehypertextstyles = \ not(member("mytext").Usehypertextstyles) end // javascript syntax function mouseup() { member("mytext").Usehypertextstyle...

  • Page 1074

    1074 chapter 14: properties to modify the elements of this list you must use the addprop and deleteprop commands documented in the main lingo dictionary. Example this statement displays the userdata property of the model named new body: put member("car").Model("new body").Userdata -- [#driver: "bob"...

  • Page 1075

    Username (realmedia) 1075 username (realmedia) usage -- lingo syntax memberorspriteobjref.Username // javascript syntax memberorspriteobjref.Username; description realmedia sprite and cast member property; allows you to set the user name required to access a protected realmedia stream. For security ...

  • Page 1076

    1076 chapter 14: properties usetargetframerate usage sprite(which3dsprite).Usetargetframerate description 3d sprite property; determines whether the targetframerate property of the sprite is enforced. If the usetargetframerate property is set to true , the polygon count of the models in the sprite a...

  • Page 1077

    Vertexlist 1077 // javascript syntax member("archie").Vertex[2].Handle1 = point(-63.0000, -16.0000); see also vertexlist vertexlist usage -- lingo syntax memberobjref.Vertexlist // javascript syntax memberobjref.Vertexlist; description cast member property; returns a linear list containing property ...

  • Page 1078

    1078 chapter 14: properties see also addvertex() , count() , deletevertex() , movevertex() , movevertexhandle() , originmode , vertex vertexlist (mesh generator) usage member(whichcastmember).Modelresource(whichmodelresource).Vertexlist description 3d property; when used with a model resource whose ...

  • Page 1079

    Video (quicktime, avi) 1079 vertices usage member(whichcastmember).Modelresource(whichmodelresource).\ face[faceindex].Vertices description 3d face property; when used with a model resource whose type is #mesh , this property allows you to get or set which vertices from the resource’s vertexlist pro...

  • Page 1080

    1080 chapter 14: properties video (realmedia, windows media) usage -- lingo syntax memberorspriteobjref.Video // javascript syntax memberorspriteobjref.Video; description realmedia and windows media property; allows you to set or get whether the sprite or cast member renders video ( true or 1) or on...

  • Page 1081

    Viewh 1081 possible symbols include the following: see also dvd videoforwindowspresent usage the videoforwindowspresent description system property; indicates whether avi software is present on the computer. This property can be tested but not set. Example this statement checks whether video for win...

  • Page 1082

    1082 chapter 14: properties example this handler accepts a sprite reference as a parameter and moves the view of a flash movie sprite from left to right within the sprite’s bounding rectangle: -- lingo syntax on panright whichsprite repeat with i = 120 down to -120 sprite(whichsprite).Viewh = i _mov...

  • Page 1083

    Viewscale 1083 director point values specified for the viewpoint property are restricted to integers, whereas viewh and viewv can be specified with floating-point numbers. When you test the viewpoint property, the point values are truncated to integers. As a general guideline, use the viewh and view...

  • Page 1084

    1084 chapter 14: properties one significant difference between the viewscale and scale properties is that viewscale always scales from the center of the sprite’s bounding rectangle, whereas scale scales from a point determined by the flash movie’s originmode property. This property can be tested and...

  • Page 1085

    Visible 1085 example this handler accepts a sprite reference as a parameter and moves the view of a flash movie sprite from the top to the bottom within the sprite’s bounding: rectangle: -- lingo syntax on pandown(whichsprite) repeat with i = 120 down to -120 sprite(whichsprite).Viewv = i _movie.Upd...

  • Page 1086

    1086 chapter 14: properties visible (sprite) usage sprite(whichsprite).Visible the visible of sprite whichsprite description sprite property; determines whether the sprite specified by whichsprite is visible ( true ) or not ( false ). This property affects all sprites in the channel, regardless of t...

  • Page 1087

    Volume (sound channel) 1087 volume (dvd) usage -- lingo syntax dvdobjref.Volume // javascript syntax dvdobjref.Volume; description dvd property. Determines the current dvd sound volume . Read/write. The volume must be an integer in the range of 0 (silent) to 100 (full volume). On windows the volume ...

  • Page 1088

    1088 chapter 14: properties sound channels are numbered 1, 2, 3, and so on up to 8. Channels 1 and 2 are the channels that appear in the score. The value of the volume property ranges from 0 (mute) to 255 (maximum volume). A value of 255 indicates the full volume set for the machine, as controlled b...

  • Page 1089

    Warpmode 1089 volume (windows media) usage -- lingo syntax windowsmediaobjref.Volume // javascript syntax windowsmediaobjref.Volume; description windows media sprite property; determines the volume of a windows media sprite. The value of this property is an integer that ranges from 0 (mute) to 7 (lo...

  • Page 1090

    1090 chapter 14: properties width usage -- lingo syntax memberobjref.Width imageobjref.Width spriteobjref.Width // javascript syntax memberobjref.Width; imageobjref.Width; spriteobjref.Width; description member, image, and sprite property; for vector shape, flash, animated gif, realmedia, windows me...

  • Page 1091

    Wind 1091 width (3d) usage member(whichcastmember).Modelresource(whichmodelresource).Width modelresourceobjectreference.Width description 3d property; allows you to get or set the width of the plane for a model resource whose type is #box or #plane . This property must be greater than 0.0, and has a...

  • Page 1092

    1092 chapter 14: properties example put member("3d").Modelresource("fog bank").Wind -- vector(10.5,0,0) window usage -- lingo syntax _player.Window[windownameornum] // javascript syntax _player.Window[windownameornum]; description player property; provides indexed or named access to the window objec...

  • Page 1093

    Windowlist 1093 // javascript syntax var backwindow = _player.Windowlist[5].Windowbehind; backwindow.Movetofront(); see also movetoback() , movetofront() , window , windowinfront , windowlist windowinfront usage -- lingo syntax windowobjref.Windowinfront // javascript syntax windowobjref.Windowinfro...

  • Page 1094

    1094 chapter 14: properties // javascript syntax trace(_player.Windowlist); see also player wordwrap usage -- lingo syntax memberobjref.Wordwrap // javascript syntax memberobjref.Wordwrap; description cast member property; determines whether line wrapping is allowed ( true ) or not ( false ). Exampl...

  • Page 1095

    Wraptransform 1095 worldtransform usage member(whichmember).Model(whichmodel).Bonesplayer.Bone[index].\ worldtransform description 3d bonesplayer property; allows you to get the world relative transform of a specific bone, as opposed to using the transform property which returns the bone’s parent re...

  • Page 1096

    1096 chapter 14: properties wraptransformlist usage member( whichcastmember ).Shader( shadername ).Wraptransformlist\ [ texturelayerindex ] member( whichcastmember ).Shader[ shaderlistindex ].\ wraptransformlist[ texturelayerindex ] member( whichcastmember ).Model( modelname ).\ shader.Wraptransform...

  • Page 1097

    Xtra 1097 xaxis usage member(whichcastmember).Transform.Xaxis description 3d transform property; allows you to get but not set the vector representing the transform’s canonical x-axis in transform space. Example the first line of this example sets the transform of the model modcylinder to the identi...

  • Page 1098

    1098 chapter 14: properties xtralist (movie) usage -- lingo syntax _movie.Xtralist // javascript syntax _movie.Xtralist; description movie property; displays a linear property list of all xtra extensions in the movies/xtras dialog box that have been added to the movie. Read-only. Two possible proper...

  • Page 1099

    Yaxis 1099 there are two possible properties that can appear in xtralist : • #filename —specifies the filename of the xtra extension on the current platform. It is possible to have a list without a #filename entry, such as when the xtra extension exists only on one platform. • #version —specifies th...

  • Page 1100

    1100 chapter 14: properties example the first line of this example sets the transform of the model modcylinder to the identity transform. The next two lines show that the y axis of modcylinder is the vector (0.0000, 1.0000, 0.0000). This means that the y-axis of modcylinder is aligned with the y-axi...

  • Page 1101

    Zaxis 1101 zaxis usage member(whichcastmember).Transform.Zaxis description 3d transform property; allows you to get but not set the vector representing the transform’s canonical z-axis in transform space. Example the first line of this example sets the transform of the model modcylinder to the ident...

  • Page 1102

    1102 chapter 14: properties.

  • Page 1103: Index

    1103 index symbols " (quotation mark) 155 " (string constant) 151 # (symbol definition operator) 484, 595 # (symbol) data type 16 & (concatenation operator) 598 && (concatenation operator) 599 () (parentheses operator) 600 * (multiplication operator) 601, 603 + (addition operator) 602 - (minus opera...

  • Page 1104

    1104 index allowtransportcontrol property 629 allowvolumecontrol property 629 allowzooming property 630 alphathreshold property 630 ambient property 630 ambientcolor property 631 ampersand operators (& or &&) 598, 599 ancestor property 631 ancestor scripting 56 ancestor, sending messages to 252 and ...

  • Page 1105

    Index 1105 bitmaps picture of member property 446 trimming white space 1061 bitmapsizes property 655 bitnot() method 244 bitor() method 244 bitrate property 655 bitspersample property 656 bitxor() method 245 blend (3d) property 656 blend property 657 blend range, end and start 662 blendconstant prop...

  • Page 1106

    1106 index cast members borders 834 copying 273 creating 416 duration of 746 font used to display 780 line spacing for 833 lines in 832 loctocharpos function 385 locvtolinepos function 386 media in cast member tracks 1055 palettes associated with 909, 910 picturep function 446 preloading 934 shockwa...

  • Page 1107

    Index 1107 item... Of keyword 210 last function 379 line...Of keyword 211 put...After command 218 put...Before command 219 put...Into command 219 selecting words in 226 word...Of keyword 226 chunksize property 688 class methods 70 class variables 70 classes, javascript custom 66 defining 71 clearaso...

  • Page 1108

    1108 index controller property 707 converting ascii codes to characters 432 characters to ascii codes 259 duration in time to frames 357 expressions to floating-point numbers 317 frames to duration in time 320 copying cast members 273 lists 43, 46, 299 scripts 81 copypixels() method 271 copyrightinf...

  • Page 1109

    Index 1109 deletegroup method 288 deletelight method 289 deletemodel method 289 deletemodelresource method 290 deletemotion method 290 deleteone method 291 deleteprop method 291 deleteshader method 292 deletetexture method 292 deletevertex() method 293 deleting array items 45 behaviors 80 child obje...

  • Page 1110

    1110 index duplicate() (image) method 298 duplicate() (list function) method 299 duplicate() (member) method 299 duplicateframe() method 300 duration (3d) property 745 duration (dvd) property 746 duration (member) property 746 duration (realmedia) property 747 dvd object 123 dvdeventnotification han...

  • Page 1111

    Index 1111 field cast members field keyword 207 font size of 781 font style of 781 height of lines in 382 installing menus defined in 369 lineheight function 382 lineheight of member property 833 loctocharpos function 385 locvtolinepos function 386 position of lines in 382 scrolling 519, 520, 978 st...

  • Page 1112

    1112 index frames attaching behaviors 80 behaviors, creating 79 converting duration in time to 357 converting to duration in time 320 framestohms function 320 hmstoframes function 357 listing frame labels 824 on enterframe handler 169 on exitframe handler 172 on prepareframe handler 189 on stepframe...

  • Page 1113

    Index 1113 list of 159 marking end of 206 messages, receiving 35 on keyword 216 order of execution 33 parameters 36 parentheses 13 placing 35 result function 508 results from 37 return keyword 223 handlers() method 355 hardware information, getting 332 height lineheight function 382 of lines in fiel...

  • Page 1114

    1114 index invertmask property 815 isinworld() method 375 ispastcuepoint() method 376 isvrmovie property 816 item... Of keyword 210 itemdelimiter property 817 items, separating 817 j java terminology 55 javascript arrays 45 case-sensitivity 15 class methods 70 class variables 70 classes, defining 71...

  • Page 1115

    Index 1115 less than operator ( less than or equal to operator ( level of detail (lod) modifier properties 839 level property 830 lifetime property 831 light object 144 light property 831 light() method 381 lights ambient light 731 attenuation property 640 directional light 735 line spacing for cast...

  • Page 1116

    1116 index multidimensional 44, 47 position of properties in property lists 314 replacing property values from 526, 535 setaprop command 526 setat command 527 setprop command 535 setting and retrieving items 39 sorting 44, 47, 544 syntax 38 types of 361, 384 value of parameters in 438 literal quotat...

  • Page 1117

    Index 1117 member property 853 member() method 394 memory allocated to program 857 free 322, 323, 857 preloading cast members 934 size of free blocks 322 memorysize property 857 menu item properties enabled of menuitem 752 name of menuitem 884 menu items selecting 752 setting text in 884 menu keywor...

  • Page 1118

    1118 index mouseh property 872 mouseitem property 873 mouselevel property 874 mouseline property 875 mouseloc property 876 mousemember property 876 mouseoverbutton property 877 mouseup property 878 mouseupscript property 879 mousev property 879 mouseword property 880 move() method 405 moveablesprite...

  • Page 1119

    Index 1119 normalize method 429 normallist property 892 normals 324, 397, 429 normals property 892 not equal operator () 605 not logical operator 614 nothing method 430 nudge method 431 null data type 16 number (cast) property 893 number (characters) property 893 number (items) property 894 number (...

  • Page 1120

    1120 index openfile() method 437 opening applications 435 mime files 353 shockwave movies 353 openxlib method 437 operators arithmetic 26 assignment 27 comparison 26 definition of 11 javascript 595 lingo 595 logical 27 precedence of 25 string 28 types of 25 option-return character (\) 203 optiondown...

  • Page 1121

    Index 1121 percentstreamed property 920 period property 921 perpendicularto method 446 persistent property 921 pi constant 154 picture (member) property 922 picture (window) property 923 picturep() method 446 platform property 923 play() (3d) method 447 play() (dvd) method 448 play() (realmedia, win...

  • Page 1122

    1122 index property variables 219 property variables, declaring 57 proplist() method 476 prototype objects 68, 72 proxy servers, setting values of 477 proxyserver method 477 pttohotspotid() method 477 puppetpalette() method 478 puppetsprite() method 479 puppettempo() method 480 puppettransition() me...

  • Page 1123

    Index 1123 repeat with...Down to keyword 221 repeat with...In list keyword 222 syntax 31 repeat while keyword 220 resetworld method 506 resizable property 954 resolution 955, 956 resolution (3d) property 955 resolution (dvd) property 955 resolve property 956 resolvea method 506 resolveb method 507 r...

  • Page 1124

    1124 index in linked movies 977 indenting 77 inserting line breaks 76 invoking handlers in 250 lingo vs. Javascript 49 linked 81, 383 message window 90 movie 80 object-oriented programming 54 objects created by parent scripts 433 order of execution 28 parent. See parent scripts removing 80 script nu...

  • Page 1125

    Index 1125 shutdown() method 543 silhouettes property 990 sin() method 543 size chunksize of member property 688 linesize of member property 834 of cast members 688 of free blocks of memory 322 size property 991 sizerange property 991 sizestate property 992 sizing rectangles and points 389 skew prop...

  • Page 1126

    1126 index statements, if...Then...Else 209 static methods 70 static property 1014 static variables 70 staticquality property 1015 status property 1015 status() method 550 step into button, uses for 98 step script button, debugger window 97 stilldown property 1016 stop (flash) method 552 stop() (dvd...

  • Page 1127

    Index 1127 numbers 18 object-oriented programming 54 operators 25 repeat loops 31 rules 12 strings 18 symbols 20 troubleshooting 84 system events, relaying to child objects 64 system object 115 system properties floatprecision 778 multisound 882 systemtrayicon property 1024 systemtraytooltip propert...

  • Page 1128

    1128 index timeoutlist property 63 timeoutlist property 1041 timescale property 1042 title (dvd) property 1042 title (window) property 1042 titlebaroptions property 1043 titlecount property 1044 titlemenu() method 565 toolxtralist property 1044 toon (modifier) property 1045 top (3d) method 565 top p...

  • Page 1129

    Index 1129 updatestage() method 575 updating score 242 uppercase letters 15, 18 url property 1070 urlencode method 576 usealpha property 1070 usediffusewithtexture property 1071 usefastquads property 1072 usehypertextstyles property 1072 uselineoffset property 1073 userdata property 1073 username (r...

  • Page 1130

    1130 index windowinfront property 1093 windowlist property 1093 windowpresent() method 590 windows displaying strings in browser windows 415 forget method 319 minimize() method 399 on activatewindow handler 160 on closewindow handler 162 on deactivatewindow handler 164 on movewindow handler 187 on o...