MACROMEDIA DIRECTOR MX-LINGO DICTIONARY Manual

Summary of DIRECTOR MX-LINGO DICTIONARY

  • Page 1

    Lingo dictionary macromedia director mx.

  • Page 2

    Trademarks afterburner, appletace, attain, attain enterprise learning system, attain essentials, attain objects for dreamweaver, authorware, authorware attain, authorware interactive studio, authorware star, authorware synergy, backstage, backstage designer, backstage desktop studio, backstage enter...

  • Page 3

    3 chapter 1 lingo by feature this chapter lists various macromedia director mx features and the corresponding lingo elements that you can use to implement those features. Accessibility these terms are useful for making movies accessible to the disabled: text-to-speech keyboard navigation voicecount(...

  • Page 4

    Chapter 1 4 animated gifs these terms are useful for working with animated gifs: animation these terms are useful for creating animation with lingo: behaviors the terms in this section are useful for authoring behaviors and using behaviors while the movie plays. Authoring behaviors use these terms t...

  • Page 5

    Lingo by feature 5 bitmaps the terms in this section are useful for working with bitmaps. Bitmap properties use these terms to check and set bitmap properties: alpha channel use these terms to control alpha channel effects: image objects use these terms to create and control image objects: buttons s...

  • Page 6

    Chapter 1 6 cast members the terms in this section are useful for working with cast members. Creating cast members use importfileinto and new() to create cast members. Authoring use duplicate member , erase member , and pasteclipboardinto to work with cast members during authoring. Graphic cast memb...

  • Page 7

    Lingo by feature 7 cast management use these terms to manage casts: computer and operating system use these terms to check and control the computer: operating system control use restart and shutdown to control the operating system. Data types these terms are useful for specifying data types: digital...

  • Page 8

    Chapter 1 8 quicktime use these terms to work with quicktime: realmedia video use these terms to with realmedia video: movietime tracktype (cast member property) pausedatstart (flash, digital video) tracktype (sprite property) quicktimeversion() trackcount (cast member property) timescale trackcount...

  • Page 9

    Lingo by feature 9 events use these event handlers for lingo that runs when a specific event occurs: use the pass and stopevent commands to override the way that director passes messages along the message hierarchy. External files the terms in this section are useful for working with external files....

  • Page 10

    Chapter 1 10 managing external files use these terms to manage external files: flash these terms are useful for working with flash cast members: closexlib showxlib open sound playfile openxlib actionsenabled originv broadcastprops pathname (movie property) buffersize pausedatstart (flash, digital vi...

  • Page 11

    Lingo by feature 11 these terms are useful for working with global flash objects, which do not require a flash cast member: frames the lingo terms in this section let you work with frames. Frame events use the on enterframe , on exitframe , and on prepareframe event handlers to contain lingo that ru...

  • Page 12

    Chapter 1 12 interface elements the lingo terms in this section are useful for working with interface elements. Menus use these terms to create menus: buttons and check boxes use these terms to specify buttons and check boxes: keys the lingo terms in this section are related to using the keyboard. I...

  • Page 13

    Lingo by feature 13 lingo the lingo terms in this section are important language elements that you use to construct scripts. Boolean values use these terms to test whether a condition exists: • false ( 0 is the numerical equivalent of false ). • true ( 1 is the numerical equivalent of true ). • not ...

  • Page 14

    Chapter 1 14 lists the terms in this section are useful for working with lists. Creating lists use [ ] (list) , duplicate() (list function) , or list() to create a list. Adding list items use these terms to add items to a list: deleting list items use these terms to delete items from a list: retriev...

  • Page 15

    Lingo by feature 15 media synchronization use these terms to synchronize animation and sound: memory management the terms in this section are useful for determining memory requirements and controlling when the movie loads and unloads cast members. Idle events use the on idle event handler for lingo ...

  • Page 16

    Chapter 1 16 memory requirements use ramneeded() and size to determine how much memory required for a cast member or a range of frames. Menus see menus in the interface elements section. Message window use these terms to work in the message window: monitor use colordepth , desktoprectlist , and swit...

  • Page 17

    Lingo by feature 17 mouse events use these terms to set up handlers that respond to mouse events: cursor control use cursor (command) , cursor (sprite property) , and cursorsize to control the pointer (cursor). Movies in a window the terms in this section are useful for working with movies in a wind...

  • Page 18

    Chapter 1 18 communication between movies use the tell command to send messages between movies. Movies the terms in this section are useful for managing movies. Stopping movies use these terms to stop or quit the movie or projector: movie information use these terms to obtain information about the m...

  • Page 19

    Lingo by feature 19 multiuser server director mx users should use macromedia flash communication server mx for communication among director movies and with application servers. For more information about using flash communication server mx, see using flash communication server mx in using director. ...

  • Page 20

    Chapter 1 20 working with the local computer use these terms to work with the user’s computer: browsers use on evalscript , externalevent , and netstatus to interact with browsers. For additional information about browser scripting using languages such as javascript, see “shockwave publishing” on th...

  • Page 21

    Lingo by feature 21 parent scripts use these terms to work with parent scripts and child objects: points and rectangles these terms are useful for checking and setting points and rectangles. For lingo that controls a sprite’s bounding rectangle, see sprite dimensions. Projectors these terms are usef...

  • Page 22

    Chapter 1 22 score the following terms let you work with the score. Score properties use lastframe , score , and scoreselection to work with the movie’s score. Score generation use these terms to create score content from lingo: shapes use these lingo terms to work with shapes: shockwave audio use t...

  • Page 23

    Lingo by feature 23 sound the terms in this section are useful for playing sounds. Sound information use these terms to get information about a sound: playing sound use these terms to control how sound plays: realmedia sound see digital video. Sprites the lingo terms in this section are for sprites....

  • Page 24

    Chapter 1 24 rotating sprites use the rotation sprite property to rotate sprites. Dragging sprites use these terms to set how the user can drag sprites: sprites and lingo use these terms to manage how lingo controls sprites: drawing sprites on the stage use these terms to control how director draws ...

  • Page 25

    Lingo by feature 25 sprite color use these terms to check and set a sprite’s color: stage these terms are useful for controlling the stage and determining its size and location: tempo use the puppettempo command to control a movie’s tempo. Text the terms in this section are useful for working with t...

  • Page 26

    Chapter 1 26 editable text use the editable property to specify whether text is editable. Shocked fonts use these terms to include shocked fonts with downloaded text: character formatting use these terms to format text: paragraph formatting use these terms to format paragraphs: text cast member prop...

  • Page 27

    Lingo by feature 27 mouse pointer position in text use these terms to detect where the mouse pointer is within text: text boxes for field cast members use these terms to set up the box for a field cast member: scrolling text use these terms to work with scrolling text: constants use these terms to w...

  • Page 28

    Chapter 1 28 measuring time use these terms to measure time in a movie: timeouts use these terms to handle timeouts: transitions use these terms to work with transitions: variables the terms in this section are useful for creating and changing variables: creating variables use these terms to create ...

  • Page 29

    Lingo by feature 29 vector shapes use these lingo terms to work with vector shapes: xml parsing the following lingo is useful for xml parsing within director. Addvertex gradienttype antialias imageenabled backgroundcolor movevertex() broadcastprops movevertexhandle() centerregpoint originh closed or...

  • Page 30

    Chapter 1 30 xtra extensions use these terms to work with xtra extensions: moviextralist xtra name (system property) xtralist number of xtras xtras.

  • Page 31

    31 chapter 2 3d lingo by feature this chapter lists the various 3d features of macromedia director mx and the corresponding lingo elements that you can use to implement those features. Animation use these terms to work with 3d animation. See also the lists of terms for the keyframe player and bones ...

  • Page 32

    Chapter 2 32 backdrops and overlays use these terms to manipulate backdrops and overlays in 3d cast members: bones player modifier use these terms to control the functionality of the bones player modifier: cameras use these terms to work with cameras and camera properties: addbackdrop regpoint (3d) ...

  • Page 33

    3d lingo by feature 33 child and parent nodes use these terms to control parent-child relationships between models: collision detection these terms are useful for detecting and responding to collisions between models: creating and removing objects use these terms to create and remove objects: count ...

  • Page 34

    Chapter 2 34 fog use these terms to work with fog: groups use these terms to work with groups: inker modifier use these terms to control the functionality of the inker modifier: clonemotionfromcastmember newshader deletecamera newtexture deletegroup removemodifier deletelight removebackdrop deletemo...

  • Page 35

    3d lingo by feature 35 keyframe player modifier use these terms to control the functionality of the keyframe player modifier: level of detail modifier use these terms to control the functionality of the level of detail (lod) modifier: lights use these terms to work with lights and light properties: ...

  • Page 36

    Chapter 2 36 mesh deform modifier use these terms to control the functionality of the mesh deform modifier: miscellaneous model resources use these terms to work with 3d model resources: models use these terms to work with 3d models: add (3d texture) normallist face texturecoordinatelist mesh (prope...

  • Page 37

    3d lingo by feature 37 modifiers these terms are useful for applying modifiers to models and model resources. See the name of the specific modifier you are using for a list of terms that work with that modifier. Movie and system properties use these terms to determine the 3d capabilities of the play...

  • Page 38

    Chapter 2 38 primitives the following sections list the terms used to work with each type of primitive. Use the primitives property to determine which types of primitives are supported by the current 3d renderer. Boxes use these terms to control properties of 3d boxes: cylinders use these terms to c...

  • Page 39

    3d lingo by feature 39 planes use these terms to control properties of 3d planes: spheres use these terms to control properties of 3d spheres: selecting models use these terms to enable individual models in a 3d cast member to be selected and respond to mouse clicks. This is also known as picking. S...

  • Page 40

    Chapter 2 40 engraver shader use these terms to work with the engraver shader: newsprint shader use these terms to work with the newsprint shader: painter shader use these terms to work with the painter shader: sprites (3d) use these terms to control properties of 3d sprites: streaming use these ter...

  • Page 41

    3d lingo by feature 41 subdivision surfaces modifier use these terms to control the functionality of the subdivision surfaces (sds) modifier: text (3d) use these terms to control the appearance of 3d text: textures use these terms to work with textures: toon modifier use these terms to control the f...

  • Page 42

    Chapter 2 42 transforms use these terms to work with transforms: vector math use these terms to perform vector math operations: duplicate prerotate getworldtransform() prescale() identity() pretranslate() interpolate() rotate interpolateto() rotation (transform) inverse() scale (transform) invert() ...

  • Page 43

    43 chapter 3 lingo dictionary this dictionary describes the syntax and use of lingo elements in macromedia director mx. Nonalphabetical operators are presented first, followed by all other operators in alphabetical order. The entries in this dictionary are the same as those in director help. To use ...

  • Page 44

    Chapter 3 44 all symbols, global variables, and names of parameters passed to global variables are stored in a common lookup table. Example this statement sets the state variable to the symbol #playing : state = #playing see also ilk() , string() , symbol() , symbolp() . (dot operator) syntax object...

  • Page 45

    Lingo dictionary 45 examples (negation): this statement reverses the sign of the expression 2 + 3: put -(2 + 3) the result is -5. (subtraction) : this statement subtracts the integer 2 from the integer 5 and displays the result in the message window: put 5 - 2 the result is 3, which is an integer. (...

  • Page 46

    Chapter 3 46 for example, the open window command allows one argument that specifies which window to open. If you use the & operator to define a pathname and filename, director interprets only the string before the & operator as the filename. For example, lingo interprets the statement open window t...

  • Page 47

    Lingo dictionary 47 () (parentheses) syntax (expression) description grouping operator; performs a grouping operation on an expression to control the order of execution of the operators in an expression. This operator overrides the automatic precedence order so that the expression within the parenth...

  • Page 48

    Chapter 3 48 this statement multiplies the floating-point numbers 2.0 and 3.1414 and displays the result in the message window: put 2.0 * 3.1416 the result is 6.2832, which is a floating-point number. + (addition) syntax expression1 + expression2 description math operator; performs an arithmetic sum...

  • Page 49

    Lingo dictionary 49 vector1 - vector2 subtracts the values of vector2 from the corresponding components in vector1 and returns a new vector. Vector - scaler subtracts the value of the scalar from each of the components in the vector and returns a new vector. * (multiplication) syntax vector1 * vecto...

  • Page 50

    Chapter 3 50 / (division) (3d) syntax vector / scalar description 3d vector operator; divides each of the vector components by the scalar value and returns a new vector. Syntax expression1 expression2 description comparison operator; compares two expressions and determines whether expression1 is les...

  • Page 51

    Lingo dictionary 51 = (equals) syntax expression1 = expression2 description comparison operator; compares two expressions, symbols, or objects and determines whether expression1 is equal to expression2 ( true ), or whether expression1 is not equal to expression2 ( false ). This operator can compare ...

  • Page 52

    Chapter 3 52 [ ] (bracket access) syntax textexpression[chunknumberbeingaddressed] textexpression[firstchunk..Lastchunk] description operator; allows a chunk expression to be addressed by number. Useful for finding the nth chunk in the expression. The chunk can be a word, line, character, paragraph,...

  • Page 53

    Lingo dictionary 53 lingo treats an instance of a list as a reference to the list. This means each instance is the same piece of data, and changing it will change the original. Use the duplicate command to create copies of lists. Lists are automatically disposed when they are no longer referred to b...

  • Page 54

    Chapter 3 54 " (string) syntax " description string constant; when used before and after a string, quotation marks indicate that the string is a literal—not a variable, numerical value, or lingo element. Quotation marks must always surround literal names of cast members, casts, windows, and external...

  • Page 55

    Lingo dictionary 55 identify the current movie’s folder by using the @ symbol followed by one of these pathname separators: • / (forward slash) • \ (backslash) • : (colon) when a movie is queried to determine its location, the string returned will include the @ symbol. Be sure to use only the @ symb...

  • Page 56

    Chapter 3 56 abbr, abbrev, abbreviated these elements are used by the date and time functions. See also date() (system clock) abort syntax abort description command; tells lingo to exit the current handler and any handler that called it without executing any of the remaining statements in the handle...

  • Page 57

    Lingo dictionary 57 actionsenabled syntax the actionsenabled of sprite whichflashsprite the actionsenabled of member whichflashmember sprite whichflashsprite.Actionenabled member whichflashmember.Actionenabled description cast member property and sprite property; controls whether the actions in a fl...

  • Page 58

    Chapter 3 58 on activatewindow syntax on activatewindow statement(s) end description system message and event handler; contains statements that run in a movie when the user clicks the inactive window and the window comes to the foreground. You can use an on activatewindow handler in a script that yo...

  • Page 59

    Lingo dictionary 59 activecastlib syntax the activecastlib description system property; indicates which cast was most recently activated. The activecastlib property’s value is the cast’s number. The activecastlib property is useful when working with the selection castlib property. Use it to determin...

  • Page 60

    Chapter 3 60 description movie property; a list of child objects that have been explicitly added to this list. Objects in actorlist receive a stepframe message each time the playhead enters a frame. To add an object to the actorlist , use add actorlist, theobject . The object’s on stepframe handler ...

  • Page 61

    Lingo dictionary 61 add (3d texture) syntax member(whichcastmember).Model(whichmodel).Meshdeform.Mesh[index].\ texturelayer.Add() 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: mod...

  • Page 62

    Chapter 3 62 examples the first line of this statement creates a texture named rough from the cast member named cedar and stores it in the variable t1. The second line applies the texture as a backdrop at the point (220, 220) within sprite 5. The texture has a rotation of 0 degrees. The last line ap...

  • Page 63

    Lingo dictionary 63 examples this statement adds the model named tire to the list of children of the model named car. Member("3d").Model("car").Addchild(member("3d").Model("tire")) this statement adds the model named bird to the list of children of the camera named mycamera and uses the #preservewor...

  • Page 64

    Chapter 3 64 addoverlay syntax sprite(whichsprite).Camera{(index)}.Addoverlay(texture, \ locwithinsprite, rotation) member(whichcastmember).Camera(whichcamera).Addoverlay(texture, \ locwithinsprite, rotation) description 3d camera command; adds an overlay to the end of the camera’s list of overlays....

  • Page 65

    Lingo dictionary 65 addtoworld syntax member(whichcastmember).Model(whichmodel).Addtoworld() member(whichcastmember).Group(whichgroup).Addtoworld() member(whichcastmember).Camera(whichcamera).Addtoworld() member(whichcastmember).Light(whichlight).Addtoworld() description 3d command; inserts the mode...

  • Page 66

    Chapter 3 66 alert syntax alert message description command; causes a system beep and displays an alert dialog box containing the string specified by message and an ok button. This command is useful for providing error messages of up to 255 characters in your movie. The message must be a string. If ...

  • Page 67

    Lingo dictionary 67 the fourth argument can have 1 of these 4 values: • #alert - causes the handler to be triggered by the alert command. • #movie - causes the handler to be triggered by a file not found error while perforoming a go to movie command. • #script - causes the handler to be triggered by...

  • Page 68

    Chapter 3 68 dot syntax: characteralign = member("rokujo speaks").Alignment verbose syntax: set characteralign = the alignment of member "rokujo speaks" this repeat loop consecutively sets the alignment of the field cast member rove to left, center, and then right. Dot syntax: repeat with i = 1 to 3...

  • Page 69

    Lingo dictionary 69 allowsavelocal syntax the allowsavelocal description movie property; sets the availability of the save control in the context menu when playing the movie in a shockwave environment. This property is provided to allow for enhancements in future versions of shockwave. This property...

  • Page 70

    Chapter 3 70 allowzooming syntax the allowzooming description movie property; determines whether the movie may be stretched or zoomed by the user when playing back in shockwave and shockmachine. Defaults to true . This property can be tested and set. Set this property to false to prevent users from ...

  • Page 71

    Lingo dictionary 71 example this statement sets the ambient property of the model named chair to rgb(255, 255, 0) . Chair will fully reflect the red and green components of the ambient light in the scene and completely ignore its blue component. Member("room").Model("chair").Shader.Ambient = rgb(255...

  • Page 72

    Chapter 3 72 the ancestor script can contain independent property variables that can be obtained by child objects. To refer to property variables within the ancestor script, you must use this syntax: me.Propertyvariable = value for example, this statement changes the property variable legcount withi...

  • Page 73

    Lingo dictionary 73 the result is 1, which is the numerical equivalent of true . The first logical expression in the following statement is true ; and the second logical expression is false . Because both logical expressions are not true , the logical operator displays the result 0, which is the num...

  • Page 74

    Chapter 3 74 animationenabled syntax member(whichcastmember).Animationenabled description 3d cast member property; indicates whether motions will be executed ( true ) or ignored ( false ). This property can also be set in the property inspector. The default value for this property is true . Example ...

  • Page 75

    Lingo dictionary 75 description this property indicates whether the 3d world in the sprite whichsprite is anti-aliased. It can be tested and set. The default value is false , indicating that anti-aliasing is off. If the antialiasingenabled property is set to true and the 3d renderer changes to a ren...

  • Page 76

    Chapter 3 76 antialiasthreshold syntax member(whichtextmember).Antialiasthreshold description text cast member property; this setting controls the point size at which automatic anti-aliasing takes place in a text cast member. This has an effect only when the antialias property of the text cast membe...

  • Page 77

    Lingo dictionary 77 examples this statement displays the pathname for the folder that contains the director application. Put the applicationpath --"z:\program files\macromedia\director" this statement opens the movie sunset boulevard in a window (on a windows machine): open window (the applicationpa...

  • Page 78

    Chapter 3 78 attenuation syntax member(whichcastmember).Light(whichlight).Attenuation description 3d light property; indicates the constant, linear, and quadratic attenuation factors for spotlights and point lights. The default value for this property is vector(1.0, 0.0, 0.0). Example this statement...

  • Page 79

    Lingo dictionary 79 attributevalue syntax xmlnode.Attributevalue[ attributenameornumber ] description xml property; returns the value of the specified child node of a parsed xml document. Example beginning with the following xml: element 2 element 3 here is some text this lingo returns the value of ...

  • Page 80

    Chapter 3 80 the following lingo sets the audio property for sprite 2 and the cast member real to false , which means that the audio portion of the realmedia stream will not be played when the movie is played. Sprite(2).Audio = false member("real").Audio = false see also soundchannel (realmedia) , v...

  • Page 81

    Lingo dictionary 81 example this statement turns autoblend off for the model named alien3. The model’s blendfactor setting will be used for blending successive motions in the playlist. Member("newaliens").Model("alien3").Keyframeplayer.\ autoblend = false see also blendfactor , blendtime autocamerap...

  • Page 82

    Chapter 3 82 using traditional lingo syntax, the script is written as: on mouseenter set the automask of member 5 = true end on mouseleave set the automask of member 5 = false end autotab syntax member(whichcastmember).Autotab the autotab of member whichcastmember description cast member property; d...

  • Page 83

    Lingo dictionary 83 back syntax 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 thi...

  • Page 84

    Chapter 3 84 examples this statement changes the color of the characters in cast member 1 to the color in palette entry 250. Dot syntax: member(1).Backcolor = 250 verbose lingo syntax: set the backcolor of member 1 to 250 the following statement sets the variable oldcolor to the background color of ...

  • Page 85

    Lingo dictionary 85 regpoint (3d) indicates the registration point of the backdrop. Blend (3d) indicates the opacity of the backdrop. Count indicates the number of items in the camera’s list of backdrops. Use the following commands to create and remove backdrops: addbackdrop creates a backdrop from ...

  • Page 86

    Chapter 3 86 beep syntax beep {numberoftimes} description command; causes the computer’s speaker to beep the number of times specified by numberoftimes . If numberoftimes is missing, the beep occurs once. • in windows, the beep is the sound assigned in the sounds properties dialog box. • for the mac...

  • Page 87

    Lingo dictionary 87 example when used in the following handler, the beginrecording keyword begins a score generation session that animates the cast member ball by assigning the cast member to sprite channel 20 and then moving the sprite horizontally and vertically over a series of frames. The number...

  • Page 88

    Chapter 3 88 example this handler plays the sound cast member stevie wonder when the sprite begins: on beginsprite me puppetsound "stevie wonder" end see also on endsprite , on prepareframe , scriptinstancelist beveldepth syntax member(whichtextcastmember).Beveldepth member(which3dcastmember).Modelr...

  • Page 89

    Lingo dictionary 89 the beveltype property has the following possible values: • #none • #miter (the default) • #round example in this example, the cast member named logo is a text cast member. This statement sets the beveltype of logo to #round . Member("logo").Beveltype = #round in this example, th...

  • Page 90

    Chapter 3 90 bias syntax member(whichcastmember).Model(whichmodel).Lod.Bias description 3d lod modifier property; indicates how aggressively the modifier removes detail from the model when its auto property is set to true . This property has no effect when the modifier’s auto property is set to fals...

  • Page 91

    Lingo dictionary 91 bitmapsizes syntax member(whichfontmember).Bitmapsizes the bitmapsizes of member whichfontmember description font cast member property; returns a list of the bitmap point sizes that were included when the font cast member was created. Example this statement displays the bitmap po...

  • Page 92

    Chapter 3 92 bitor() syntax bitor(integer1, integer2) description function; converts the two specified integers to 32-bit binary numbers and returns a binary number whose digits are 1’s in the positions where either number had a 1, and 0’s in every other position. The result is the new binary number...

  • Page 93

    Lingo dictionary 93 verbose syntax: property spritenum on beginsprite me memname = sprite(spritenum).Member.Name put "the bitrate of member"&&memname&&"is"&&member(memname).Bitrate end bitspersample syntax member(whichcastmember).Bitspersample the bitspersample of member whichcastmember description ...

  • Page 94

    Chapter 3 94 example this statement compares the 32-bit binary versions of 5 and 6 and returns the result as an integer: put bitxor(5, 6) -- 3 see also bitnot() , bitor() , bitand() blend syntax sprite(whichsprite).Blend the blend of sprite whichsprite description sprite property; sets or determines...

  • Page 95

    Lingo dictionary 95 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 96

    Chapter 3 96 blendconstantlist syntax member(whichcastmember).Shader(whichshader).Blendconstantlist member(whichcastmember).Model(whichmodel).Shader.Blendconstant\ list{[index]} member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ blendconstantlist{[index]} description 3d #standard shader...

  • Page 97

    Lingo dictionary 97 blendfactor is used only when the autoblend property of the modifier is set to false . If the value of the blendfactor property is 100, the current motion will have none of the characteristics of the motion that preceded it. If the value of blendfactor is 0, the current motion wi...

  • Page 98

    Chapter 3 98 example in this example, the shader list of the model named mysterybox contains six shaders. This statement sets the blendfunction property of the second shader to #blend . This enables the settings of the blendsource , blendsource list, blendconstant , and blendconstantlist properties....

  • Page 99

    Lingo dictionary 99 blendlevel syntax 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 inspecto...

  • Page 100

    Chapter 3 100 blendsource syntax member(whichcastmember).Shader(whichshader).Blendsource member(whichcastmember).Model(whichmodel).Shader.Blendsource member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ blendsource description 3d #standard shader property; indicates whether blending of th...

  • Page 101

    Lingo dictionary 101 description 3d #standard shader property; indicates whether blending of a texture layer with the texture layers below it is based on the texture’s alpha information or a constant ratio. The shader’s texture list and the blend source list both have eight index positions. Each ind...

  • Page 102

    Chapter 3 102 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 syntax member(whichcastm...

  • Page 103

    Lingo dictionary 103 playrate 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 returns the number of motions currently queued in the playlist. Rootlock indicates whether the translational component of...

  • Page 104

    Chapter 3 104 border syntax member(whichfieldcastmember).Border the border of member whichfieldcastmember 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...

  • Page 105

    Lingo dictionary 105 description 3d #box model resource property; indicates whether the side of the box intersected by its -y axis is sealed ( true ) or open ( false ). The default value for this property is true . Example this statement sets the bottom property of the model resource named giftbox t...

  • Page 106

    Chapter 3 106 bottomspacing syntax chunkexpression.Bottomspacing description text cast member property; enables you to specify additional spacing applied to the bottom of each paragraph in the chunkexpression portion of the text cast member. The value itself is an integer, where less than 0 indicate...

  • Page 107

    Lingo dictionary 107 the value of this property is a list containing the vector position of the center of the sphere and the floating-point length of the sphere’s radius. This property can be tested but not set. Example this example displays the bounding sphere of a light in the message window. Put ...

  • Page 108

    Chapter 3 108 breakloop() syntax sound(channelnum).Breakloop() description this function causes the currently looping sound in channel channelnum to stop looping and play through to its endtime . If there is no current loop, this function has no effect. Example this handler causes the background mus...

  • Page 109

    Lingo dictionary 109 example this frame script assumes that a flash movie cast member named navigation movie has been set up with its broadcastprops property set to false . The script momentarily allows changes to a flash movie cast member to be broadcast to its sprites currently on the stage. It th...

  • Page 110

    Chapter 3 110 buffersize syntax member(whichflashmember).Buffersize the buffersize of member whichflashmember description flash cast member property; controls how many bytes of a linked flash movie are streamed into memory at one time. The buffersize member property can have only integer values. Thi...

  • Page 111

    Lingo dictionary 111 line 4 defines the three colors allowed by the newmesh command. Line 5 assigns the colors to the first face of plane. The third color in the color list is applied to the first vertex of plane, the second color to the second vertex, and the first color to the third vertex. The co...

  • Page 112

    Chapter 3 112 buttonstyle syntax the buttonstyle description movie property; determines the visual response of buttons when the user rolls the pointer off them. This property applies only to buttons created with the button tool in the tool palette. The buttonstyle property can have these values: • 0...

  • Page 113

    Lingo dictionary 113 bytesstreamed syntax member(whichflashorswamember).Bytesstreamed the bytesstreamed of member whichflashorswamember description flash and shockwave audio cast member property; indicates the number of bytes of the specified cast member that have been loaded into memory. The bytess...

  • Page 114

    Chapter 3 114 cachedocverify() syntax cachedocverify #setting cachedocverify() description function; sets how often the contents of a page on the internet are refreshed with information from the projector’s cache. Possible values are #once (default) and #always . Specifying #once tells a movie to ge...

  • Page 115

    Lingo dictionary 115 call syntax call #handlername, script, {args...} call (#handlername, scriptinstance, {args...}) description command; sends a message that invokes a handler in specified scripts where handlername is the name of the handler to be activated, script references the script or a list o...

  • Page 116

    Chapter 3 116 • the following statements use the parent script and ancestor script. This statement creates an instance of the parent script: set m = new(script "man") this statement makes the man walk: call #walk, m -- "animal walking with 2 legs" this statement makes the man run: set msg = #run cal...

  • Page 117

    Lingo dictionary 117 • this is the ancestor script: -- script "animal" property legcount on new me, newlegcount set legcount = newlegcount return me end on run me put "animal running with "& legcount &" legs" end on walk me put "animal walking with "& legcount &" legs" end • the following statements...

  • Page 118

    Chapter 3 118 camera syntax member(whichcastmember).Camera(whichcamera) member(whichcastmember).Camera[index] member(whichcastmember).Camera(whichcamera).Whichcameraproperty member(whichcastmember).Camera[index].Whichcameraproperty sprite(whichsprite).Camera{(index)} sprite(whichsprite).Camera{(inde...

  • Page 119

    Lingo dictionary 119 cameraposition syntax member(whichcastmember).Cameraposition sprite(whichsprite).Cameraposition description 3d cast member and sprite property; indicates the position of the default camera. The default value of this property is vector(0, 0, 250). This is the position of the defa...

  • Page 120

    Chapter 3 120 case syntax case expression of expression1 : statement expression2 : multiplestatements . . . Expression3, expression4 : statement {otherwise: statement(s)} end case description keyword; starts a multiple branching logic structure that is easier to write than repeated if...Then stateme...

  • Page 121

    Lingo dictionary 121 this case statement tests whether the cursor is over sprite 1, 2, or 3 and runs the corresponding lingo if it is: case the rollover of 1: puppetsound "horn" 2: puppetsound "drum" 3: puppetsound "bongos" end case castlib syntax castlib whichcast description keyword; indicates tha...

  • Page 122

    Chapter 3 122 examples this statement determines the number of the cast to which cast member jazz is assigned. Dot syntax: put member("jazz").Castlibnum verbose syntax: put the castlibnum of member "jazz" the following statement changes the cast member assigned to sprite 5 by switching its cast to w...

  • Page 123

    Lingo dictionary 123 center syntax member(whichcastmember).Center the center of member whichcastmember description cast member property; interacts with the crop cast member property. • when the crop property is false , the center property has no effect. • when crop is true and center is true , cropp...

  • Page 124

    Chapter 3 124 dot syntax: on beginsprite me if sprite(the spritenum of me).Member.Centerregpoint = true then sprite(the spritenum of me).Member.Regpoint = point(0,0) end if end verbose syntax: on beginsprite me if the centerregpoint of member the membernum of me = true then set the regpoint of membe...

  • Page 125

    Lingo dictionary 125 example this statement makes the transition cast member wave apply only to the changing area on the stage. Dot syntax: member("wave").Changearea = true verbose syntax: set the changearea of member "wave" to true channelcount syntax member(whichcastmember).Channelcount the channe...

  • Page 126

    Chapter 3 126 the expressions must be integers that specify a character or range of characters in the chunk. Characters include letters, numbers, punctuation marks, spaces, and control characters such as tab and return. You can test but not set the char...Of keyword. Use the put...Into command to mo...

  • Page 127

    Lingo dictionary 127 values for charpostoloc are in pixels from the top left corner of the field cast member. The nthcharacter parameter is 1 for the first character in the field, 2 for the second character, and so on. Example the following statement determines the point where the fiftieth character...

  • Page 128

    Chapter 3 128 the default value is 0, which results in default spacing between letters. Example the following handler increases the current character spacing of the third through fifth words within the text cast member mycaption by a value of 2: on mycharspacer myspacevalue = member("mycaption").Wor...

  • Page 129

    Lingo dictionary 129 checkboxaccess syntax the checkboxaccess description movie property; specifies one of three possible results when the user clicks a check box or radio button created with button tools in the tools window: • 0 (default)—lets the user set check boxes and radio buttons on and off. ...

  • Page 130

    Chapter 3 130 checkmark syntax the checkmark of menuitem whichitem of menu whichmenu description menu item property; determines whether a check mark appears next to the custom menu item ( true ) or not ( false, default). The whichitem value can be either a menu item name or a menu item number. The w...

  • Page 131

    Lingo dictionary 131 child (xml) syntax xmlnode.Child[ childnumber ] description xml property; refers to the specified child node of a parsed xml document’s nested tag structure. Example beginning with the following xml: element 2 element 3 here is some text this lingo returns the name of the first ...

  • Page 132

    Chapter 3 132 definition command; resets the global flash player used for actionscript objects and removes any actionscript objects from memory. The command does not clear or reset references to those objects stored in lingo. Lingo references will persist but will refer to nonexistent objects. You m...

  • Page 133

    Lingo dictionary 133 example this handler clears the cache when the movie starts: on startmovie clearcache end see also cachedocverify() , cachesize() clearerror syntax member(whichflashmember).Clearerror() clearerror (member whichflashmember) description flash command; resets the error state of a s...

  • Page 134

    Chapter 3 134 example the following handler clears the content of each frame before it edits that frame during score generation: on newscore beginrecording repeat with counter = 1 to 50 clearframe the framescript to 25 updateframe end repeat endrecording end see also beginrecording , endrecording , ...

  • Page 135

    Lingo dictionary 135 clickloc syntax the clickloc description function; identifies as a point the last place on the screen where the mouse was clicked. Example the following on mousedown handler displays the last mouse click location: on mousedown put the clickloc end mousedown if the click were 50 ...

  • Page 136

    Chapter 3 136 dot syntax: on beginsprite me if sprite(the spritenum of me).Directtostage = false then sprite(the spritenum of me).Clickmode = #opaque else sprite(the spritenum of me).Clickmode = #boundingbox end if end verbose syntax: on beginsprite me if the directtostage of sprite the spritenum of...

  • Page 137

    Lingo dictionary 137 clone syntax member(whichcastmember).Model(whichmodel).Clone(clonename) member(whichcastmember).Group(whichgroup).Clone(clonename) member(whichcastmember).Light(whichlight).Clone(clonename) member(whichcastmember).Camera(whichcamera).Clone(clonename) description 3d command; crea...

  • Page 138

    Chapter 3 138 clonemodelfromcastmember syntax member(whichcastmember).Clonemodelfromcastmember\ (newmodelname, sourcemodelname, sourcecastmember) description 3d command; copies the model named sourcemodelname from the cast member sourcecastmember , renames it newmodelname , and inserts it into the c...

  • Page 139

    Lingo dictionary 139 closed syntax member(whichcastmember).Closed description vector shape cast member property; indicates whether the end points of a path are closed or open. Vector shapes must be closed in order to contain a fill. The value can be as follows: • true —the end points are closed. • f...

  • Page 140

    Chapter 3 140 on closewindow syntax on closewindow statement(s) end description system message and event handler; contains statements that run when the user closes the window for a movie by clicking the window’s close box. The on closewindow handler is a good place to put lingo commands that you wan...

  • Page 141

    Lingo dictionary 141 collision (modifier) syntax member(whichcastmember).Model(whichmodel).\ collision.Collisionmodifierproperty description 3d modifier; manages the detection and resolution of collisions. Adding the collision modifier to a model by using the addmodifier command allows access to the...

  • Page 142

    Chapter 3 142 example this example has three parts. The first part is the first line of code, which registers the #putdetails handler for the #collideany event. The second part is the #putdetails handler. When two models in the cast member myscene collide, the #putdetails handler is called and the c...

  • Page 143

    Lingo dictionary 143 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 named myscene collide, the #explode handler is called and the...

  • Page 144

    Chapter 3 144 examples this statement performs a math operation: palcolorobj = paletteindex(20) put palcolorobj -- paletteindex(20) put palcolorobj / 2 -- paletteindex(10) this statement converts one color type to another type: newcolorobj = color(#rgb, 155, 0, 75) put newcolorobj -- rgb(155, 0, 75)...

  • Page 145

    Lingo dictionary 145 color (fog) syntax member(whichcastmember).Camera(whichcamera).Fog.Color sprite(whichsprite).Camera{(index)}.Fog.Color description 3d property; indicates the color introduced into the scene by the camera when the camera’s fog.Enabled property is set to true . The default setting...

  • Page 146

    Chapter 3 146 this property can be tested and set. The color property should be set to an rgb or hexidecimal value. Examples this statement sets the color of the text of cast member 3 to a medium red: member(3).Color = rgb(255, 0, 100) this statement sets the color of the text of cast member 3 to a ...

  • Page 147

    Lingo dictionary 147 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, th...

  • Page 148

    Chapter 3 148 this command must be set to a list of the same number of lingo color values specified in the newmesh call. Example this statement shows that the third color in the colorlist of the model resource mesh2 is rgb(255, 0, 0). Put member("shapes").Modelresource("mesh2").Colorlist[3] -- rgb(2...

  • Page 149

    Lingo dictionary 149 you must use the model resource’s build() command after setting this property; otherwise, the changes will not take effect. Example this example creates a model resource whose type is #mesh , specifies its properties, and then creates a new model with it. Line 1 uses the newmesh...

  • Page 150

    Chapter 3 150 commanddown syntax the commanddown description function; determines whether the control key (windows) or the command key (macintosh) is being pressed ( true ) or not ( false ). You can use commanddown together with the element the key to determine when the control or command key is pre...

  • Page 151

    Lingo dictionary 151 example this statement sets the comments of the member backdrop to the string “still need to license this artwork”: member("backdrop").Comments = "still need to license this artwork" see also creationdate , modifiedby , modifieddate compressed syntax member(whichcastmember).Text...

  • Page 152

    Chapter 3 152 examples these statements check the constrainh function for sprite 1 when it has left and right coordinates of 40 and 60: put constrainh(1, 20) -- 40 put constrainh(1, 55) -- 55 put constrainh(1, 100) -- 60 this statement constrains a moveable slider (sprite 1) to the edges of a gauge ...

  • Page 153

    Lingo dictionary 153 constrainv() syntax constrainv (whichsprite, integerexpression) description function; evaluates integerexpression and then returns a value that depends on the vertical coordinates of the top and bottom edges of the sprite specified by whichsprite , as follows: • when the value i...

  • Page 154

    Chapter 3 154 example this example determines whether a character passed to it is a digit: on isnumber aletter digits = "1234567890" if digits contains aletter then return true else return false end if end note: the string comparison is not sensitive to case or diacritical marks; “a” and Å are treat...

  • Page 155

    Lingo dictionary 155 controller syntax member(whichcastmember).Controller the controller of member whichcastmember description digital video cast member property; determines whether a digital video movie cast member shows or hides its controller. Setting this property to 1 shows the controller; sett...

  • Page 156

    Chapter 3 156 you can include an optional property list of parameters in order to manipulate the pixels being copied before they are placed into the destinationrect . The property list may contain any or all of the following parameters: when copying pixels from one area of a cast member to another a...

  • Page 157

    Lingo dictionary 157 the following statement copies part of the image of member happy into part of member flower. The part of the image copied from happy is within rectangle(0, 0, 200, 90). It is pasted into rectangle(20, 20, 100, 40) within the image of member flower. The copied portion of happy is...

  • Page 158

    Chapter 3 158 copytoclipboard syntax member(whichcastmember).Copytoclipboard() copytoclipboard member whichcastmember description command; copies the specified cast member to the clipboard without requiring that the cast window is active. You can use this command to copy cast members between movies ...

  • Page 159

    Lingo dictionary 159 to see an example of count() used in a completed movie, see the text movie in the learning/ lingo examples folder inside the director application folder. Example this statement displays the number 3, the number of entries: put [10,20,30].Count -- 3 see also globals count syntax ...

  • Page 160

    Chapter 3 160 examples these examples determine the number of various types of objects within a 3d cast member called 3d world. Numberofcameras = member("3d world").Camera.Count put member("3d world").Light.Count -- 3 numberofmodels = member("3d world").Model.Count numberoftextures = member("3d worl...

  • Page 161

    Lingo dictionary 161 creaseangle syntax member(whichcastmember).Model(whichmodel).Inker.Creaseangle member(whichcastmember).Model(whichmodel).Toon.Creaseangle description 3d inker and toon modifier property; indicates the sensitivity of the line drawing function of the modifier to the presence of cr...

  • Page 162

    Chapter 3 162 createmask() syntax imageobject.Createmask() description this function creates and returns a mask object for use with the copypixels() function. Mask objects aren’t image objects; they’re useful only with the copypixels() function for duplicating the effect of mask sprite ink. To save ...

  • Page 163

    Lingo dictionary 163 creationdate syntax member.Creationdate the creationdate of member description this cast member property records the date and time that the cast member was first created, using the system time on the computer. You can use this property to schedule a project; director doesn’t use...

  • Page 164

    Chapter 3 164 crop() (member command) syntax member(whichmember).Crop(recttocropto) crop member whichmember, recttocropto description bitmap command; allows a bitmap cast member to be cropped to a specific size. You can use crop to trim existing cast members, or in conjunction with the picture of th...

  • Page 165

    Lingo dictionary 165 cross syntax vector1.Cross(vector2) description 3d vector method; returns a vector which is perpendicular to both vector1 and vector2 . Example in this example, pos1 is a vector on the x axis and pos2 is a vector on the y axis. The value returned by pos1.Cross(pos2) is vector( 0...

  • Page 166

    Chapter 3 166 description system message and event handler; contains statements that run each time a sound or sprite passes a cue point in its media. • me —the optional me parameter is the scriptinstanceref value of the script being invoked. You must include this parameter when using the message in ...

  • Page 167

    Lingo dictionary 167 cuepointtimes syntax member(whichcastmember).Cuepointtimes the cuepointtimes of member whichcastmember description cast member property; lists the times of the cue points, in milliseconds, for a given cast member. Cue point times are useful for synchronizing sound, quicktime, an...

  • Page 168

    Chapter 3 168 currentspritenum syntax the currentspritenum description movie property; indicates the channel number of the sprite whose script is currently running. It is valid in behaviors and cast member scripts. When used in frame scripts or movie scripts, the currentspritenum property’s value is...

  • Page 169

    Lingo dictionary 169 verbose syntax: set the text of member "time" to (the currenttime of sprite 10) / 1000 this statement causes the sound playing in sound channel 2 to skip to the point 2.7 seconds from the beginning of the sound cast member: sound(2).Currenttime = 2700 see also movietime, duratio...

  • Page 170

    Chapter 3 170 description realmedia sprite or cast member property; allows you to get or set the current time of the realmedia stream, in milliseconds. If the realmedia cast member is not playing, the value of this property is 0, which is the default setting. This is a playback property, and it is n...

  • Page 171

    Lingo dictionary 171 the cast member that you specify must be a 1-bit cast member. If the cast member is larger than 16 by 16 pixels, director crops it to a 16-by-16-pixel square, starting in the upper left corner of the image. The cursor’s hot spot is still the registration point of the cast member...

  • Page 172

    Chapter 3 172 cursor (sprite property) syntax sprite(whichsprite).Cursor = [castnumber, maskcastnumber] set the cursor of sprite whichsprite to [castnumber, maskcastnumber] sprite(whichsprite).Cursor = whichcursor set the cursor of sprite whichsprite to whichcursor description sprite property; deter...

  • Page 173

    Lingo dictionary 173 example this statement changes the cursor that appears over sprite 20 to a watch cursor. Dot syntax: sprite(20).Cursor = 4 verbose syntax: set the cursor of sprite 20 to 4 see also cursor (command) cursorsize syntax member(whichcursorcastmember).Cursorsize the cursorsize of memb...

  • Page 174

    Chapter 3 174 curve syntax member.Curve[curvelistindex] description this property contains the vertexlist of an individual curve (shape) from a vector shape cast member. You can use the curve property along with the vertex property to get individual vertices of a specific curve in a vector shape. A ...

  • Page 175

    Lingo dictionary 175 the format director uses for the date varies, depending on how the date is formatted on the computer. • in windows, you can customize the date display by using the international control panel. (windows stores the current short date format in the system.Ini file. Use this value t...

  • Page 176

    Chapter 3 176 the individual properties of the date object instance returned are: examples these statements create and determine the number of days between two dates: mybirthday = date(19650712) yourbirthday = date(19450529) put "there are" && abs(yourbirthday - mybirthday) && "days between our birt...

  • Page 177

    Lingo dictionary 177 on deactivatewindow syntax on deactivatewindow statement(s) end description system message and event handler; contains statements that run when the window that the movie is playing in is deactivated. The on deactivate event handler is a good place for lingo that you want execute...

  • Page 178

    Chapter 3 178 example this statement opens the message window in either shockwave or a projector: the debugplaybackenabled = true decaymode syntax member(whichcastmember).Camera(whichcamera).Fog.Decaymode sprite(whichsprite).Camera{(index)}.Fog.Decaymode description 3d property; indicates the manner...

  • Page 179

    Lingo dictionary 179 example this handler accepts a cast reference and a rectangle as parameters. It then searches the specified cast for flash cast members and sets their defaultrect property to the specified rectangle. On setdefaultflashrect whichcast, whichrect repeat with i = 1 to the number of ...

  • Page 180

    Chapter 3 180 delay syntax delay numberofticks description command; pauses the playhead for a given amount of time. The integer expression numberofticks specifies the number of ticks to wait, where each tick is 1/60 of a second. The only mouse and keyboard activity possible during this time is stopp...

  • Page 181

    Lingo dictionary 181 delete syntax delete chunkexpression description command; deletes the specified chunk expression (character, word, item, or line) in any string container. Sources of strings include field cast members and variables that hold strings. To see an example of delete used in a complet...

  • Page 182

    Chapter 3 182 example this statement deletes the second item from the list named designers, which contains [gee, kayne, ohashi]: designers = ["gee", "kayne", "ohashi"] designers.Deleteat(2) the result is the list [gee, ohashi]. This handler checks whether an object is in a list before attempting to ...

  • Page 183

    Lingo dictionary 183 deleteframe syntax deleteframe description command; deletes the current frame and makes the next frame the new current frame during a score generation session only. Example the following handler checks whether the sprite in channel 10 of the current frame has gone past the right...

  • Page 184

    Chapter 3 184 deletelight syntax 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. Examples these examples de...

  • Page 185

    Lingo dictionary 185 deletemotion syntax member(whichcastmember).Deletemotion(whichmotion) member(whichcastmember).Deletemotion(index) description 3d command; removes the motion from the cast member. Examples the first line of this example deletes the motion named backflip from the cast member named...

  • Page 186

    Chapter 3 186 • for property lists, replace item with the name of the property to be deleted. Deleting a property also deletes its associated value. If the list has more than one of the same property, only the first property in the list is deleted. Example this statement deletes the color property f...

  • Page 187

    Lingo dictionary 187 deletevertex() syntax member(memberref).Deletevertex(indextoremove) deletevertex(member memberref, indextoremove) description vector shape command; removes an existing vertex of a vector shape cast member in the index position specified. Example this line removes the second vert...

  • Page 188

    Chapter 3 188 depth syntax imageobject.Depth member(whichcastmember).Depth the depth of member whichcastmember description image object or bitmap cast member property; displays the color depth of the given image object or bitmap cast member. This property can be tested but not set. Examples this sta...

  • Page 189

    Lingo dictionary 189 depthbufferdepth syntax getrendererservices().Depthbufferdepth description 3d rendererservices property; indicates the precision of the hardware depth buffer of the user’s system. The value is either 16 or 24, depending on the user’s hardware settings. Example this statement sho...

  • Page 190

    Chapter 3 190 diffuse syntax member(whichcastmember).Shader(whichshader).Diffuse member(whichcastmember).Model(whichmodel).Shader.Diffuse member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ diffuse description 3d #standard shader property; indicates a color that is blended with the first...

  • Page 191

    Lingo dictionary 191 diffuselightmap syntax member(whichcastmember).Shader(whichshader).Diffuselightmap member(whichcastmember).Model(whichmodel).Shader.Diffuselightmap member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ diffuselightmap description 3d #standard shader property; specifies...

  • Page 192

    Chapter 3 192 digitalvideotype syntax member(whichcastmember).Digitalvideotype the digitalvideotype of member whichcastmember description cast member property; indicates the format of the specified digital video. Possible values are #quicktime or #videoforwindows . This property can be tested but no...

  • Page 193

    Lingo dictionary 193 directionalcolor syntax member(whichcastmember).Directionalcolor description 3d cast member property; indicates the rgb color of the default directional light of the cast member. The default value of this property is rgb(255, 255, 255). Example this statement sets the directiona...

  • Page 194

    Chapter 3 194 directtostage syntax member(whichcastmember).Directtostage the directtostage of member whichcastmember sprite(whichsprite).Directtostage the directtostage of sprite whichsprite description sprite property and member property; determines the layer where a digital video, animated gif, ve...

  • Page 195

    Lingo dictionary 195 displayface syntax member(whichtextcastmember).Displayface member(which3dcastmember).Modelresource(whichmodelresource).\ displayface description 3d text property; a linear list indicating which face or faces of the 3d text to display. Possible values include #front , #tunnel , a...

  • Page 196

    Chapter 3 196 displayreallogo syntax sprite(whichsprite).Displayreallogo member(whichcastmember).Displayreallogo description realmedia sprite or cast member property; allows you to set or get whether the realnetworks logo is displayed ( true ) or not ( false ). When set to true , this property displ...

  • Page 197

    Lingo dictionary 197 distribution syntax 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 prope...

  • Page 198

    Chapter 3 198 the do command works with multiple-line strings as well as single lines. Example this statement performs the statement contained within quotation marks: do "beep 2" do commandlist[3] doneparsing() syntax parserobject.Doneparsing() description function; returns 1 (true) when the parser ...

  • Page 199

    Lingo dictionary 199 dotproduct() syntax 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 th...

  • Page 200

    Chapter 3 200 the following handler tests for a double-click. When the user clicks the mouse, a repeat loop runs for the time set for a double-click (20 ticks in this case). If a second click occurs within 20 ticks, the doubleclickaction handler runs. If a second click doesn’t occur within the speci...

  • Page 201

    Lingo dictionary 201 drag syntax member(whichcastmember).Modelresource(whichmodelresource).Drag description 3d #particle model resource property; indicates the percentage of each particle’s velocity that is lost in each simulation step. This property has a range of 0 (no velocity lost) to 100 (all v...

  • Page 202

    Chapter 3 202 the following statement draws a dark red, 3-pixel unfilled oval within the image of member happy. The oval is drawn within the rectangle (0, 0, 128, 86). Member("happy").Image.Draw(0, 0, 128, 86, [#shapetype:#oval, #linesize:3, \ #color: rgb(150, 0, 0)]) see also color() , copypixels()...

  • Page 203

    Lingo dictionary 203 duplicate syntax vectorreference.Duplicate() transformreference.Duplicate() description 3d vector and transform method; returns a copy of the vector or transform. Example this statement creates a copy of the position of model 1 and stores it in the variable zz . Zz = member("myr...

  • Page 204

    Chapter 3 204 to see an example of duplicate() (list function) used in a completed movie, see the vector shapes movie in the learning/lingo examples folder inside the director application folder. Example this statement makes a copy of the list customerstoday and assigns it to the variable customerre...

  • Page 205

    Lingo dictionary 205 duration syntax member(whichcastmember).Duration the duration of member whichcastmember description cast member property; determines the duration of the specified shockwave audio (swa), transition, and quicktime cast members. • when whichcastmember is a streaming sound file, thi...

  • Page 206

    Chapter 3 206 duration (3d) syntax member(whichcastmember).Motion(whichmotion).Duration motionobjectreference.Duration description 3d property; lets you get the time in millisecond that it takes the motion specified in the whichmotion parameter to play to completion. This property is always greater ...

  • Page 207

    207 editable syntax member(whichcastmember).Editable the editable of member whichcastmember sprite(whichsprite).Editable the editable of sprite whichsprite description cast member and sprite property; determines whether the specified field cast member can be edited on the stage ( true ) or not ( fal...

  • Page 208

    208 editshortcutsenabled syntax the editshortcutsenabled description movie property; determines whether cut, copy, and paste operations and their keyboard shortcuts function in the current movie. When set to true , these text operations function. When set to false , these operations are not allowed....

  • Page 209

    209 the default value for this property is rgb(0, 0, 0) . Example this statement sets the emissive property of the shader named globe to rgb(255, 0, 0) . Models using this shader will appear to be illuminated by a red light: member("mysteryworld").Shader("globe").Emissive = rgb(255, 0, 0) see also s...

  • Page 210

    210 empty syntax empty description character constant; represents the empty string, "" , a string with no characters. Example this statement erases all characters in the field cast member notice by setting the field to empty : member("notice").Text = empty emulatemultibuttonmouse syntax the emulatem...

  • Page 211

    211 example this handler enables or disables all the items in the specified menu. The argument themenu specifies the menu; the argument setting specifies true or false . For example, the calling statement ablemenu ( " special " , false) disables all the items in the special menu. On ablemenu themenu...

  • Page 212

    212 enabled (sds) syntax member(whichcastmember).Model(whichmodel).Sds.Enabled description 3d sds modifier property; indicates whether the sds modifier attached to a model is used by the model. The default setting for this property is true . An attempt to add the sds modifier to a model that already...

  • Page 213

    213 example this handler uses the end case keyword to end the case statement: on keydown case the key of "a": go to frame "apple" of "b", "c" : puppettransition 99 go to frame "mango" otherwise beep end case end keydown see also case endangle syntax member(whichcastmember).Modelresource(whichmodelre...

  • Page 214

    214 endcolor syntax the endcolor of member whichcastmember description vector shape cast member property; the ending color of a gradient shape’s fill specified as an rgb value. Endcolor is only valid when the fillmode is set to #gradient , and the starting color is set with fillcolor . This property...

  • Page 215

    215 example when used in the following handler, the endrecording keyword ends the score generation session: on animball numberofframes beginrecording horizontal = 0 vertical = 100 repeat with i = 1 to numberofframes go to frame i sprite(20).Member = member "ball" sprite(20).Loch = horizontal sprite(...

  • Page 216

    216 endtelltarget() see telltarget() . Endtime syntax sound(channelnum).Endtime the endtime of sound channelnum description this property is the specified end time of the currently playing, paused or queued sound. This is the time within the sound member when it will stop playing. It’s a floating-po...

  • Page 217

    217 on enterframe syntax on enterframe statement(s) end description system message and event handler; contains statements that run each time the playhead enters the frame. Place on enterframe handlers in behavior, frame, or movie scripts, as follows: • to assign the handler to an individual sprite, ...

  • Page 218

    218 the information is in the form of property and value pairs for that area. The properties contain exactly the same information as the properties and functions of the same name. Example this statement displays the environment list in the message window: put the environment -- [#shockmachine: 0, #s...

  • Page 219

    219 this handler deletes cast members start through finish: on deletemember start, finish repeat with i = start to finish member(i).Erase() end repeat end on deletemember see also new() error syntax member(whichcastmember).Model(whichmodel).Sds.Error description 3d #sds modifier property; indicates ...

  • Page 220

    220 include only those behaviors in on evalscript that you want users to control; for security reasons, don’t give complete access to behaviors. Note: if you place a return at the end of your evalscript handler, the value returned can be used by javascript in the browser. Examples this shows how to ...

  • Page 221

    221 this property can be tested and set. Example the following frame script checks to see whether the buttons in a flash movie sprite are currently enabled, and if so, sets eventpassmode to #passnotbutton ; if the buttons are disabled, the script sets eventpassmode to #passalways . The effect of thi...

  • Page 222

    222 place on exitframe handlers in behavior, frame, or movie scripts, as follows: • to assign the handler to an individual sprite, put the handler in a behavior attached to the sprite. • to assign the handler to an individual frame, put the handler in the frame script. • to assign the handler to eve...

  • Page 223

    223 assuming that exitlock is set to true , nothing occurs automatically when the control+period/ q/w, esc, or command+period/q/w keys are used. This handler checks keyboard input for keys to exit and takes the user to a custom quit sequence: on checkexit if the commanddown and (the key = "." or the...

  • Page 224

    224 externalevent syntax 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. The string sent by externalevent mus...

  • Page 225

    225 externalparamcount() syntax externalparamcount() description function; returns the number of parameters that an html or tag is passing to a shockwave movie. This function is valid only for shockwave movies that are running in a browser. It doesn’t work for movies during authoring or for projecto...

  • Page 226

    226 externalparamvalue() syntax externalparamvalue(n) description function; returns a specific value from the external parameter list in an html or tag. This function is valid only for shockwave movies that are running in a browser. It can’t be used with movies running in the authoring environment o...

  • Page 227

    227 extrude3d syntax member(whichtextcastmember).Extrude3d(member(which3dcastmember)) description 3d command; creates a new #extruder model resource in the 3d cast member which3dcastmember from the text in whichtextcastmember . Note that this is not the same as using the 3d displaymode property of a...

  • Page 228

    228 description 3d #mesh model resource and meshdeform modifier property. All model resources are meshes composed of triangles. Each triangle is a face. You can access the properties of the faces of model resources whose type is #mesh . Changes to any of these properties do not take effect until you...

  • Page 229

    229 fadein() syntax sound(channelnum).Fadein({milliseconds}) fadein(sound(channelnum) { , milliseconds }) description this function immediately sets the volume of sound channel channelnum to zero and then brings it back to the current volume over the given number of milliseconds. The default is 1000...

  • Page 230

    230 to see an example of fadeto() used in a completed movie, see the sound control movie in the learning/lingo examples folder inside the director application folder. Example the following statement changes the volume of sound channel 4 to 150 over a period of 2 seconds. It can be a fade up or a fad...

  • Page 231

    231 field syntax field whichfield description keyword; refers to the field cast member specified by whichfield . • when whichfield is a string, it is used as the cast member name. • when whichfield is an integer, it is used as the cast member number. Character strings and chunk expressions can be re...

  • Page 232

    232 the value of this property is meaningful only when the value of the camera’s projection property is set to #perspective . When the projection property is set to #orthographic , use the camera’s orthoheight property to define the top and bottom of the projection plane. The default setting for thi...

  • Page 233

    233 filename (cast member property) syntax member(whichcastmember).Filename the filename of member whichcastmember description cast member property; refers to the name of the file assigned to the linked cast member specified by whichcastmember . This property is useful for switching the external lin...

  • Page 234

    234 the filename of window property accepts urls as a reference. However, to use a movie file from a url and minimize the download time, use the downloadnetthing or preloadnetthing command to download the movie file to a local disk first and then set filename window property to the file on the local...

  • Page 235

    235 the following statement draws a filled oval in the image object testimage. The oval has a green fill and a 5-pixel-wide red border. Testimage.Fill(0, 0, 100, 100, [#shapetype: #oval, #linesize: 5, #color: rgb(0, 255, 0), \ #bgcolor: rgb(255, 0, 0)]) see also color(), draw() fillcolor syntax memb...

  • Page 236

    236 filldirection syntax member(whichcastmember).Filldirection description vector shape cast member property; specifies the amount in degrees to rotate the fill of the shape. This property is only valid when the fillmode property of the shape is set to #gradient . This property can be tested and set...

  • Page 237

    237 example this statement sets the fillmode of member archie to gradient: member("archie").Fillmode = #gradient see also endcolor , fillcolor filloffset syntax member(whichcastmember).Filloffset description vector shape cast member property; specifies the horizontal and vertical amount in pixels (w...

  • Page 238

    238 findempty() syntax findempty(member whichcastmember) description function; for the current cast only, displays the next empty cast member position or the position after the cast member specified by whichcastmember . Example this statement finds the first empty cast member on or after cast member...

  • Page 239

    239 findposnear syntax sortedlist.Findposnear(valueorproperty) findposnear(sortedlist, valueorproperty) description list command; for sorted lists only, identifies the position of the item specified by valueorproperty in the specified sorted list. The findposnear command works only with sorted lists...

  • Page 240

    240 firstindent syntax chunkexpression.Firstindent description text cast member property; contains the number of pixels the first indent in chunkexpression is offset from the left margin of the chunkexpression . The value is an integer: less than 0 indicates a hanging indent, 0 is no indention, and ...

  • Page 241

    241 example the following handler adjusts the frame rate of a flash movie sprite. As parameters, the handler accepts a sprite reference, an indication of whether to speed up or slow down the flash movie, and the amount to adjust the speed. On adjustfixedrate whichsprite, adjusttype, howmuch case adj...

  • Page 242

    242 this property can be tested but not set. Example this sprite script resizes a flash movie sprite so that it is equal to the original size of its flash movie cast member: on beginsprite me sprite(me.Spritenum).Rect = sprite(me.Spritenum).Member.Flashrect end see also defaultrect , defaultrectmode...

  • Page 243

    243 flat shading uses one color per face of the mesh. The color used for the face is the color of its first vertex. Flat shading is faster than gouraud shading. Gouraud shading assigns a color to each vertex of a face and interpolates the colors across the face in a gradient. Gouraud shading require...

  • Page 244

    244 float() syntax (expression).Float float (expression) description function; converts an expression to a floating-point number. The number of digits that follow the decimal point (for display purposes only, calculations are not affected) is set using the floatprecision property. Examples this stat...

  • Page 245

    245 floatprecision syntax the floatprecision description movie property; rounds off the display of floating-point numbers to the number of decimal places specified. The value of floatprecision must be an integer. The maximum value is 15 significant digits; the default value is 4. The floatprecision ...

  • Page 246

    246 fog syntax member(whichcastmember).Camera(whichcamera).Fog.Color sprite(whichsprite).Camera{(index)}.Fog.Color member(whichcastmember).Camera(whichcamera).Fog.Decaymode sprite(whichsprite).Camera{(index)}.Fog.Decaymode member(whichcastmember).Camera(whichcamera).Fog.Enabled sprite(whichsprite).C...

  • Page 247

    247 to see an example of font used in a completed movie, see the text movie in the learning/lingo examples folder inside the director application folder. Example this statement sets the variable named oldfont to the current font setting for the field cast member rokujo speaks: oldfont = member("roku...

  • Page 248

    248 description cast member property; determines the styles applied to the font used to display the specified field cast member, character, line, word, or other chunk expression and requires that the field cast member contain characters, if only a space. The value of the property is a string of styl...

  • Page 249

    249 it is not recommended to apply this property to bitmap cast members deeper than 1-bit, as the results are difficult to predict. It is recommended that the newer color property be used instead of the forecolor property. Examples the hexadecimal value for pure red, ff0000, is equivalent to 1671168...

  • Page 250

    250 forget syntax window(whichwindow).Forget() forget window whichwindow description window property; instructs lingo to close and delete the window specified by whichwindow when it’s no longer in use and no other variables refer to it. When a forget window command is given, the window and the movie...

  • Page 251

    251 example the following frame script checks to see if a flash movie has finished playing (by checking to see if the current frame is equal to the total number of frames in the movie). If the movie has not finished, the playhead continues to loop in the current frame; when the movie finishes, the p...

  • Page 252

    252 framepalette syntax the framepalette description frame property; identifies the cast member number of the palette used in the current frame, which is either the current palette or the palette set in the current frame. Because the browser controls the palette for the entire web page, the director...

  • Page 253

    253 examples this statement sets the frame rate of the quicktime digital video cast member rotating chair to 30 frames per second: member("rotating chair").Framerate = 30 this statement instructs the quicktime digital video cast member rotating chair to play every frame as fast as possible: member("...

  • Page 254

    254 examples this statement determines whether the cast members for frame 20 are downloaded and ready to be viewed: on exitframe if frameready(20) then -- go to frame 20 if all the required --castmembers are locally available go to frame 20 else -- resume animating loop while background --is streami...

  • Page 255

    255 framesound1 syntax the framesound1 description frame property; determines the number of the cast member assigned to the first sound channel in the current frame. This property can be tested and set. This property can also be set during a score recording session. Example as part of a score record...

  • Page 256

    256 the resulting string uses the form shh:mm:ss.Ffd , where: example the following statement converts a 2710-frame, 30 frame-per-second movie. The dropframe and fractionalseconds arguments are both turned off: put framestohms(2710, 30, false, false) -- " 00:01:30.10 " see also hmstoframes() framete...

  • Page 257

    257 example when used in a score recording session, this statement makes the cast member fog the transition for the frame that lingo is currently recording: set the frametransition to member "fog" freeblock() syntax the freeblock description function; indicates the size of the largest free contiguou...

  • Page 258

    258 front syntax member(whichcastmember).Modelresource(whichmodelresource).Front description 3d #box model resource property; indicates whether the side of the box intersected by its -z axis is sealed ( true ) or open ( false ). The default value for this property is true . Example this statement se...

  • Page 259

    259 if the style parameter is set to #flat , each vertex receives a normal for each face to which it belongs. Furthermore, all three of the vertices of a face will have the same normal. For example, if the vertices of face[1] all receive normal[1] and the vertices of face[2] all receive normal[2] , ...

  • Page 260

    260 examples this statement identifies the value associated with the property #joe in the property list ages, which consists of [#john:10, #joe:12, #cheryl:15, #barbara:22]: put getaprop(ages, #joe) the result is 12, because this is the value associated with the property #joe. The same result can be...

  • Page 261

    261 the following example extracts the first entry in a list containing two entries that specify name, department, and employee number information. Then the second element of the newly extracted list is returned, identifying the department in which the first person in the list is employed. The forma...

  • Page 262

    262 on getbehaviortooltip syntax on getbehaviortooltip statement(s) end description system message and event handler; contains lingo that returns the string that appears in a tooltip for a script in the library palette. Director sends the getbehaviortooltip message to the script when the cursor stop...

  • Page 263

    263 description function; for shockwave audio (swa) or flash cast members, indicates whether an error occurred as the cast member streamed into memory and returns a value. Shockwave audio cast members have the following possible geterror() integer values and corresponding geterrorstring() messages: ...

  • Page 264

    264 the following handler checks to see whether an error occurred for a flash cast member named dali, which was streaming into memory. If an error occurred, and it was a memory error, the script uses the unloadcast command to try to free some memory; it then branches the playhead to a frame in the d...

  • Page 265

    265 possible geterror() integer values and corresponding geterrorstring() messages are: example this handler uses geterror() to determine whether an error occurred for shockwave audio cast member norma desmond speaks, and if so, uses geterrorstring to obtain the error message and assign it to a fiel...

  • Page 266

    266 getframelabel() syntax sprite(whichflashsprite).Getframelabel(whichflashframenumber) getframelabel(sprite whichflashsprite, whichflashframenumber) description function; returns the frame label within a flash movie that is associated with the frame number requested. If the label doesn’t exist, or...

  • Page 267

    267 example this statement displays a detailed property list of information about the user’s hardware: put getrendererservices().Gethardwareinfo() -- [#present: 1, #vendor: "nvidia corporation", #model: \ "32mb ddr nvidia geforce2 gts (dell)", #version: "4.12.01.0532", \ #maxtexturesize: [2048, 2048...

  • Page 268

    268 note: this function is included for backward compatibility. It is recommended that you use the network id returned from a net lingo function rather than getlatestnetid. However, if you use getlatestnetid, use it immediately after issuing the netlingo command. Example this script assigns the netw...

  • Page 269

    269 the function works with relative urls. To see an example of getnettext() used in a completed movie, see the forms and post movie in the learning/lingo examples folder inside the director application folder. Examples this script retrieves text from the url http://bigserver.Com/sample.Txt and upda...

  • Page 270

    270 getnthfilenameinfolder() syntax getnthfilenameinfolder(folderpath, filenumber) description function; returns a filename from the directory folder based on the specified path and number within the folder. To be found by the getnthfilenameinfolder function, director movies must be set to visible i...

  • Page 271

    271 examples this statement identifies the position of the value 12 in the linear list answers, which consists of [10, 12, 15, 22]: put answers.Getone(12) the result is 2, because 12 is the second value in the list. This statement identifies the property associated with the value 12 in the property ...

  • Page 272

    272 getplaylist() syntax sound(channelnum).Getplaylist() getplaylist(sound(channelnum)) description this function returns a copy of the list of queued sounds for soundobject . This list does not include the currently playing sound. The list of queued sounds may not be edited directly. You must use s...

  • Page 273

    273 getpos() syntax list.Getpos(value) getpos(list, value) description list function; identifies the position of the value specified by value in the list specified by list . When the specified value is not in the list, the getpos command returns the value 0. For values contained in the list more tha...

  • Page 274

    274 getprop() syntax getprop(list, property) list.Property description property list function; identifies the value associated with the property specified by property in the property list specified by list . Almost identical to the getaprop command, the getprop command displays an error message if t...

  • Page 275

    275 the on getpropertydescriptionlist message is sent when any action that causes the behavior inspector to open occurs: either when the user drags a behavior to the score or the user double-clicks a behavior in the behavior inspector. The #default , #format , and #comment settings are mandatory for...

  • Page 276

    276 • texturerenderformat indicates the pixel format used by the renderer. Possible values include #rgba8888 , #rgba8880 , #rgba5650 , #rgba5550 , #rgba5551 , and #rgba4444 . The four digits in each symbol indicate how many bits are used for each red, green, blue, and alpha component. • depthbufferd...

  • Page 277

    277 getvariable() syntax sprite(flashspritenum).Getvariable("variablename" {, returnvalueorreference}) getvariable(sprite flashspritenum, "variablename" {, returnvalueorreference}) description function; returns the current value of the given variable from the specified flash sprite. Flash variables ...

  • Page 278

    278 the transform property of a node is calculated relative to the transform of the node’s parent, and is therefore parent-relative. The getworldtransform() command calculates the node’s transform relative to the origin of the 3d world, and is therefore world-relative. Use member(whichcastmember).No...

  • Page 279

    279 shockwave movies playing on the internet cannot access global variables within other movies, even movies playing on the same html page. The only way movies can share global variables is if an embedded movie navigates to another movie and replaces itself through either gotonetmovie or go movie . ...

  • Page 280

    280 when you set this property, the following properties are automatically set: • the fourth texture layer of the shader is set to the texture you specified. • the value of texturemodelist[4] is set to #none . • the value of blendfunctionlist[4] is set to #multiply . Example this statement sets the ...

  • Page 281

    281 the phrase go loop tells the playhead to loop to the previous marker and is a convenient means of keeping the playhead in the same section of the movie while lingo remains active and avoids the use of go to the frame in a frame that has a transition which would slow the movie and overwhelm the p...

  • Page 282

    282 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. The go loop command is equivalent to the stateme...

  • Page 283

    283 example this statement sends the playhead to the previous marker in the movie: go previous see also go , go next , go loop gotoframe syntax sprite(whichflashsprite).Gotoframe(framenumber) gotoframe(sprite whichflashsprite, framenumber) sprite(whichflashsprite).Gotoframe(labelnamestring) gotofram...

  • Page 284

    284 examples in this statement, the url indicates a director filename: gotonetmovie "http://www.Yourserver.Com/movies/movie1.Dcr" in this statement, the url indicates a marker within a filename: gotonetmovie "http://www.Yourserver.Com/movies/buttons.Dcr#contents" in the following statement, gotonetm...

  • Page 285

    285 gradienttype syntax member(whichcastmember).Gradienttype description vector shape cast member property; specifies the actual gradient used in the cast member’s fill. Possible values are #linear or #radial . The gradienttype is only valid when the fillmode is set to #gradient . This property can ...

  • Page 286

    286 halt syntax halt description command; exits the current handler and any handler that called it and stops the movie during authoring or quits the projector during run time from a projector. Example this statement checks whether the amount of free memory is less than 50k and, if it is, exits all h...

  • Page 287

    287 this statement displays the list of handlers in the parent script member carparentscript in the message window: put member(“carparentscript”).Script.Handlers() -- [#accelerate, #turn, #stop] see also handler() , script height syntax member(whichcastmember).Height the height of member whichcastme...

  • Page 288

    288 the height of a texture is measured in pixels and can be tested but not set. The height of the texture is rounded from the height of the source of the texture to the nearest power of 2. Examples this statement sets the height of the model resource named tower to 225.0 world units: member("3d wor...

  • Page 289

    289 example the following statement sets the highlightpercentage property of the toon modifier for the model named sphere to 50. Half of the colors available to the toon modifier for this model will be used for the highlight area of the model’s surface. Member("shapes").Model("sphere").Toon.Highligh...

  • Page 290

    290 hilite (cast member property) syntax member(whichcastmember).Hilite the hilite of member whichcastmember description cast member property; determines whether a check box or radio button created with the button tool is selected ( true ) or not ( false, default). If whichcastmember is a string, it...

  • Page 291

    291 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: on exitframe if sprite(5).Hittest(the mouseloc) = #button then member("message line").Text = ...

  • Page 292

    292 • hms— string expression that specifies the time in the form shh:mm:ss.Ffd , where: • tempo —specifies the tempo in frames per second. • dropframe —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 a...

  • Page 293

    293 example this frame script holds the flash movie sprites playing in channels 5 through 10 while allowing the audio for these channels to continue playing: on enterframe repeat with i = 5 to 10 sprite(i).Hold() end repeat end see also movierate , pause (movie playback) hotspot syntax member(whichc...

  • Page 294

    294 hotspotexitcallback syntax sprite(whichqtvrsprite).Hotspotexitcallback the hotspotexitcallback of sprite whichqtvrsprite description quicktime vr sprite property; contains the name of the handler that runs when the cursor leaves a quicktime vr hot spot that is visible on the stage. The quicktime...

  • Page 295

    295 example the following handler creates a hyperlink in the first word of text cast member “macrolink”. The text is linked to macromedia’s website. On startmovie member("macrolink").Word[1].Hyperlink = \ "http://www.Macromedia.Com" end see also hyperlinkrange , hyperlinkstate on hyperlinkclicked sy...

  • Page 296

    296 this property can be tested but not set. Like hyperlink and hyperlinkstate , the returned range of the link contains the first character of chunkexpression . See also hyperlink , hyperlinkstate hyperlinks syntax chunkexpression.Hyperlinks description text cast member property; returns a linear l...

  • Page 297

    297 identity() syntax member(whichcastmember).Model(whichmodel).Transform.Identity() member(whichcastmember).Group(whichgroup).Transform.Identity() member(whichcastmember).Camera(whichcamera).Transform.Identity() sprite(whichsprite).Camera{(index)}.Transform.Identity() member(whichcastmember).Light(...

  • Page 298

    298 example this handler updates the time being displayed in the movie whenever there are no other events to handle: on idle member("time").Text = the short time end idle see also idlehandlerperiod idlehandlerperiod syntax the idlehandlerperiod description movie property; determines the maximum numb...

  • Page 299

    299 idleloaddone() syntax idleloaddone(loadtag) description function; reports whether all cast members with the given tag have been loaded ( true ) or are still waiting to be loaded ( false ). Example this statement checks whether all cast members whose load tag is 20 have been loaded and then plays...

  • Page 300

    300 idleloadperiod syntax the idleloadperiod description system property; determines the number of ticks that director waits before trying to load cast members waiting to be loaded. The default value for idleloadperiod is 0, which instructs director to service the load queue as frequently as possibl...

  • Page 301

    301 if syntax if logicalexpression then statement if logicalexpression then statement else statement end if if logicalexpression then statement(s) end if if logicalexpression then statement(s) else statement(s) end if if logicalexpression1 then statement(s) else if logicalexpression2 then statement(...

  • Page 302

    302 this handler checks whether the command and q keys were pressed simultaneously and, if so, executes the subsequent statements: on keydown if (the commanddown) and (the key = "q") then cleanup quit end if end keydown compare the following two constructions and the performance results. The first c...

  • Page 303

    303 these lingo statements set ignorewhitespace() to false and then parse the given xml into a list. Note that the element now has a child containing one space character. Xmltext = "" parserobj.Ignorewhitespace(false) parserobj.Parsestring(xmltext) thelist = parserobj.Makelist() put thelist -- ["roo...

  • Page 304

    304 examples the following ilk statement identifies the type of the object named bids: bids = [:] put ilk( bids ) -- #proplist the following ilk statement tests whether the variable total is a list and displays the result in the message window: total = 2+2 put ilk( total, #list ) -- 0 in this case, ...

  • Page 305

    305 the following example tests a variable named myvariable and verifies that it is a date object before displaying it in the message window: myvariable = the systemdate if ilk(myvariable, #date) then put myvariable -- date( 1999, 2, 19 ) ilk (3d) syntax ilk(object) ilk(object,type) object.Ilk objec...

  • Page 306

    306 examples this statement shows that myobject is a motion object: put myobject.Ilk -- #motion the following statement tests whether myobject is a motion object. The return value of 1 shows that it is. Put myobject.Ilk(#motion) -- 1 see also tweenmode image syntax whichmember.Image (the stage).Imag...

  • Page 307

    307 image() syntax image(width, height, bitdepth { , alphadepth } {, palettesymbolormember}) description function; creates and returns a new image object of the dimensions specified by width , height , and bitdepth , with optional alphadepth and paletteobject values. The bitdepth can be 1, 2, 4, 8, ...

  • Page 308

    308 this handler is called by a frame script once per director frame. The handler creates a new texture from the image of the realmedia cast member named real if it is playing or paused. The new texture is then used by the shader of the model named msphere. The texture that was used in the previous ...

  • Page 309

    309 imageenabled syntax sprite(whichvectororflashsprite).Imageenabled the imageenabled of sprite whichvectororflashsprite member(whichvectororflashmember).Imageenabled the imageenabled of member whichvectororflashmember description cast member property and sprite property; controls whether a flash m...

  • Page 310

    310 this property is settable only during authoring and only affects cast members when saving a movie in shockwave format. The compressed image can be previewed via the optimize in fireworks button in the property inspector’s bitmap tab or the preview in browser command in the file menu. If an image...

  • Page 311

    311 • when downloading files from the internet, use it to download the file at a specific url and set the filename of linked media. (however, to import a file from a url, it’s usually more efficient and minimizes downloading to use the preloadnetthing command to download the file to a local disk fir...

  • Page 312

    312 inflate syntax rectangle.Inflate(widthchange, heightchange) inflate (rectangle, widthchange, heightchange) description command; changes the dimensions of the rectangle specified by rectangle relative to the center of the rectangle, either horizontally (widthchange) or vertically (heightchange) ....

  • Page 313

    313 for a movie that plays back as an applet, valid values for the ink sprite property vary for different sprites, as follows: • for bitmap sprites, the ink sprite property can be 0 (copy), 8 (matte), 32 (blend), or 36 (background transparent). • for vector shape, flash, and shape sprites, the ink s...

  • Page 314

    314 the #inker modifier has the following properties: • linecolor allows you to get or set the color of lines drawn by the inker. • silhouettes allows you to get or set whether lines are drawn to define the edges along the border of a model, outlining its shape. • creases allows you to get or set wh...

  • Page 315

    315 insertframe syntax insertframe description command; duplicates the current frame and its content. The duplicate frame is inserted after the current frame and then becomes the current frame. This command can be used only during a score recording session and performs the same function as the dupli...

  • Page 316

    316 inside() syntax point.Inside(rectangle) inside(point, rectangle) description function; indicates whether the point specified by point is within the rectangle specified by rectangle ( true ), or outside the rectangle ( false ). Example this statement indicates whether the point center is within t...

  • Page 317

    317 integer() syntax (numericexpression).Integer integer(numericexpression) description function; rounds the value of numericexpression to the nearest whole integer. You can force an integer to be a string by using the string() function. Examples this statement rounds off the number 3.75 to the near...

  • Page 318

    318 interface() syntax xtra("xtraname").Interface() interface(xtra "xtraname") description function; returns a return-delimited string that describes the xtra and lists its methods. This function replaces the now obsolete mmessagelist function. Example this statement displays the output from the fun...

  • Page 319

    319 example in this example, tbox is the transform of the model named box, and tsphere is the transform of the model named sphere. The third line of the example interpolates the transform of box halfway to the transform of sphere. Tbox = member("3d world").Model("box").Transform tsphere = member("3d...

  • Page 320

    320 into this code fragment occurs in a number of lingo constructs, such as put...Into . Inverse() syntax member(whichcastmember).Model(whichmodel).Transform.Inverse() member(whichcastmember).Group(whichgroup).Transform.Inverse() member(whichcastmember).Camera(whichcamera).Transform.Inverse() sprite...

  • Page 321

    321 invertmask syntax member(whichquicktimemember).Invertmask the invertmask of member whichquicktimemember description quicktime cast member property; determines whether director draws quicktime movies in the white pixels of the movie’s mask ( true ) or in the black pixels ( false , default). This ...

  • Page 322

    322 isinworld() syntax member(whichcastmember).Model(whichmodel).Isinworld() member(whichcastmember).Camera(whichcamera).Isinworld() member(whichcastmember).Light(whichlight).Isinworld() member(whichcastmember).Group(whichgroup).Isinworld() description 3d command; returns a value of true if the pare...

  • Page 323

    323 example this statement checks the sprite type the behavior is being attached to and returns true for any graphic sprite except a shape and false for the script channel: on isoktoattach me, aspritetype, aspritenum case aspritetype of #graphic: -- any graphic sprite type return sprite(aspritenum)....

  • Page 324

    324 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.” if not sound(1...

  • Page 325

    325 the terms whichitem , firstitem , and lastitem must be integers or integer expressions that refer to the position of items in the chunk. Chunk expressions refer to any character, word, item, or line in any source of strings. Sources of strings include field and text cast members and variables th...

  • Page 326

    326 example the following handler finds the last component in a macintosh pathname. The handler first records the current delimiter and then changes the delimiter to a colon (:). When a colon is the delimiter, lingo can use the last item of to determine the last item in the chunk that makes up a mac...

  • Page 327

    327 you can use the key in handlers that perform certain actions when the user presses specific keys as shortcuts and other forms of interactivity. When used in a primary event handler, the actions you specify are the first to be executed. Note: the value of the key isn’t updated if the user presses...

  • Page 328

    328 keycode() syntax the keycode description function; gives the numerical code for the last key pressed. This keyboard code is the key’s numerical value, not the american national standards institute (ansi) value. Note: when a movie plays back as an applet, this function returns the values of only ...

  • Page 329

    329 on keydown syntax on keydown statement(s) end description system message and event handler; contains statements that run when a key is pressed. When a key is pressed, director searches these locations, in order, for an on keydown handler: primary event handler, editable field sprite script, fiel...

  • Page 330

    330 keydownscript syntax the keydownscript description system property; specifies the lingo that is executed when a key is pressed. The lingo is written as a string, surrounded by quotation marks, and can be a simple statement or a calling script for a handler. When a key is pressed and the keydowns...

  • Page 331

    331 adding the keyframeplayer modifier to a model by using the addmodifier command allows access to the following keyframeplayer modifier properties: • playing indicates whether a model is executing a motion. • playlist is a linear list of property lists containing the playback parameters of the mot...

  • Page 332

    332 keypressed() syntax the keypressed keypressed (keycode) keypressed (asciicharacterstring) description function; returns the character assigned to the key that was last pressed if no argument is used. The result is in the form of a string. When no key has been pressed, the keypressed is an empty ...

  • Page 333

    333 when a key is released, lingo searches these locations, in order, for an on keyup handler: primary event handler, editable field sprite script, field cast member script, frame script, and movie script. For sprites and cast members, on keyup handlers work only for editable strings. A keyup event ...

  • Page 334

    334 when the instructions you’ve specified for the keyupscript property are no longer appropriate, turn them off by using the statement set the keyupscript to empty . Examples the following statement sets keyupscript to if the key = return then go the frame + 1 . When this statement is in effect, th...

  • Page 335

    335 this handler determines the label that starts the current scene: on findlastlabel aa = label(0) repeat with i = 1 to (the labellist.Line.Count - 1) if aa = label(the labellist.Line[i]) then return the labellist.Line[i] end if end repeat end see also framelabel , label() , marker() last() syntax ...

  • Page 336

    336 example this statement displays the number of the last channel of the movie in the message window: put the lastchannel lastclick() syntax 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...

  • Page 337

    337 example this statement checks whether 10 seconds have passed since the last mouse click, rollover, or key press and, if so, sends the playhead to the marker help: if the lastevent > 10 * 60 then go to "help" see also lastclick() , lastkey , lastroll , starttimer lastframe syntax the lastframe de...

  • Page 338

    338 left syntax sprite(whichsprite).Left the left of sprite whichsprite description sprite property; identifies the left horizontal coordinate of the bounding rectangle of the sprite specified by whichsprite . Sprite coordinates are measured in pixels, starting with (0,0) at the upper left corner of...

  • Page 339

    339 leftindent syntax chunkexpression.Leftindent description text cast member property; contains the number of pixels the left margin of chunkexpression is offset from the left side of the text cast member. The value is an integer greater than or equal to 0. This property can be tested and set. Exam...

  • Page 340

    340 the length of a box is measured along its z axis. The default length of a box is 50. The length of a plane is measured along its y axis. The default length of a plane is 1. 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 vecto...

  • Page 341

    341 example the following statement sets the level property of the lod modifier of the model spaceship to 50. If the lod modifier’s auto property is set to false , spaceship will be drawn at a medium level of detail. If the lod modifier’s auto property is set to true , this code will have no effect....

  • Page 342

    342 line...Of syntax textmemberexpression.Line[whichline] line whichline of fieldorstringvariable textmemberexpression.Line[firstline..Lastline] line firstline to lastline of fieldorstringvariable description keyword; specifies a line or a range of lines in a chunk expression. A line chunk is any se...

  • Page 343

    343 linecount syntax member(whichcastmember).Linecount the linecount of member whichcastmember description cast member property; indicates the number of lines that appear in the field cast member on the stage according to the way the string wraps, not the number of carriage returns in the string. Ex...

  • Page 344

    344 lineheight (cast member property) syntax member(whichcastmember).Lineheight the lineheight of member whichcastmember description cast member property; determines the line spacing used to display the specified field cast member. The parameter whichcastmember can be either a cast member name or nu...

  • Page 345

    345 description function; returns a specific line’s distance, in pixels, from the top edge of the field cast member. 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 v...

  • Page 346

    346 example these statements, typed in the message window, opens a save dialog box to save the script random motion as an external file: member("random motion").Linkas() importfileinto, linked linked syntax member(whichmember).Linked the linked of member whichmember description cast member property;...

  • Page 347

    347 listp() syntax listp(item) description function; indicates whether the item specified by item is a list, rectangle, or point (1 or true ) or not (0 or false ). Example this statement checks whether the list in the variable designers is a list, rectangle, or point, and displays the result in the ...

  • Page 348

    348 description 3d cast member command; imports the assets of the w3d file, filename , into the cast member. The optional overwrite parameter indicates whether the assets of the w3d file replace the assets of the cast member ( true ) or are added to the assets of the cast member ( false ). The defau...

  • Page 349

    349 loc (backdrop and overlay) syntax sprite(whichsprite).Camera{(index)}.Backdrop[index].Loc member(whichcastmember).Camera(whichcamera).Backdrop[index].Loc sprite(whichsprite).Camera{(index)}.Overlay[index].Loc member(whichcastmember).Camera(whichcamera).Overlay[index].Loc description 3d backdrop ...

  • Page 350

    350 description function; returns a number that identifies which character in the specified field cast member is closest to the point within the field specified by location . The value for location is a point relative to the upper left corner of the field cast member. The value 1 corresponds to the ...

  • Page 351

    351 locv syntax sprite(whichsprite).Locv the locv of sprite whichsprite description sprite property; indicates the vertical position of the specified sprite’s registration point. Sprite coordinates are relative to the upper left corner of the stage. This property can be tested and set. To make the v...

  • Page 352

    352 this property can have an integer value from negative 2 billion to positive 2 billion. Larger numbers cause the sprite to appear in front of sprites with smaller numbers. If two sprites have the same locz value, the channel number then takes precedence for deciding the final display order of tho...

  • Page 353

    353 the lod modifier has the following properties: • auto allows the modifier to set the level of detail reduction as the distance between the model and the camera changes. The value of the modifier’s level property is updated, but setting the level property will have no effect when the auto propert...

  • Page 354

    354 example this statement sets the loop property of the cast member named walkers to true. Motions being executed by the first model in walker will repeat continuously. Member("walkers").Loop = true see also motion , play() (3d) , queue() (3d) , animationenabled loop (emitter) syntax member(whichca...

  • Page 355

    355 description cast member property; determines whether the specified digital video, sound, or flash movie cast member is set to loop ( true ) or not ( false ). Example this statement sets the quicktime movie cast member demo to loop: member("demo").Loop = 1 loop (flash property) syntax sprite(whic...

  • Page 356

    356 the loopbounds property has no effect if the movie’s loop property is set to false . If the loop property is set to true while the movie is playing, the movie continues to play. Director uses these rules to decide how to loop the movie: • if the ending time specified by loopbounds is reached, th...

  • Page 357

    357 example this handler displays an alert indicating how many times the loop in the cast member of sound 2 plays. If no loop has been set in the current sound of sound channel 2, sound(2).Loopcount returns 1. On showloopcount alert "the current sound’s loop plays" && sound(2).Loopcount && "times." ...

  • Page 358

    358 loopsremaining syntax sound(channelnum).Loopsremaining the loopsremaining of sound(channelnum) description read-only property; the number of times left to play a loop in the current sound playing in sound channel channelnum . If the sound had no loop specified when it was queued, this property i...

  • Page 359

    359 magnitude syntax whichvector.Magnitude description 3d property; returns the magnitude of a vector. The value is a floating-point number. The magnitude is the length of a vector and is always greater than or equal to0.0. ( vector (0, 0, 0) equals 0.) example this statement shows that the magnitud...

  • Page 360

    360 makesublist() syntax 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. Example beginning with the following xml: element 2 element 3 this statement returns a property list made fr...

  • Page 361

    361 map (3d) syntax member(whichcastmember).Motion(whichmotion).\ map(whichothermotion {, bonename}) description 3d motion command; maps the motion specified by whichothermotion into the current motion ( whichmotion ), and applies it to the bone specified by bonename and all of the children of that ...

  • Page 362

    362 mapstagetomember() syntax sprite(whichspritenumber). Mapstagetomember(whichpointonstage) mapstagetomember(sprite whichspritenumber, whichpointonstage) description function; uses the specified sprite and point to return an equivalent point inside the dimensions of the cast member. This properly a...

  • Page 363

    363 if the argument for marker is a string, marker returns the frame number of the first frame whose marker label matches the string. Examples the following statement sends the playhead to the beginning of the current frame if the current frame has a marker; otherwise, it sends the playhead to the p...

  • Page 364

    364 for best results, set a quicktime cast member’s mask property before any of its sprites appear on the stage in the on beginsprite event handler. Setting or changing the mask property while the cast member is on the stage can have unpredictable results (for example, the mask may appear as a freez...

  • Page 365

    365 example this statement generates a table, in the message window, of the maximum decimal value that can be represented by a certain number of binary digits: on showmaxvalues b = 31 v = the maxinteger repeat while v > 0 put b && "-" && v b = b-1 v = v/2 end repeat end maxspeed syntax member(whichc...

  • Page 366

    366 me syntax me description special variable; used within parent scripts and behaviors to refer to the current object that is an instance of the parent script or the behavior or a variable that contains the memory address of the object. The term has no predefined meaning in lingo. The term me is us...

  • Page 367

    367 media syntax member(whichcastmember).Media the media of member whichcastmember description cast member property; identifies the specified cast member as a set of numbers. Because setting the media member property can use large amounts of memory, this property is best used during authoring only. ...

  • Page 368

    368 example this statement changes cast members when the desired cast member is downloaded and available locally: if member("background").Mediaready = true then sprite(2).Membernum = 10 -- 10 is the number of cast member "background" end if see also frameready() mediastatus syntax sprite(whichsprite...

  • Page 369

    369 member syntax member(whichcastmember).Texture(whichtexture).Member member(whichcastmember).Model(whichmodel).Shader.Texture.Member member(whichcastmember).Model(whichmodel).Shaderlist\ [shaderlistindex].Texturelist[texturelistindex].Member description 3d texture property; if the texture’s type i...

  • Page 370

    370 examples the following statement sets the hilite property of the button cast member named enter bid to true : member("enter bid").Hilite = true this statement puts the name of sound cast member 132 into the variable soundname : put member(132, "viva las vegas").Name this statement checks the typ...

  • Page 371

    371 the member sprite property differs from the membernum sprite property, which specifies only the sprite’s number to identify its location in the cast but doesn’t specify the cast itself. The member sprite property also differs from mousemember and the obsolete castnum sprite properties, neither o...

  • Page 372

    372 membernum syntax sprite(whichsprite).Membernum the membernum of sprite whichsprite description sprite property; identifies the position of the cast member (but doesn’t identify the castlib) associated with the specified sprite whichsprite . Its value is the cast member number only; the cast memb...

  • Page 373

    373 members see number of members memorysize syntax the memorysize description system property; returns the total amount of memory allocated to the program, whether in use or free memory. This property is useful for checking minimum memory requirements. The value is given in bytes. In windows, the v...

  • Page 375

    375 mesh (property) syntax member(whichcastmember).Model(whichmodel).\ meshdeform.Mesh[index].Meshproperty description 3d command; allows access to the mesh properties of models that have the meshdeform modifier attached. When used as mesh.Count this command returns the total number of meshes within...

  • Page 376

    376 meshdeform (modifier) syntax 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 command) to a model you ha...

  • Page 377

    377 this handler counts the milliseconds and posts an alert if you’ve been working too long: on idle if the milliseconds > 1000 * 60 * 60 * 4 then alert "take a break" end if end see also ticks , time() , timer min syntax list.Min min(list) min (a1, a2, a3...) description function; specifies the min...

  • Page 378

    378 missingfonts syntax member(textcastmember).Missingfonts description text cast member property; this property contains a list of the names of the fonts that are referenced in the text, but not currently available on the system. This allows the developer to determine during run time if a particula...

  • Page 379

    379 this handler regularly cycles a sprite’s cast member among a number of bitmaps: on exitframe global gcounter -- these are sample values for bitmap cast member numbers thebitmaps = [2,3,4,5,6,7] -- specify which sprite channel is affected thechannel = 1 -- this cycles through the list gcounter = ...

  • Page 380

    380 this property can have the value #burst or #stream (default). A mode value of #burst causes all particles to be emitted at the same time, while a value of #stream causes a group of particles to be emitted at each frame. The number of particles emitted in each frame is determined using the follow...

  • Page 381

    381 description 3d command; returns the model found within the referenced cast member that has the name specified by whichmodel , or is found at the index position specified by index . If no model exists for the specified parameter, the command returns void . As model.Count , the command returns the...

  • Page 382

    382 example this example has three parts. The first part is the first line of code, which registers the #putdetails handler for the #collideany event. The second part is the #putdetails handler. When two models in the cast member named myscene collide, the #putdetails handler is called and the colli...

  • Page 383

    383 modelresource syntax member(whichcastmember).Modelresource(whichmodelresource) member(whichcastmember).Modelresource[index] member(whichcastmember).Modelresource.Count member(whichcastmember).Modelresource(whichmodelresource).\ propertyname member(whichcastmember).Modelresource[index].Propertyna...

  • Page 384

    384 #detailed returns a list of property lists, each representing an intersected model. Each property list will have the following properties: • #model is a reference to the intersected model object. • #distance is the distance from the camera to the point of intersection with the model. • #isectpos...

  • Page 385

    385 the optional levelofdetail parameter allows you to specify the level of detail of the information returned. The levelofdetail parameter can have the following values: #simple returns a list containing references to the models found under the point. This is the default setting. #detailed returns ...

  • Page 386

    386 modelunderloc syntax member(whichcastmember).Camera(whichcamera).\ modelunderloc(pointwithinsprite) description 3d command; returns a reference to the first model found under the point specified by pointwithinsprite within the rect of a sprite using the referenced camera. The location pointwithi...

  • Page 387

    387 modifiedby syntax member.Modifiedby the modifiedby of member description cast member property; records the name of the user who last edited the cast member, taken from the user name information provided during director installation. You can change this information in the director general prefere...

  • Page 388

    388 note that if both the toon and inker modifiers are applied to a model, only the first one that was added to the model is returned. This property can be tested but not set. Use the addmodifier and removemodifier commands to add and remove modifiers from models. Example this statement shows which ...

  • Page 389

    389 mostrecentcuepoint syntax sprite(whichsprite).Mostrecentcuepoint the mostrecentcuepoint of sprite whichsprite sound(channelnum).Mostrecentcuepoint the mostrecentcuepoint of sound channelnum description cast member, sound channel, and sprite property; for sound cast members, quicktime digital vid...

  • Page 390

    390 examples thismotion = member("3d world").Motion("wing flap") thismotion = member("3d world").Motion[7] put member("scene").Motion.Count -- 2 see also duration (3d) , map (3d) motionquality syntax sprite(whichqtvrsprite).Motionquality motionquality of sprite whichqtvrsprite description quicktime ...

  • Page 391

    391 this handler highlights the character under the pointer when the sprite contains a text cast member: property spritenum on mousewithin me if sprite(spritenum).Member.Type = #field then mc = the mousechar if mc hilite char mc of field sprite(spritenum).Member else alert "sorry, ’hilite’ and ’mous...

  • Page 392

    392 examples this handler checks whether the user clicks anywhere on the stage and sends the playhead to another frame if a click occurs: on mousedown if the clickon = 0 then go to frame "addsum" end this handler, assigned to a sprite script, plays a sound when the sprite is clicked: on mousedown pu...

  • Page 393

    393 when the mouse button is pressed and the mousedownscript property is defined, lingo executes the instructions specified for the mousedownscript property first. No other on mousedown handlers are executed, unless the instructions include the pass command so that the mousedown message can be passe...

  • Page 394

    394 example this example is a simple button behavior that switches the bitmap of the button when the mouse rolls over and then off the button: property spritenum on mouseenter me -- determine current cast member and switch to next in cast currentmember = sprite(spritenum).Member.Number sprite(sprite...

  • Page 395

    395 mouseitem syntax the mouseitem description system property; contains the number of the item under the pointer when the function is called and the pointer is over a field sprite. (an item is any sequence of characters delimited by the current delimiter as set by the itemdelimiter property.) count...

  • Page 396

    396 on mouseleave syntax on mouseleave statement(s) end description system message and event handler; contains statements that run when the mouse leaves the active area of the sprite. The mouse button does not have to be pressed. If the sprite is a bitmap cast member with the matte ink applied, the ...

  • Page 397

    397 this property can be tested and set. Example this frame script checks to see if the name of the quicktime sprite in channel 5 contains the string “qtvr.” if it does, this script sets mouselevel to #all ; otherwise, it sets mouselevel to #none . On prepareframe if sprite(5).Member.Name contains "...

  • Page 398

    398 mouseloc syntax the mouseloc description function; returns the current position of the mouse as a point(). The point location is given as two coordinates, with the horizontal location first, then the vertical location. See also mouseh , mousev mousemember syntax the mousemember description syste...

  • Page 399

    399 mouseoverbutton syntax sprite whichflashsprite.Mouseoverbutton the mouseoverbutton of sprite whichflashsprite description flash sprite property; indicates whether the mouse pointer is over a button in a flash movie sprite specified by the whichflashsprite parameter ( true ), or whether the mouse...

  • Page 400

    400 where you place an on mouseup handler can affect when it runs, as follows: • to apply the handler to a specific sprite, put it in a sprite script. • to apply the handler to a cast member in general, put it in a cast member script. • to apply the handler to an entire frame, put it in a frame scri...

  • Page 401

    401 on mouseupoutside syntax on mouseupoutside me statement(s) end description system message and event handler; sent when the user presses the mouse button on a sprite but releases it (away from) the sprite. Example this statement plays a sound when the user clicks the mouse button over a sprite an...

  • Page 402

    402 this statement sets mouseupscript to the custom handler mycustomhandler . A lingo custom handler must be enclosed in quotation marks when used with the mouseupscript property. The mouseupscript = "mycustomhandler" see also stopevent , mousedownscript , on mousedown (event handler) , on mouseup (...

  • Page 403

    403 if used in a behavior, this event is passed the sprite script or frame script reference me . Example this statement displays the mouse location when the mouse pointer is over a sprite: on mousewithin member("display").Text = string(the mouseh) end mousewithin see also on mouseenter , on mouselea...

  • Page 404

    404 moveablesprite syntax sprite(whichsprite).Moveablesprite the moveablesprite of sprite whichsprite description sprite property; indicates whether a sprite can be moved by the user ( true ) or not ( false ). You can make a sprite moveable by using the moveable option in the score. However, to cont...

  • Page 405

    405 movetoback syntax window("whichwindow ").Movetoback() movetoback window whichwindow description command; moves the window specified by whichwindow behind all other windows. Examples these statements move the first window in windowlist behind all other windows: mywindow = the windowlist[1] moveto...

  • Page 406

    406 movevertexhandle() syntax movevertexhandle(member memberref, vertexindex, handleindex, xchange, ychange) description function; moves the vertex handle of a vector shape cast member to another location. The horizontal and vertical coordinates for the move are relative to the current position of t...

  • Page 407

    407 movieaboutinfo syntax the movieaboutinfo description movie property; a string entered during authoring in the movie properties dialog box. This property is provided to allow for enhancements in future versions of shockwave. This property can be set but not tested. See also moviecopyrightinfo mov...

  • Page 408

    408 moviefilesize syntax the moviefilesize description movie property; returns the number of bytes in the current movie saved on disk. This is the same number returned when selecting file properties in windows or get info in the macintosh finder. Example this statement displays the number of bytes i...

  • Page 409

    409 movieimagequality syntax the movieimagequality description movie property; indicates the level of compression to use when the movieimagecompression property is set to #jpeg . The range of acceptable values is 0–100. Zero yields the lowest image quality and highest compression; 100 yields the hig...

  • Page 410

    410 this statement plays the sound file crash.Aif stored in the sounds subfolder of the current movie’s folder. Note the path delimiter used, indicating a windows environment: sound playfile 1, the moviepath&"sounds/crash.Aif" see also @ (pathname) , moviename movierate syntax sprite(whichsprite).Mo...

  • Page 411

    411 examples this statement displays the current time of the quicktime movie in channel 9 in the message window: put sprite(9).Movietime this statement sets the current time of the quicktime movie in channel 9 to the value in the variable poster : sprite(9).Movietime = poster see also duration movie...

  • Page 412

    412 multiply() syntax transform.Multiply(transform2) description 3d command; applies the positional, rotational, and scaling effects of transform2 after the original transform. Example this statement applies the positional, rotational, and scaling effects of the model mars’s transform to the transfo...

  • Page 413

    413 name (cast property) syntax castlib (whichcast).Name the name of castlib whichcast description cast member property; returns the name of the specified cast. This property can be tested and set. Example this code iterates through all the castlibs in a movie and displays their names in the message...

  • Page 414

    414 name (menu property) syntax the name of menu(whichmenu) the name of menu whichmenu description menu property; returns a string containing the name of the specified menu number. This property can be tested but not set. Use the installmenu command to set up a custom menu bar. Note: menus are not a...

  • Page 415

    415 name (window property) syntax window (whichwindow).Name the name of window whichwindow description window property; determines the name of the specified window in windowlist . (the title window property determines the title that appears in a window’s title bar.) this property can be tested and s...

  • Page 416

    416 name (xml property) syntax xmlnode.Name description xml property; returns the name of the specified xml node. Example beginning with this xml: element 2 element 3 this lingo returns the name of the second tag that is nested within the tag : put gparserobject.Child[1].Child[2].Name -- "e2" see al...

  • Page 417

    417 example the following statement sets the near property of the fog of the camera defaultview to 100. If the fog’s enabled property is set to true and its decaymode property is set to #linear , fog will first appear 100 world units in front of the camera. Member("3d world").Camera("defaultview").F...

  • Page 418

    418 netabort syntax netabort(url) netabort(netid) description command; cancels a network operation without waiting for a result. Using a network id is the most efficient way to stop a network operation. The id is returned when you use a network function such as getnettext() or postnettext() . In som...

  • Page 419

    419 this handler uses a specific network id as an argument for netdone to check the status of a specific network operation: on exitframe -- stay on this frame until the net operation is -- completed global mynetid if netdone(mynetid) = false then go to the frame end if end see also getnettext() , ne...

  • Page 420

    420 when a movie plays back as an applet, this function always returns a string. The string either has a length of 0 or consists of text that describes an error. The string’s content comes from java and can vary on different operating systems or browsers. The text may not be translated into the loca...

  • Page 421

    421 netmime() syntax netmime() description function; provides the mime type of the internet file that the last network operation returned (the most recently downloaded http or ftp item). The netmime function can be called only after netdone and neterror report that the operation is complete and succ...

  • Page 422

    422 netstatus syntax netstatus msgstring description command; displays the specified string in the status area of the browser window. The netstatus command doesn’t work in projectors. Example this statement would place the string “this is a test” in the status area of the browser the movie is runnin...

  • Page 423

    423 netthrottleticks syntax the netthrottleticks description system property; in the macintosh authoring environment, allows you to control the frequency of servicing to a network operation. The default value is 15. The higher the value is set, the smoother the movie playback and animation is, but l...

  • Page 424

    424 when new() is used to create a timeout object, the timeoutperiod sets the number of milliseconds between timeout events sent by the timeout object. The #timeouthandler is a symbol that identifies the handler that will be called when each timeout event occurs. The targetobject identifies the name...

  • Page 425

    425 the first statement in the following example creates a child object from the above script in the preceding example, and places it in a variable named mybird . The second statement makes the bird fly by calling the fly handler in the bird parent script: mybird = script("bird").New() mybird.Fly() ...

  • Page 426

    426 newcurve() syntax vectormember.Newcurve(positioninvertexlist) newcurve(vectormember, positioninvertexlist) description function; adds a #newcurve symbol to the vertexlist of vectorcastmember , which adds a new shape to the vector shape. The #newcurve symbol is added at positioninvertexlist . You...

  • Page 427

    427 newmesh syntax member(whichcastmember).Newmesh(name,numfaces, numvertices, numnormals,numcolors,numtexturecoordinates) description 3d command; creates a new mesh model resource using the arguments supplied. Note that after creating a mesh, you must set values for at least the vertexlist and face...

  • Page 428

    428 line 17 calls the build command to construct the mesh. Nm = member("shapes").Newmesh("pyramid",6 , 5, 0, 3) nm.Vertexlist = [ vector(0,0,0), vector(40,0,0), \ vector(40,0,40), vector(0,0,40), vector(20,50,20) ] nm.Colorlist = [ rgb(255,0,0), rgb(0,255,0), rgb(0,0,255) ] nm.Face[1].Vertices = [ 4...

  • Page 429

    429 newmodelresource syntax member(whichcastmember).Newmodelresource(newmodelresourcename \ { ,#type, #facing }) description 3d command; creates a new model resource, of the given #type and #facing (if specified), and adds it to the model resource palette. The #type parameter can be one of the follo...

  • Page 430

    430 newmotion() syntax member(whichcastmember).Newmotion(name) description 3d command; creates a new motion within the referenced cast member, and returns a reference to the new motion. A new motion can be used to combine several previously existing motions from the member’s motion list via the map(...

  • Page 431

    431 newshader syntax member(whichcastmember).Newshader(newshadername, #shadertype) description 3d command; creates a new shader of the specified #shadertype within the referenced cast member’s shader list and returns a reference to the new shader. All shaders in the shader list must have a unique na...

  • Page 432

    432 newtexture syntax member(whichcastmember).Newtexture(newtexturename \ {,#typeindicator, sourceobjectreference}) description 3d command; creates a new texture within the referenced member’s texture palette and returns a reference to the new texture. All textures in the member’s texture palette mu...

  • Page 433

    433 next repeat syntax next repeat description keyword; sends lingo to the next step in a repeat loop in a script. This function differs from that of the exit repeat keyword. Example this repeat loop displays only odd numbers in the message window: repeat with i = 1 to 10 if (i mod 2) = 0 then next ...

  • Page 434

    434 nodeexitcallback syntax sprite(whichqtvrsprite).Nodeexitcallback the nodeexitcallback of sprite whichqtvrsprite description quicktime vr sprite property; contains the name of the handler that runs when the quicktime vr movie is about to switch to a new active node on the stage. The message has t...

  • Page 435

    435 this statement shows the value of the vector thisvector before and after being normalized. Thisvector = vector(-50.0000, 0.0000, 0.0000) normalize(thisvector) put thisvector -- vector(-1.0000, 0.0000, 0.0000) see also getnormalized , randomvector , magnitude normallist syntax member(whichcastmem...

  • Page 436

    436 this property must be set to the same length as the face[index].Verticies list, or it can be an empty list [ ]. Do not set any value for this property if you are going to generate normal vectors using the generatenormals() command. If you make changes to this property, or a use the generatenorma...

  • Page 437

    437 nothing syntax nothing description command; does nothing. This command is useful for making the logic of an if...Then statement more obvious. A nested if...Then...Else statement that contains no explicit command for the else clause may require else nothing , so that lingo does not interpret the ...

  • Page 438

    438 number (cast property) syntax the number of castlib whichcast description cast property; indicates the number of the specified cast. For example, 2 is the castlib number for cast 2. This property can be tested but not set. Example this repeat loop uses the message window to display the number of...

  • Page 439

    439 number (characters) syntax the number of chars in chunkexpression description chunk expression; returns a count of the characters in a chunk expression. Chunk expressions are any character (including spaces and control characters such as tabs and carriage returns), word, item, or line in any con...

  • Page 440

    440 this statement sets the variable itemcounter to the number of items in the field names: itemcounter = the number of items in member("names").Text you can accomplish the same thing with text cast members using the syntax: itemcounter = member("names").Item.Count see also item...Of , count() , num...

  • Page 441

    441 examples this statement determines whether any custom menus are installed in the movie and, if no menus are already installed, installs the menu menubar: if the number of menus = 0 then installmenu "menubar" this statement displays in the message window the number of menus that are in the curren...

  • Page 442

    442 number (words) syntax the number of words in chunkexpression description chunk expression; returns the number of words in the chunk expression specified by chunkexpression . Chunk expressions are any character, word, item, or line in any container of characters. Containers include field cast mem...

  • Page 443

    443 number of xtras syntax the number of xtras description system property; returns the number of scripting xtra extensions available to the movie. The xtra extensions may be either those opened by the openxlib command or those present in the standard xtras folder. This property can be tested but no...

  • Page 444

    444 example in this example, thermosystem is a model resource of the type #particle. This statement sets the number of particles in thermosystem to 50000. Member("fires").Modelresource("thermosystem").Emitter.\ numparticles = 50000 see also emitter numsegments syntax member(whichcastmember).Modelres...

  • Page 445

    445 this handler removes any nonalphabetic characters from any arbitrary string and returns only capital letters: on forceuppercase input output = empty num = length(input) repeat with i = 1 to num theascii = chartonum(input.Char[i]) if theascii = min(max(96, theascii), 123) then theascii = theascii...

  • Page 446

    446 objectp() syntax objectp(expression) description function; indicates whether the expression specified by expression is an object produced by a parent script, xtra, or window ( true ) or not ( false ). The p in objectp stands for predicate. It is good practice to use objectp to determine which it...

  • Page 447

    447 this statement displays in the message window the beginning position of the string “micro” within the string “macromedia”: put offset("micro", "macromedia") the result is 0, because “macromedia” doesn’t contain the string “micro”. This handler finds all instances of the string represented by str...

  • Page 448

    448 on syntax on handlername {argument1}, {arg2}, {arg3} ... Statement(s) end handlername description keyword; indicates the beginning of a handler, a collection of lingo statements that you can execute using the handler name. A handler can accept arguments as input values and returns a value as a f...

  • Page 449

    449 open window syntax window(whichwindow).Open() open window whichwindow description window command; opens the window object or movie file specified by whichwindow and brings it to the front of the stage. If no movie is assigned to the window, the open file dialog box appears. • if you replace whic...

  • Page 450

    450 openxlib syntax openxlib whichfile description command; opens the xlibrary file specified by the string expression whichfile . If the file is not in the folder containing the current movie, whichfile must include the pathname. It is good practice to close any file you have opened as soon as you ...

  • Page 451

    451 example this handler checks whether the user is pressing the alt or the option key and, if so, calls the handler named dooptionkey : on keydown if (the optiondown) then dooptionkey(key) end keydown see also controldown , commanddown , key() , keycode() , shiftdown or syntax logicalexpression1 or...

  • Page 452

    452 example the following handler would be located in a movie script of a movie in a window (miaw). It places the user’s name and serial number into a display field when the window is opened: on preparemovie displaystring = the username put return & the organizationname after displaystring put retur...

  • Page 453

    453 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. On beginsprite me sprite(spritenum of me).Originmode = #point sprite(spritenum of me).Originh = 100 ...

  • Page 454

    454 originpoint syntax sprite whichvectororflashsprite.Originpoint the originpoint of sprite whichvectororflashsprite member(whichvectororflashmember).Originpoint the originpoint of member whichvectororflashmember description cast member and sprite property; controls the origin point around which sc...

  • Page 455

    455 the origin point can be set with floating-point precision using the separate originh and originv properties, or it can be set with integer precision using the single originpoint property. You can set the originv property only if the originmode property is set to #point . This property can be tes...

  • Page 456

    456 orthoheight syntax member(whichcastmember).Camera(whichcamera).Orthoheight member(whichcastmember).Camera[cameraindex].Orthoheight sprite(whichsprite).Camera.Orthoheight description 3d property; when camera.Projection is set to #orthographic , the value camera.Orthoheight gives the number of per...

  • Page 457

    457 example this statement displays the scale property of the third overlay in the sprite camera’s overlay list: put sprite(5).Camera.Overlay[3].Scale -- 0.5000 see also addoverlay , removeoverlay , beveldepth pageheight syntax member(whichcastmember).Pageheight the pageheight of member whichcastmem...

  • Page 458

    458 to display different bitmaps with different palettes simultaneously, set palettemapping to true . Director looks at each onscreen cast member’s reference palette (the palette assigned in its cast member properties dialog box) and, if it is different from the current palette, finds the closest ma...

  • Page 459

    459 pan (sound property) syntax sound(channelnum).Pan the pan of sound(channelnum) description property; indicates the left/right balance of the sound playing in sound channel channelnum .The range of values is from –100 to 100. -100 indicates only the left channel is heard. 100 indicate only the ri...

  • Page 460

    460 example this handler accepts any number of arguments, adds all the numbers passed in as parameters, and then returns the sum: on addnumbers sum = 0 repeat with currentparamnum = 1 to the paramcount sum = sum + param(currentparamnum) end repeat return sum end you would use it by passing in the va...

  • Page 461

    461 you can also alter the value of this property by using the addchild command. Example the following statement sets the parent property of the model named tire. Its parent is set to the model named car. Member("scene").Model("tire").Parent = \ member("scene").Model("car") see also child , addchild...

  • Page 462

    462 the return value is void if the operation succeeds, or an error code number string if it fails. To parse xml locally, use parsestring() . Examples this statement parses the file sample.Xml at mycompany.Com. Use doneparsing() to determine when the parsing operation has completed. Errorcode = gpar...

  • Page 463

    463 pass syntax pass description command; passes an event message to the next location in the message hierarchy and enables execution of more than one handler for a given event. The director player for java supports this command only within on keydown and on keyup handlers attached to editable sprit...

  • Page 464

    464 examples the following examples show that the password has been set for the realmedia stream in the cast member real or sprite 2. Put sprite(2).Password -- "********" put member("real").Password -- "********" the following examples show that the password has never been set for the realmedia stre...

  • Page 465

    465 path syntax member(whichcastmember).Modelresource(whichmodelresource).\ emitter.Path description 3d property; when used with a model resource whose type is #particle , allows you to get or set the path property of the resource’s particle emitter. This property is a list of vectors that define th...

  • Page 466

    466 pathname (movie property) this is obsolete. Use moviepath . Pathstrength syntax member(whichcastmember).Modelresource(whichmodelresource).\ emitter.Pathstrength description 3d property; when used with a model resource whose type is #particle , determines how closely the particles follow the path...

  • Page 467

    467 examples the following statements make the shape cast member target area a filled shape and assign it pattern 1, which is a solid color: member("target area").Filled = true member("target area").Pattern = 1 this handler cycles through eight tiles, with each tile’s number offset from the previous...

  • Page 468

    468 examples the following examples pause the playing of sprite 2 or the cast member real. Sprite(2).Pause() member("real").Pause() see also mediastatus , play (realmedia) , seek , stop (realmedia) pause() (sound playback) syntax sound(channelnum).Pause() pause(sound(channelnum)) description this co...

  • Page 469

    469 pausedatstart (realmedia) syntax sprite(whichsprite).Pausedatstart member(whichcastmember).Pausedatstart description realmedia sprite or cast member property; allows you to get or set whether a realmedia stream on the stage automatically begins to play when buffering is complete ( false or 0) or...

  • Page 470

    470 pause member syntax member(whichcastmember). Pause() pause member ("whichcastmember") description command; pauses the streaming of a shockwave audio (swa) streaming cast member. When the sound is paused, the state member property equals 4. The portion of the sound that has already been downloade...

  • Page 471

    471 the buffer is a type of memory cache that contains the portion of the movie that is about to play, usually just a few seconds. The stream enters the buffer as it streams to realplayer and leaves the buffer as realplayer plays the clip. The buffer allows viewers to view content without downloadin...

  • Page 472

    472 this property can be tested only after the swa sound starts playing or has been preloaded by means of the preloadbuffer command. This property cannot be set. Example this handler displays the percentage of the swa streaming cast member frank sinatra that has played and puts the value in the fiel...

  • Page 473

    473 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: on exitframe if member("splash screen").Percentstreamed go to the frame end if end see also percentplayed percentstreamed (3d) syntax ...

  • Page 474

    474 perpendicularto syntax vector1.Perpendicularto(vector2) description 3d vector command; returns a vector perpendicular to both the original vector and a second vector (vector2) . This command is equivalent to the vector crossproduct command. See crossproduct() . Example in this example, pos1 is a...

  • Page 475

    475 pi syntax pi description constant; returns the value of pi ( π ), the ratio of a circle’s circumference to its diameter, as a floating-point number. The value is rounded to the number of decimal places set by the floatprecision property. Example this statement uses the pi constant as part of an ...

  • Page 476

    476 this property can be read and but not set. Example this statement grabs the current content of the stage and places it into a bitmap cast member: member("stage image").Picture = (the stage).Picture see also media , picture (cast member property) picturep() syntax picturep(picturevalue) descripti...

  • Page 477

    477 the following are the possible values for this property’s parameters: • javaversion : 1.0 or 1.1 • browser : ie , netscape , or unknownbrowser • operatingsystem : macintosh , windows , or unknownos for example, if an applet is playing in microsoft internet explorer with java 1.1 in windows, plat...

  • Page 478

    478 each play command needs a matching play done command to avoid using up memory if the original calling script isn’t returned to. To avoid this memory consumption, you can use a global variable to record where the movie should return to. Examples this statement moves the playhead to the marker nam...

  • Page 479

    479 endtime is measured in milliseconds from the beginning of the motion. When looped is false , the motion begins at offset and ends at endtime . When looped is true , the first iteration of the loop begins at offset and ends at endtime with all subsequent repetitions beginning at starttime and end...

  • Page 480

    480 examples the following examples start the streaming process for the stream in sprite 2 and the cast member real. Sprite(2).Play() member("real").Play() see also mediastatus , pause (realmedia) , seek , stop (realmedia) play() (sound) syntax sound(channelnum).Play() sound(channelnum).Play(member(...

  • Page 481

    481 the following statement plays cast member creditsmusic in sound channel 2. Playback begins 4 seconds into the sound and ends 15 seconds into the sound. The section from 10.5 seconds to 14 seconds loops 6 times. Sound(2).Play([#member: member("creditsmusic"), #starttime: 4000, \ #endtime: 15000, ...

  • Page 482

    482 the play done command has no effect in a movie that is playing in a window. Example this handler returns the playhead to the frame of the movie that was playing before the current movie started: on exitframe play done end see also play playing syntax sprite(whichflashsprite).Playing the playing ...

  • Page 483

    483 playlist syntax member(whichcastmember).Model(whichmodel).Keyframeplayer.Playlist member(whichcastmember).Model(whichmodel).Bonesplayer.Playlist description 3d #keyframeplayer and #bonesplayer modifier property; returns a linear list of property lists, each representing a motion queued for playb...

  • Page 484

    484 example this handler begins the playback of the cast member big band: on mousedown member("big band").Play() end see also pause member , stop member playnext() syntax sound(channelnum).Playnext() playnext(sound(channelnum)) description this command immediately interrupts playback of the current ...

  • Page 485

    485 playrate syntax member(whichcastmember).Model(whichmodel).Bonesplayer.Playrate member(whichcastmember).Model(whichmodel).Keyframeplayer.Playrate description 3d #keyframeplayer and #bonesplayer modifier property; scale multiplier for the local time of motions being played. This property only part...

  • Page 486

    486 this handler moves a named sprite to the location that the user clicks: end mousedown on mousedown -- set these variables as needed for your own movie thesprite = 1 -- set the sprite that should move steps = 40 -- set the number of steps to get there initialloc = sprite(thesprite).Loc delta = (t...

  • Page 487

    487 examples this example points three objects at the model named mars: the camera named marscam, the light named brightspot, and the model named biggun: thisworldposn = member(“scene”).Model(“mars”).Worldposition member("scene").Camera("marscam").Pointat(thisworldposn) member("scene").Light("bright...

  • Page 488

    488 pointinhyperlink() syntax sprite(whichspritenumber).Pointinhyperlink(point) pointinhyperlink(sprite whichspritenumber, point) description text sprite function; returns a value ( true or false ) that indicates whether the specified point is within a hyperlink in the text sprite. Typically, the po...

  • Page 489

    489 example this example has two parts. The first part is the first line of code, which registers the #explode handler for the #collideany event. The second part is the #explode handler. When two models in the cast member myscene collide, the #explode handler is called and the collisiondata argument...

  • Page 490

    490 pointtoitem() syntax sprite(whichspritenumber).Pointtoitem(pointtotranslate) pointtoitem(sprite spritenumber, pointtotranslate) description function; returns an integer representing the item position in the text or field sprite spritenumber at screen coordinate pointtotranslate , or returns -1 i...

  • Page 491

    491 pointtoparagraph() syntax sprite(whichspritenumber).Pointtoparagraph(pointtotranslate) pointtoparagraph(sprite spritenumber, pointtotranslate) description function; returns an integer representing the paragraph number located within the text or field sprite spritenumber at screen coordinate poin...

  • Page 492

    492 position (transform) syntax member(whichcastmember).Node(whichnode).Transform.Position member(whichcastmember).Node(whichnode).Getworldtransform().\ position transform.Position description 3d property; allows you to get or set the positional component of a transform. A transform defines a scale,...

  • Page 493

    493 example this statement prevents the model monster from returning to its original position when it finishes the execution of a motion: member("newalien").Model("monster").Keyframeplayer.\ positionreset = false see also currentloopstate posterframe syntax member(whichflashmember).Posterframe the p...

  • Page 494

    494 the optional parameter serverosstring defaults to unix but may be set to windows or mac and translates any carriage returns in the posttext argument into those used on the server to avoid confusion. For most applications, this setting is unnecessary because line breaks are usually not used in fo...

  • Page 495

    495 preferred3drenderer syntax the preferred3drenderer description 3d movie property; allows you to get or set the default renderer used to draw 3d sprites within a particular movie if that renderer is available on the client machine. If the specified renderer is not available on the client machine,...

  • Page 496

    496 in director, setting the preload property to true causes the cast member to load completely before playback starts. In shockwave, setting the preload property to true causes the cast member to begin streaming when the movie starts playing. Before perfoming any lingo operations on a 3d cast membe...

  • Page 497

    497 preload (cast member property) syntax member(whichcastmember).Preload the preload of member whichcastmember description cast member property; determines whether the digital video cast member specified by whichcastmember can be preloaded into memory ( true ) or not ( false, default). The true sta...

  • Page 498

    498 example this statement loads the cast member mel torme into memory: member("mel torme").Preloadbuffer() see also preloadtime preloadeventabort syntax the preloadeventabort description movie property; specifies whether pressing keys or clicking the mouse can stop the preloading of cast members ( ...

  • Page 499

    499 preloadmode syntax castlib(whichcast).Preloadmode the preloadmode of castlib whichcast description cast member property; determines the specified cast’s preload mode and has the same effect as setting load cast in the cast properties dialog box. Possible values are the following: • 0—load cast w...

  • Page 500

    500 preloadnetthing() syntax preloadnetthing (url) description function; preloads a file from the internet to the local cache so it can be used later without a download delay. Replace url with the name of any valid internet file, such as a director movie, graphic, or ftp server location. The return ...

  • Page 501

    501 it is usually safe to preload the first couple of seconds of a video and then continue streaming from that point on. If you know the data rate of your movie, you can estimate the setting for preloadram . For example, if your movie has a data rate of 300k per second, set preloadram to 600k if you...

  • Page 502

    502 premultiply syntax transform1.Premultiply(transform2) description 3d transform command; alters transform1 by pre-applying the positional, rotational, and scaling effects of transform2 . If transform2 describes a rotation of 90° about the x axis and transform1 describes a translation of 100 units...

  • Page 503

    503 on preparemovie syntax on preparemovie statement(s) end 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. • ...

  • Page 504

    504 alternatively, the rotation may also be specified as a rotation about an arbitrary axis. This axis is defined in space by positionvector and directionvector . The amount of rotation about this axis is specified by angle . Node may be a reference to a model, group, light, or camera example the fo...

  • Page 505

    505 line 2 applies a scale to that transform prior to any existing positional or rotational effects of that transform. Assume that the transform represents the positional offset and rotational orbit of moon1 relative to its parent planet. Lets also assume moon2’s parent is the same as moon1’s. If we...

  • Page 506

    506 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) primitives syntax getrendererservices().Primitives des...

  • Page 507

    507 printfrom syntax printfrom fromframe {,toframe} {,reduction} description command; prints whatever is displayed on the stage in each frame, whether or not the frame is selected, starting at the frame specified by fromframe . Optionally, you can supply toframe and a reduction value (100%, 50%, or ...

  • Page 508

    508 property syntax property {property1}{, property2} {,property3} {...} description keyword; declares the properties specified by property1 , property2 , and so on as property variables. Declare property variables at the beginning of the parent script or behavior script. You can access them from ou...

  • Page 509

    509 proxyserver syntax proxyserver servertype, "ipaddress", portnum proxyserver() description command; sets the values of an ftp or http proxy server, as follows: • servertype — #ftp or #http • ipaddress —a string containing the ip address • portnum —the integer value of the port number if you use t...

  • Page 510

    510 while the playhead is in the same sprite, setting the sprite channel’s puppet sprite property to false resets the sprite’s properties to those set in the score. Making the sprite channel a puppet lets you control many sprite properties, such as member , loch , and width , from lingo after the pl...

  • Page 511

    511 the following statement makes grayscale the movie’s palette. The transition to the grayscale palette occurs over a time setting of 15 and between frames labeled gray and color. Puppetpalette "grayscale", 15, label("gray") - label("color") puppetsound syntax puppetsound whichchannel, whichcastmem...

  • Page 512

    512 the sprite channel’s initial properties are whatever the channel’s settings are when the puppetsprite command is executed. You can use lingo to change sprite properties as follows: • if a sprite channel is a puppet, any changes that lingo makes to the channel’s sprite properties remain in effect...

  • Page 513

    513 puppettransition syntax puppettransition member whichcastmember puppettransition whichtransition {,time} {, chunksize} {, changearea} description command; performs the specified transition between the current frame and the next frame. To use an xtra transition cast member, use puppettransition m...

  • Page 514

    514 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 chunksize and time . For example, if chunksize is 1 pixel, the transition ...

  • Page 515

    515 put syntax put expression description command; evaluates the expression specified by expression and displays the result in the message window. This command can be used as a debugging tool by tracking the values of variables as a movie plays. The director player for java displays the message from...

  • Page 516

    516 description command; evaluates a lingo expression, converts the value to a string, and inserts the resulting string before a specified chunk in a container, without replacing the container’s contents. (if chunkexpression specifies a nonexistent target chunk, the string value is inserted as appro...

  • Page 517

    517 qtregisteraccesskey syntax qtregisteraccesskey(categorystring, keystring) description command; allows registration of a key for encrypted quicktime media. The key is an application-level key, not a system-level key. After the application unregisters the key or shuts down, the media will no longe...

  • Page 518

    518 examples this statement displays a typical list describing a sprite: put sprite(1).Quad -- [point(153.0000, 127.0000), point(231.0000, 127.0000), \ point(231.0000, 242.0000), point(153.0000, 242.0000)] when modifying the quad sprite property, be aware that you must reset the list of points after...

  • Page 519

    519 quality (3d) syntax member(whichcastmember).Texture(whichtexture).Quality member(whichcastmember).Shader(whichshader).Texture\ (whichtexture).Quality member(whichcastmember).Model(whichmodel).Shader.Texture\ (whichtexture).Quality member( whichcastmember ).Model( whichmodel ).\ shader.Texturelis...

  • Page 520

    520 description function; adds the given sound cast member to the queue of sound channel channelnum . Once a sound has been queued, it can be played immediately with the play() command. This is because director preloads a certain amount of each sound that is queued, preventing any delay between the ...

  • Page 521

    521 queue() (3d) syntax member(whichcastmember).Model(whichmodel).Bonesplayer.Queue\ (motionname {, looped, starttime, endtime, scale, offset}) member(whichcastmember).Model(whichmodel).Keyframeplayer.\ queue(motionname {, looped, starttime, endtime, scale, offset}) description 3d keyframeplayer and...

  • Page 522

    522 quicktimeversion() syntax quicktimeversion() description function; returns a floating-point value that identifies the current installed version of quicktime and replaces the current quicktimepresent function. In windows, if multiple versions of quicktime 3.0 or later are installed, quicktimevers...

  • Page 523

    523 radius syntax modelresourceobjectreference.Radius member(whichcastmember).Modelresource(whichmodelresource).Radius description 3d model property; when used with model resource of type #sphere or #cylinder , allows you to get or set the radius of the model. The radius property determines the swee...

  • Page 524

    524 random() syntax random(integerexpression) description function; returns a random integer in the range 1 to the value specified by integerexpression . This function can be used to vary values in a movie, such as to vary the path through a game, assign random numbers, or change the color or positi...

  • Page 525

    525 randomseed syntax the randomseed description system property; specifies the seed value used for generating random numbers accessed through the random() function. Using the same seed produces the same sequence of random numbers. This property can be useful for debugging during development. Using ...

  • Page 526

    526 rawnew() syntax parentscript.Rawnew() rawnew(parentscript) description function; creates a child object from a parent script without calling its on new handler. This allows a movie to create child objects without initializing the properties of those child objects. This is particularly useful whe...

  • Page 527

    527 examples 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: put realplayernativeaudio() -- 0 the following code sets the realplayernativeaudio() function to true , which means tha...

  • Page 528

    528 realplayerversion() syntax realplayerversion() description realmedia function; returns a string identifying the build number of the realplayer software installed on the user’s system, or an empty string if realplayer is not installed. Users must have realplayer 8 or later in order to view direct...

  • Page 529

    529 example the following code shows that build number of the realplayer installed on the system is 6.0.9.357: put realplayerversion() -- "6.0.9.357" recordfont syntax recordfont(whichcastmember, font {[,face]} {,[bitmapsizes]} {,charactersubset} {, userfontname}) description command; embeds a truet...

  • Page 530

    530 rect (camera) syntax sprite(whichsprite).Camera(whichcamera).Rect description 3d camera property; allows you to get or set the rectangle that controls the size and position of the camera. This rectangle is analogous to the rectangle you see through the eyepiece of a real camera. The default valu...

  • Page 531

    531 examples this statement sets the variable newarea to a rectangle whose left side is at 100, top is at 150, right side is at 300, and bottom is at 400 pixels: set newarea = rect(100, 150, 300, 400) the following statement sets the variable newarea to the rectangle defined by the points firstpoint...

  • Page 532

    532 rect (member) syntax member(whichcastmember).Rect the rect of member whichcastmember description cast member property; specifies the left, top, right, and bottom coordinates, returned as a rectangle, for the rectangle of any graphic cast member, such as a bitmap, shape, movie, or digital video. ...

  • Page 533

    533 rect (window) syntax window whichwindow.Rect the rect of window whichwindow description window property; specifies the left, top, right, and bottom coordinates, as a rectangle, of the window specified by whichwindow . If the size of the rectangle specified is less than that of the stage where th...

  • Page 534

    534 you can get access to the string referred to by the reference using the text property of the reference: put myref.Text this would result in the actual string data, not information about the string. Reflectionmap syntax member(whichcastmember).Shader(whichshader).Reflectionmap description 3d shad...

  • Page 535

    535 region syntax member(whichcastmember).Modelresource(whichmodelresource).\ emitter.Region modelresourceobjectreference.Emitter.Region description 3d emitter property; when used with a model resource whose type is #particle , allows you to both get and set the region property of the resource’s par...

  • Page 536

    536 the eventname parameter can be any of the following predefined lingo events, or any custom event that you define: • #collideany is a collision event. • #collidewith is a collision event involving this specific model. The setcollisioncallback() command is a shortcut for using the registerscript()...

  • Page 537

    537 this statement declares the on promptuser handler in the same script that contains the registerforevent command to be called when any object collides with the model named pluto in the cast member named scene: member("scene").Registerforevent(#collidewith, #promptuser, me, \ member("scene").Model...

  • Page 538

    538 • #animationstarted and #animationended are notification events that occur when a bones or keyframe animation starts or stops playing. The handler will receive three arguments: eventname , motion , and time . The eventname argument is either #animationstarted or #animationended . The motion argu...

  • Page 539

    539 regpoint syntax member(whichcastmember).Regpoint the regpoint of member whichcastmember description cast member property; specifies the registration point of a cast member. The registration point is listed as the horizontal and vertical coordinates of a point in the form point (horizontal, verti...

  • Page 540

    540 regpointvertex syntax vectormember.Regpointvertex the regpointvertex of vectormember description cast member property; indicates whether a vertex of vectorcastmember is used as the registration point for that cast member. If the value is zero, the registration point is determined normally, using...

  • Page 541

    541 for objects whose parent hierarchy does not terminate in the world, this command does nothing. 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(whichmod...

  • Page 542

    542 removeoverlay syntax member(whichcastmember).Camera(whichcamera).Removeoverlay(index) description 3d command; removes the overlay found in the position specified by index from the camera’s list of overlays to display. Example the following statement removes the third overlay from the list of ove...

  • Page 543

    543 this property is a list that can contain the following possible values: • #opengl specifies the opengl drivers for a hardware acceleration which work with both macintosh and windows platforms. • #directx7_0 specifies the directx 7 drivers for hardware acceleration which work with windows platfor...

  • Page 544

    544 the renderformat property determines the pixel format the renderer uses when rendering the specified texture. Each pixel format has a number of digits, with each digit indicating the color depth being used for red, green, blue, and alpha. The value you choose determines the accuracy of the color...

  • Page 545

    545 while in a repeat loop, lingo ignores other events. To check the current key in a repeat loop, use the keypressed property. Only one handler can run at a time. If lingo stays in a repeat loop for a long time, other events stack up waiting to be evaluated. Therefore, repeat loops are best used fo...

  • Page 546

    546 the director player for java doesn’t detect mouse movements, update properties that indicate the mouse’s position, or update the status of mouse button presses when lingo is in a repeat loop. Example this handler turns sprites 1 through 30 into puppets: on puppetize repeat with channel = 1 to 30...

  • Page 547

    547 repeat with...In list syntax repeat with variable in somelist description keyword; assigns successive values from the specified list to the variable. While in a repeat loop, lingo ignores other events except keypresses. To check the current key in a repeat loop, use the keypressed property. Only...

  • Page 548

    548 on resizewindow syntax on resizewindow statement(s) end description system message and event handler; contains statements that run when a movie is running as a movie in a window (miaw) and the user resizes the window by dragging the window’s resize box or one of its edges. An on resizewindow eve...

  • Page 549

    549 resolve syntax member(whichcastmember).Model(whichmodel).Collision.Resolve description 3d collision property; allows you to get or set whether collisions are resolved when two models collide. If this property is set to true for both models involved in a collision, both models come to a stop at t...

  • Page 550

    550 resource syntax member(whichcastmember).Model(whichmodel).Resource description 3d property; allows you to get or set the resource property that defines the geometry of the referenced model resource. This property also allows access to the referenced model’s resource object and its associated pro...

  • Page 551

    551 examples this handler returns a random roll for two dice: on diceroll return random(6) + random(6) end in the following example, the two statements diceroll roll = the result are equivalent to this statement: set roll = diceroll() note that set roll = diceroll would not call the handler because ...

  • Page 552

    552 return (keyword) syntax return expression description keyword; returns the value of expression and exits from the handler. The expression argument can be any lingo value. When calling a handler that serves as a user-defined function and has a return value, you must use parentheses around the arg...

  • Page 553

    553 reverttoworlddefaults syntax member(whichcastmember).Reverttoworlddefaults() description 3d command; reverts the properties of the specified 3d cast member to the values stored when the member was first created. The member’s state property must be 4 (loaded) or -1 (error) before this command can...

  • Page 554

    554 example the following frame script checks whether the flash movie sprite in the sprite the behavior was placed in is playing and, if so, continues to loop in the current frame. When the movie is finished, the sprite rewinds the movie (so the first frame of the movie appears on the stage) and let...

  • Page 555

    555 example this statement calls the handler offrightedge when the right edge of sprite 3 is past the right edge of the stage: if sprite(3).Right > (the stageright - the stageleft) then offrightedge see also bottom , height , left , loch , locv , top , width right (3d) syntax member(whichcastmember)...

  • Page 556

    556 description system message and event handler; in windows, specifies statements that run when the right mouse button is pressed. On macintosh computers, the statements run when the mouse button and control key are pressed simultaneously and the emulatemultibuttonmouse property is set to true ; if...

  • Page 557

    557 rightmouseup (system property) syntax the rightmouseup description system property; indicates whether the right mouse button (windows) or the mouse button and control key (macintosh) are currently not being pressed ( true ) or are currently being pressed ( false ). On the macintosh, rightmouseup...

  • Page 558

    558 the following handler sends the playhead to different frames when the pointer is over certain sprites on the stage. It first assigns the rollover value to a variable. This lets the handler use the rollover value that was in effect when the rollover started, regardless of whether the user continu...

  • Page 559

    559 rootnode syntax member(whichcastmember).Camera(whichcamera).Rootnode sprite(whichsprite).Camera.Rootnode description 3d property; allows you to get or set which objects are visible within a sprite. When a camera is first created, it shows all nodes within the world. The rootnode property allows ...

  • Page 560

    560 • #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 rotation upon, the command applies the increments relative to the coordinate system of t...

  • Page 561

    561 when the rotation limit is reached (slightly past the 59,652th rotation), the rotation resets to +116.47° or -116.48°—not 0.00°. This is because +21,474,836.47° is equal to +116.47°, and - 21,474,836.48° is equal to -116.48° (or +243.12°). To avoid this reset condition, when you use lingo to per...

  • Page 562

    562 rotation (engraver shader) syntax member(whichcastmember).Shader(whichshader).Rotation member(whichcastmember).Model(whichmodel).Shader.Rotation member(whichcastmember).Model(whichmodel).Shaderlist[index].Rotation description 3d shader engraver property; allows you to get or set an angle in degr...

  • Page 563

    563 rotationreset syntax member(whichcastmember).Model(whichmodel).Bonesplayer.Rotationreset member(whichcastmember).Model(whichmodel).Keyframeplayer.\ rotationreset description 3d keyframeplayer and bonesplayer modifier property; indicates the axes around which rotational changes are maintained fro...

  • Page 564

    564 • browserplugin —the movie is running as a shockwave plug-in or other scripting environment, such as liveconnect or activex. • java applet —the movie is playing back as a java applet. The safest way to test for particular values in this property is to use the contains operator. This helps avoid ...

  • Page 565

    565 safeplayer syntax the safeplayer description system property; controls whether or not safety features in director are turned on. In a shockwave movie, this property can be tested but not set. It is always true in shockwave. In the authoring environment and in projectors, the default value is fal...

  • Page 566

    566 example this statement displays the name and samplecount of the cast member currently playing in sound channel 1 in the message window: put "sound cast member" && sound(1).Member.Name && "contains" && \ sound(1).Samplecount && "samples." see also channelcount , samplerate , samplesize samplerate...

  • Page 567

    567 examples this statement checks the sample size of the sound cast member voice over and assigns the value to the variable soundsize : soundsize = member("voice over").Samplesize this statement displays the sample size of the sound playing in sound channel 1 in the message window: put sound(1).Sam...

  • Page 568

    568 savemovie syntax savemovie {pathname&filename} description command; saves the current movie. Including the optional parameter saves the movie to the file specified by pathname:filename . This command does not work with compressed files. The specified filename must include the .Dir file extension...

  • Page 569

    569 examples the following sprite script keeps the playhead looping in the current frame while the quicktime sprite in channel 5 is scaled down in 5% increments. When the sprite is no longer visible (because its horizontal scale value is 0% or less), the playhead continues to the next frame. On exit...

  • Page 570

    570 scale (command) syntax member(whichcastmember).Node(whichnode).Scale(xscale, yscale, \ zscale) member(whichcastmember).Node(whichnode).Scale(uniformscale) transform.Scale(xscale, yscale, zscale) transform.Scale(uniformscale) description 3d transform command; applies a scaling after the current p...

  • Page 571

    571 scale (transform) syntax member(whichcastmember).Node(whichnode).Transform.Scale member(whichcastmember).Node(whichnode).Getworldtransform().Scale transform.Scale description 3d property; allows you to get or set the scaling component of a transform. A transform defines a scale, position and rot...

  • Page 572

    572 • #noscale —preserves the original size of the flash media, regardless of how the sprite is sized on the stage. If the sprite is made smaller than the original flash movie, the movie displayed in the sprite is cropped to fit the bounds of the sprite. • #autosize (default)—this specifies that the...

  • Page 573

    573 scorecolor syntax sprite(whichsprite).Scorecolor the scorecolor of sprite whichsprite description sprite property; indicates the score color assigned to the sprite specified by whichsprite . The possible values correspond to color chips 0 to 5 in the current palette. This property can be tested ...

  • Page 574

    574 script syntax the script of menuitem whichitem of menu whichmenu childobject.Script the script of childobject description menu item and child object property. For menu items, determines which lingo statement is executed when the specified menu item is selected. The whichitem expression can be ei...

  • Page 575

    575 this property can be tested and set. (it can be set only if the sprite already exists and has at least one instance of a behavior already attached to it.) examples this handler displays the list of script references attached to a sprite: on showscriptrefs spritenum put sprite(spritenum).Scriptin...

  • Page 576

    576 example this statement displays the number of the script attached to sprite 4: put sprite(4).Scriptnum see also scriptinstancelist scriptsenabled syntax member(whichcastmember).Scriptsenabled the scriptsenabled of member whichcastmember description director movie cast member property; determines...

  • Page 577

    577 scripttype syntax member whichscript.Scripttype the scripttype of member whichscript description cast member property; indicates the specified script’s type. Possible values are #movie , #score , and #parent . Example this statement makes the script member main script a movie script: member("mai...

  • Page 578

    578 examples this statement scrolls the field cast member today’s news down one page: member("today’s news").Scrollbypage(1) this statement scrolls the field cast member today’s news up one page: member("today’s news").Scrollbypage(-1) see also scrolltop scrolltop syntax member(whichcastmember).Scro...

  • Page 579

    579 sds (modifier) syntax member(whichcastmember).Model(whichmodel).Sds.Whichproperty description 3d modifier; adds geometric detail to models and synthesizes additional details to smooth out curves as the model moves closer to the camera. After you have added the sds modifier to a model using addmo...

  • Page 580

    580 searchcurrentfolder syntax the searchcurrentfolder description system property; determines whether director searches the current folder when searching file names. This property is true by default. • when the searchcurrentfolder property is true (1), director searches the current folder when reso...

  • Page 581

    581 examples this statement displays the paths that director searches when resolving filenames: put the searchpaths the following statement assigns two folders to searchpaths in windows. This version includes optional trailing backslashes. Set the searchpaths = ["c:\director\projects\", "d:\cdrom\so...

  • Page 582

    582 seek syntax sprite(whichsprite).Seek(milliseconds) member(whichcastmember).Seek(milliseconds) description realmedia sprite or cast member method; changes the media stream’s playback location to the location specified by the number of milliseconds from the beginning of the stream. The mediastatus...

  • Page 583

    583 example the following handler displays the currently selected text being placed in a local variable object. Then that object is used to reference various characteristics of the text, which are detailed in the message window. Property spritenum on mouseup me myselectionobject = sprite(spritenum)....

  • Page 584

    584 example this statement selects cast members 1 through 10 in castlib 1: castlib(1).Selection = [[1, 10]] this statement selects cast members 1 through 10, and 30 through 40, in castlib 1: castlib(1).Selection = [[1, 10], [30, 40]] selection (text cast member property) syntax member(whichtextmembe...

  • Page 585

    585 selstart syntax the selstart description cast member property; specifies the starting character of a selection. It is used with selend to identify a selection in the current editable field, counting from the beginning character. This property can be tested and set. The default value is 0. Exampl...

  • Page 586

    586 example this handler sends the custom message allspritesshouldbumpcounter and the argument 2 to all sprites when the user clicks the mouse: on mousedown me sendallsprites (#allspritesshouldbumpcounter, 2) end see also sendsprite sendevent syntax member(whichcastmember).Sendevent(#eventname, arg1...

  • Page 587

    587 example this handler sends the custom message bumpcounter and the argument 2 to sprite 1 when the user clicks: on mousedown me sendsprite (1, #bumpcounter, 2) end see also sendallsprites on sendxml syntax sendxml "sendxmlstring", "window", "postdata" description event handler; functions much lik...

  • Page 588

    588 serialnumber syntax the serialnumber description movie property; a string containing the serial number entered when director was installed. This property is available in the authoring environment only. It could be used in a movie in a window (miaw) tool that is personalized to show the user’s in...

  • Page 589

    589 setalpha() syntax imageobject.Setalpha(alphalevel) imageobject.Setalpha(alphaimageobject) description function; sets the alpha channel of an image object to a flat alphalevel or to an existing alphaimageobject . The alphalevel must be a number from 0–255. Lower values cause the image to appear m...

  • Page 590

    590 examples these statements create a property list and then adds the item #c:10 to the list: newlist = [#a:1, #b:5] put newlist -- [#a:1, #b:5] setaprop newlist, #c, 10 put newlist using the dot operator, you can alter the property value of a property already in a list without using setaprop : new...

  • Page 591

    591 when the handler runs, the message window displays the following: [12, 34, 6, 10, 45] see also [ ] (bracket access) setcallback() syntax flashspritereference.Setcallback(actionscriptobject, aseventname, #lingohandlername, lingoscriptobject) setcallback(actionscriptobject, aseventname, #lingohand...

  • Page 592

    592 setcollisioncallback() syntax member(whichcastmember).Model(whichmodel).Collision.\ setcollisioncallback (#handlername, scriptinstance) description 3d collision command; registers the handler #handlername in the given scriptinstance to be called when whichmodel is involved in a collision. This c...

  • Page 593

    593 example this statement sets the value of the #rotate property of the movie clip star in the flash member in sprite 3 to 180: sprite(3).Setflashproperty("star", #rotate, 180) see also getflashproperty() setpixel() syntax imageobject.Setpixel(x, y, colorobject) imageobject.Setpixel(point(x, y), co...

  • Page 594

    594 you can specify these parameters for each sound to be queued: to see an example of setplaylist() used in a completed movie, see the sound control movie in the learning/lingo examples folder inside the director application folder. Example this handler queues and plays the cast member intromusic, ...

  • Page 595

    595 this command does not perform any sophisticated manipulation of the string data or its formatting. You must perform any formatting or other manipulation in conjunction with getpref() ; you can manipulate the data in memory and write it over the old file using setpref . In a browser, data written...

  • Page 596

    596 setscriptlist() syntax spritereference.Setscriptlist(scriptlist) sprite(whichsprite).Setscriptlist(scriptlist) description this command sets the scriptlist of the given sprite. The scriptlist indicates which scripts are attached to the sprite and what the settings of each script property are. By...

  • Page 597

    597 example this statement opens the flash settings panel with the local storage tab active: sprite(3).Settingspanel(1) see also on mousedown (event handler) , rightmousedown (system property) , controldown settrackenabled syntax sprite(whichsprite).Settrackenabled(whichtrack, trueorfalse ) settrack...

  • Page 598

    598 shader syntax member(whichcastmember).Shader(whichshader) member(whichcastmember).Shader[index] member(whichcastmember).Model(whichmodel).Shader member(whichcastmember).Modelresource(whichmodelresource).\ face[index].Shader description 3d element, model property, and face property; the object us...

  • Page 599

    599 shaderlist syntax member(whichcastmember).Model(whichmodel).Shaderlist member(whichcastmember).Model(whichmodel).Shaderlist[index] description 3d model property; a linear list of shadowpercentage applied to the model. The number of entries in this list equals the number of meshes in the model re...

  • Page 600

    600 the range of this property is 0 to 100, and the default value is 50. The number of colors used by the toon modifier and painter shader for a model is determined by the colorsteps property of the model’s toon modifier or painter shader. Example the following statement sets the shadowpercentage pr...

  • Page 601

    601 shiftdown syntax the shiftdown description system property; indicates whether the user is pressing the shift key ( true ) or not ( false ). In the director player for java, this function returns true only if the shift key and another key are pressed simultaneously. If the shift key is pressed by...

  • Page 602

    602 short see date() (system clock) , time() showglobals syntax showglobals description command; displays all global variables in the message window. This command is useful for debugging scripts. Example this statement displays all global variables in the message window: showglobals see also cleargl...

  • Page 603

    603 description command; displays a list of the current property settings of a flash movie, vector member, or currently playing sound in the message window. This command is useful for authoring only; it does not work in projectors or in shockwave movies. Example this handler accepts the name of a ca...

  • Page 604

    604 shutdown syntax shutdown description command; closes all open applications and turns off the computer. Example this statement checks whether the user has pressed control+s (windows) or command+s (macintosh) and, if so, shuts down the computer: if the key = "s" and the commanddown then shutdown e...

  • Page 605

    605 size syntax member(whichcastmember).Size the size of member whichcastmember description cast member property; returns the size in memory, in bytes, of a specific cast member number or name. Divide bytes by 1024 to convert to kilobytes. Example this line outputs the size of the cast member shrine...

  • Page 606

    606 when the skew limit is reached (slightly past the 59,652th rotation), the skew resets to +116.47° or -116.48°—not 0.00°. This is because +21,474,836.47° is equal to +116.47°, and - 21,474,836.48° is equal to -116.48° (or +243.12°). To avoid this reset condition, constrain angles to ±360° in eith...

  • Page 607

    607 after a list is sorted, it maintains its sort order even when you add new variables using the add command. Example the following statement puts the list values, which consists of [ #a: 1, #d: 2, #c: 3 ], into alphanumeric order. The result appears below the statement. Put values -- [#a: 1, #d: 2...

  • Page 608

    608 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. If soundbusy(1) then go to the frame see also sound playfile , sound stop , status soundchannel (swa) s...

  • Page 609

    609 if you specify a channel (1–8) for this property and there are sounds currently playing in that channel (from other parts of the movie), they will be stopped and the realmedia audio will play in the channel instead. Concurrently playing realmedia cast members are not supported; if your movie con...

  • Page 610

    610 sounddevicelist syntax the sounddevicelist description system property; creates a linear list of sound devices available on the current computer. For the macintosh, this property lists one device, macsoundmanager. This property can be tested but not set. Example this statement displays a typical...

  • Page 611

    611 the sound(whichchannel).Fadein() syntax performs the fade over a specified number of frames or milliseconds. • when milliseconds is specified, the fade in occurs evenly over that period of time. • when milliseconds is not specified, the default number of ticks is calculated as 15 * (1000 / (temp...

  • Page 612

    612 if the sound is stopped before it reaches the minimum volume, it remains at the level it was stopped at, causing subsequent playback to be at this volume. Be sure to allow the sound to finish fading completely. Note: you may want to use the volume sound property to create a custom sound fade to ...

  • Page 613

    613 this property can be tested and set. To see an example of soundlevel used in a completed movie, see the sound control movie in the learning/lingo examples folder inside the director application folder. Examples this statement sets the variable oldsound equal to the current sound level: oldsound ...

  • Page 614

    614 examples this statement plays the file named thunder in channel 1: sound playfile 1, "thunder.Wav" this statement plays the file named thunder in channel 3: sound playfile 3, the moviepath & "thunder.Wav" see also sound stop sound stop syntax sound(whichchannel).Stop() sound stop whichchannel de...

  • Page 615

    615 sourcefilename syntax flashcastmember.Sourcefilename description flash cast member property; specifies the pathname of the fla source file to be used during launch-and-edit operations. This property can be tested and set. The default is an empty string. Example this lingo sets the sourcefilename...

  • Page 616

    616 specular (light) syntax member(whichcastmember).Light(whichlight).Specular description 3d light property; allows you to get or set whether specularity is on (true) or off (false) . Specularity refers to the ability to have a highlight appear on a model where the light hitting the model is reflec...

  • Page 617

    617 specularcolor syntax member(whichcastmember).Specularcolor description 3d cast member property; allows you to get or set the rgb value of the specular color of the first shader in the cast member. The first shader in the cast member’s shader palette is always the default shader. This and all oth...

  • Page 618

    618 spotangle syntax member(whichcastmember).Light(whichlight).Spotangle description 3d property; allows you to get or set the angle of the light projection cone. Light that is falls outside of the angle specified for this property, contributes no intensity. This property takes float value between 0...

  • Page 619

    619 sprite...Intersects syntax sprite(sprite1).Intersects(sprite2) sprite sprite1 intersects sprite2 description keyword; operator that compares the position of two sprites to determine whether the quad of sprite1 touches ( true ) or does not touch ( false ) the quad of sprite2 . If both sprites hav...

  • Page 620

    620 spritenum syntax spritenum the spritenum of me description sprite property; determines the channel number the behavior’s sprite is in and makes it available to any behaviors. Simply declare the property at the top of the behavior, along with any other properties the behavior may use. If you use ...

  • Page 621

    621 the projection plane is defined by the camera’s x and y axes, and is at a distance in front of the camera such that one pixel represents one world unit of measurement. It is this projection plane that is used for the sprite display on stage. The camera.Spritespacetoworldspace() form of this comm...

  • Page 622

    622 examples this statement causes the main stage movie to go to the marker named menu. This statement can be used in a movie in a window (miaw): tell the stage to go to "menu" this statement displays the current setting for the stage: put the stage.Rect --rect (0, 0, 640, 480) stagebottom syntax th...

  • Page 623

    623 examples this statement sets the variable oldcolor to the index number of the current stage color: related lingo: oldcolor = the stagecolor this statement sets the stage color to the color assigned to chip 249 on the current palette: related function: the stagecolor = 249 see also backcolor , bg...

  • Page 624

    624 sprite coordinates are expressed relative to the upper left corner of the stage. Example these two statements position sprite 3 a distance of 50 pixels from the right edge of the stage: stagewidth = the stageright - the stageleft sprite(3).Loch = stagewidth - 50 see also stageleft , stagebottom ...

  • Page 625

    625 when the movie plays back as an applet, the stagetop property is always 0, which is the location of the left side of the applet. This function can be tested but not set. Sprite coordinates are expressed relative to the upper left corner of the stage. Example this statement checks whether the top...

  • Page 626

    626 example this statement displays the starting frame of the sprite in channel 5 in the message window: put sprite(5).Startframe see also endframe() on startmovie syntax on startmovie statement(s) end description system message and event handler; contains statements that run just before the playhea...

  • Page 627

    627 example this statement reports in the message window whether the word macromedia starts with the string “macro”: put "macromedia" starts "macro" the result is 1, which is the numerical equivalent of true . See also contains starttime syntax sprite(whichsprite).Starttime the starttime of sprite w...

  • Page 628

    628 example this handler sets the timer to 0 when a key is pressed: on keydown starttimer end see also lastclick() , lastevent() , lastkey , lastroll , timeoutlength , timeoutmouse , timeoutplay , timeoutscript , timer state (3d) syntax member(whichcastmember).State description 3d property; returns ...

  • Page 629

    629 state (flash, swa) syntax member(whichcastmember).State state of member whichcastmember description cast member property; for shockwave audio (swa) streaming cast members and flash movie cast members, determines the current state of the streaming file. The properties streamname , url , and prelo...

  • Page 630

    630 example the following frame script checks to see if a flash movie cast member named intro movie has finished streaming into memory. If it hasn’t, the script reports in the message window the current state of the cast member and keeps the playhead looping in the current frame until the movie fini...

  • Page 631

    631 1 (connecting) indicates that streaming has begun but is in the very early stages of connecting to the server, and there is not enough information available locally to do anything with the cast member. This state is the equivalent of #connecting for the mediastatus property. 2 (open) indicates t...

  • Page 632

    632 example this sprite script displays in the message window the channel number of a flash movie sprite and indicates whether the flash movie contains animation: property spritenum on beginsprite me if sprite(spritenum).Static then animationtype = "does not have animation." else animationtype = "ha...

  • Page 633

    633 on stepframe syntax on stepframe statement(s) end description system message and event handler; works in script instances in actorlist because these are the only objects that receive on stepframe messages. This event handler is executed when the playhead enters a frame or the stage is updated. A...

  • Page 634

    634 example this statement checks whether the mouse button is being pressed and calls the handler dragprocedure if it is: if the stilldown then dragprocedure see also the mousedown (system property) stop (flash) syntax sprite(whichflashsprite).Stop() stop sprite whichflashsprite description flash co...

  • Page 635

    635 stop() (sound) syntax sound(channelnum).Stop() stop(sound(channelnum)) description command; stops the currently playing sound in sound channel channelnum . Issuing a play() command begins playing the first sound of those that remain in the queue of the given sound channel. To see an example of s...

  • Page 636

    636 neither subsequent scripts nor other behaviors on the sprite receive the event if it is stopped in this manner. See also pass stop member syntax member (whichcastmember ).Stop() stop member (whichcastmember) description command; stops the playback of a shockwave audio (swa) streaming cast member...

  • Page 637

    637 stoptime syntax sprite(whichsprite).Stoptime the stoptime of sprite whichsprite description sprite property; determines when the specified digital video sprite stops. The value of stoptime is measured in ticks. This property can be tested and set. Example this statement stops the digital video s...

  • Page 638

    638 the script also saves the actual number of bytes streamed in a variable called bytesreceived . If the number of bytes actually streamed does not match the number of bytes requested, the script updates a text cast member to report the number of bytes actually received. The script keeps the playhe...

  • Page 639

    639 streammode syntax member(whichflashmember).Streammode the streammode of member whichflashmember 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 direc...

  • Page 640

    640 streamsize syntax member(whichflashmember).Streamsize the streamsize of member whichflashmember description cast member property; reports an integer value indicating the total number of bytes in the stream for the specified cast member. The streamsize property returns a value only when the direc...

  • Page 641

    641 on streamstatus syntax on streamstatus url, state, bytessofar, bytestotal, error statement(s) end 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 ...

  • Page 642

    642 string() syntax string(expression) description function; converts an integer, floating-point number, object reference, list, symbol, or other nonstring expression to a string. Examples this statement adds 2.0 + 2.5 and inserts the results in the field cast member total: member("total").Text = st...

  • Page 643

    643 example this sets the strokecolor of cast member "line" to red: member("line").Strokecolor = rgb(255, 0, 0) see also color() , fillcolor , endcolor , backgroundcolor strokewidth syntax member(whichcastmember).Strokewidth description vector shape cast member property; indicates the width, in pixe...

  • Page 644

    644 subdivision syntax 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 in detail, with each f...

  • Page 645

    645 suspendupdates syntax sprite(which3dsprite).Suspendupdates description 3d sprite property; when set to true , causes the sprite not to be updated as part of normal screen redraw operations. This can improve movie playback performance. Certain kinds of screen updates will still affect the sprite,...

  • Page 646

    646 switchcolordepth syntax the switchcolordepth description system property; determines whether director switches the monitor that the stage occupies to the color depth of the movie being loaded ( true ) or leaves the color depth of the monitor unchanged when a movie is loaded ( false ). False is t...

  • Page 647

    647 this statement displays the symbol #goodbye : x = "goodbye" put x.Symbol -- #goodbye see also value() , string() symbolp() syntax expression.Symbolp symbolp(expression) description function; determines whether the expression specified by expression is a symbol ( true ) or not ( false ). The p in...

  • Page 648

    648 tab syntax tab description constant; represents the tab key. Examples this statement checks whether the character typed is the tab character and calls the handler donextfield if it is: if the key = tab then donextfield these statements move the playhead forward or backward, depending on whether ...

  • Page 649

    649 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]] tan() syntax tan(angle) description m...

  • Page 650

    650 targetframerate syntax sprite(which3dsprite).Targetframerate description 3d sprite property; determines the preferred number of frames per second to use when rendering a 3d sprite. The default value is 30 frames per second. The targetframerate property is only used if the usetargetframerate prop...

  • Page 651

    651 examples a multiple-line tell command resembles a handler and requires an end tell statement: global childmovie tell window childmovie go to frame "intro" the stagecolor = 100 sprite(4).Member = member "diana ross" updatestage end tell when a message calls a handler, a value returned from the ha...

  • Page 652

    652 examples this on preparemovie handler turns the on streamstatus handler on when the movie starts: on preparemovie tellstreamstatus(true) end this statement determines the status of the stream status handler: on mousedown put tellstreamstatus() end see also on streamstatus telltarget() syntax spr...

  • Page 653

    653 tension syntax member(whichcastmember).Model(whichmodel).Sds.Tension description 3d subdivision surface property; allows you to get or set a floating-point percentage between 0.0 and 100.0 that controls how tightly the newly generated surface matches the original surface. The higher this value, ...

  • Page 654

    654 examples this statement places the phrase “thank you.” in the empty cast member response: if member("response").Text = empty then member("response").Text = "thank you." this statement sets the content of cast member notice to “you have made the right decision!” member("notice").Text = "you have ...

  • Page 655

    655 texturecoordinatelist syntax member(whichcastmember).Modelresource(whichmodelresource). Texturecoordinatelist modelresourceobjectreference.Texturecoordinatelist description 3d property; when used with a model resource whose type is #mesh , or with a meshdeform modifier attached to a model, this ...

  • Page 656

    656 description 3d meshdeform modifier properties; using these properties you can get and set information about the texture layers of a specified mesh. You can have up to eight texture layers for a shader, each layer can contain only one texture, but the same texture can be specified for more than o...

  • Page 657

    657 texturemember syntax member(whichcastmember).Texturemember description 3d cast member property; indicates the name of the bitmap cast member used as the source of the default texture for the 3d cast member. The 3d cast member’s texturetype property must be set to #member for the texturemember pr...

  • Page 658

    658 texturemodelist syntax member(whichcastmember).Shader(whichshader).Texturemodelist member(whichcastmember).Shader(whichshader). Texturemodelist[texturelayerindex] member(whichcastmember).Model(whichmodel).Shader.Texturemodelist member(whichcastmember).Model(whichmodel).Shader. Texturemodelist[te...

  • Page 659

    659 example in this example, a shader is set up to simulate a reflective garden ball. The shader’s first texturelayer is set to a spherical mapping and the third texturelayer is set to use a #refection style mapping. The shader’s texturelist[3] entry will appear to reflected from the environment ont...

  • Page 660

    660 example the following statement sets the global texturerenderformat for the 3d member to #rgba8888 . Each texture in this movie will be rendered in 32-bit color unless its texture.Renderformat property is set to a value other than #default . Getrendererservices().Texturerenderformat = #rgba8888 ...

  • Page 661

    661 texturerepeatlist syntax shaderreference.Texturerepeatlist[texturelayerindex] member(whichcastmember).Shader(whichshader).Texturerepeatlist\ [texturelayerindex] member(whichcastmember).Shader[shaderlistindex].Texturerepeatlist\ [texturelayerindex] member(whichcastmember).Model(whichmodel).Shader...

  • Page 662

    662 texturetransform syntax member(whichcastmember).Shader(whichshader).Texturetransform member(whichcastmember).Model(whichmodel).Shader.Texturetransform member(whichcastmember).Model(whichmodel).Shaderlist{[index]}.\ texturetransform description 3d #standard shader property; provides access to a t...

  • Page 663

    663 this statement rotates the first texture used by the shader gbcyl3 by 90° from vector(0, 0, 0): member("scene").Shader("gbcyl3").Texturetransform.Rotation = \ vector(0, 0, 90) texturetransformlist syntax shaderreference .Texturetransformlist[texturelayerindex] member(whichcastmember).Shader(shad...

  • Page 664

    664 examples this statement shows the texturetransform of the third texture in the first shader used by the model gbcyl3: put member("scene").Model("gbcyl3").Shader.Texturetransformlist[3] -- transform(1.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, \ 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, ...

  • Page 665

    665 the syntax the property description keyword; must precede many functions and all lingo properties written in verbose syntax. This keyword also distinguishes the property or function from a variable or object name. Earlier versions of director required you to use the the keyword to express cast m...

  • Page 666

    666 tilt syntax tilt of sprite (whichqtvrsprite) description quicktime vr sprite property; the current tilt, in degrees, of the quicktime vr movie. This property can be tested and set. Time() syntax the time the short time the long time the abbreviated time the abbrev time the abbr time description ...

  • Page 667

    667 example this handler determines the time remaining until the next timeout event will be sent by the timeout object update by calculating the difference between its time property and the current value of the milliseconds and displaying the result in the field time until: on prepareframe msbeforeu...

  • Page 668

    668 timeouthandler syntax timeoutobject.Timeouthandler description system property; represents the name of the handler that will receive timeout messages from the given timeoutobject . Its value is a symbol, such as #timeexpiredhandler . The timeouthandler is always a handler within the timeout obje...

  • Page 669

    669 example the following statement sets the countdown member field to the value of the timeoutlapsed property. Dividing timeoutlapsed by 60 converts the value to seconds. Member("countdown").Text = string(the timeoutlapsed / 60) timeoutlength syntax the timeoutlength description system property; de...

  • Page 670

    670 examples this statement records the current setting of timeoutmouse by setting the variable named timing to the timeoutmouse : timing = the timeoutmouse the following statement sets the timeoutmouse property to false . The result is that the timeoutlapsed property keeps its current value when th...

  • Page 671

    671 timer syntax the timer description system property; a free running timer that counts time in ticks (1 tick = 1/60 second). It has nothing to do with the timeoutscript property. It is used only for convenience in timing certain events. The starttimer command sets timer to 0. The timer property is...

  • Page 672

    672 example this statement makes action view the title of window x: window("x").Title = "action view" titlevisible syntax window (whichwindow.Titlevisible) the titlevisible of window whichwindow description window property; specifies whether the window specified by whichwindow displays the window ti...

  • Page 673

    673 the #toon modifier has the following properties: note: for more detailed information about the following properties see the individual property entries. • style allows you to get or set the style applied to color transitions. The following are the possible values: #toon gives sharp transitions b...

  • Page 674

    674 top syntax sprite(whichsprite).Top the top of sprite whichsprite description sprite property; returns the top vertical coordinate of the bounding rectangle of the sprite specified by whichsprite asthe number of pixels from the upper left corner of the stage. When the movie plays back as an apple...

  • Page 675

    675 example this statement sets the topcap property of the model resource tube to false , meaning the top of this cylinder will be open: member("3d world").Modelresource("tube").Topcap = false topradius syntax modelresourceobjectreference.Topradius description 3d command; when used with a model reso...

  • Page 676

    676 this property can be tested and set. Example this statement turns the trace property on: the trace = true see also tracelogfile traceload syntax the traceload description movie property; specifies the amount of information that is displayed about cast members as they load: • 0—displays no inform...

  • Page 677

    677 trackcount (cast member property) syntax member(whichcastmember).Trackcount() trackcount(member whichcastmember) description digital video cast member property; returns the number of tracks in the specified digital video cast member. This property can be tested but not set. Example this statemen...

  • Page 678

    678 tracknextkeytime syntax sprite(whichdigitalvideosprite).Tracknextkeytime(whichtrack) tracknextkeytime(sprite whichsprite, whichtrack) description digital video sprite property; indicates the time of the keyframe that follows the current time in the specified digital video track. This property ca...

  • Page 679

    679 trackprevioussampletime syntax sprite(whichdigitalvideosprite).Trackprevioussampletime(whichtrack) trackprevioussampletime(sprite whichsprite, whichtrack) description digital video sprite property; indicates the time of the sample preceding the digital video’s current time. This property is usef...

  • Page 680

    680 trackstoptime (cast member property) syntax member(whichdigitalvideocastmember).Trackstoptime(whichtrack) trackstoptime(member whichcastmember, whichtrack) description digital video cast member property; returns the stop time of the specified track of the specified digital video cast member. It ...

  • Page 681

    681 example this statement assigns the text in track 5 of the digital video assigned at the current time to sprite 20 to the field cast member archives: member("archives").Text = string(sprite(20).Tracktext(5)) tracktype (cast member property) syntax member(whichdigitalvideocastmember).Tracktype(whi...

  • Page 682

    682 to erase trails, animate another sprite across these pixels or use a transition. Example this statement turns on trails for sprite 7: sprite(7).Trails = 1 see also directtostage transform (command) syntax transform() transform(n1,n2,n3, ... ,n14,n15,n16) description 3d command; this command crea...

  • Page 683

    683 transform (property) syntax member(whichcastmember).Node(whichnode).Transform member(whichcastmember).Node(whichnode).Transform.Transform\ property member(whichcastmember).Model(whichmodel).Bonesplayer.\ bone[boneid].Transform member(whichcastmember).Model(whichmodel).Bonesplayer.\ bone[boneid]....

  • Page 684

    684 if you want to modify the transform property of a bone within a model, then you must store a copy of the original transform of the bone, modify the stored copy using the above commands and properties, then reset the bone’s transform property so that it is equal to the modified transform. For exa...

  • Page 685

    685 description 3d command; applies a translation after the current positional, rotational, and scale offsets held by a referenced node’s transform object or the directly referenced transform object. The translation must be specified as a set of three increments along the three corresponding axes. T...

  • Page 686

    686 translation syntax member(whichquicktimemember).Translation the translation of member whichquicktimemember sprite(whichquicktimesprite).Translation the translation of sprite whichquicktimesprite description quicktime cast member and sprite property; controls the offset of a quicktime sprite’s im...

  • Page 687

    687 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 the following statement causes the model ...

  • Page 688

    688 trimwhitespace (property) syntax member(whichmember).Trimwhitespace description cast member property. Determines whether the white pixels around the edge of a bitmap cast member are removed or left in place. This property is set when the member is imported. It can be changed in lingo or in the b...

  • Page 689

    689 description a 3d extruder model resource property, as well as a text cast member property. Using this property allows you to get or set the extrusion depth (the distance between the front and back faces) of a 3d text model resource possible values are floating point numbers between 1.0 and 100.0...

  • Page 690

    690 • #age alters the color of the particle by linearly interpolating the color between colorrange.Start and colorrange.End over the lifetime of the particle. This is the default setting for this property. Example in this example, thermosystem is a model resource of the type #particle. This statemen...

  • Page 691

    691 for movies created in director 5 and 6, the type member property returns #field for field cast members and #richtext for text cast members. However, field cast members originally created in director 4 return #text for the member type, providing backward compatibility for movies that were created...

  • Page 692

    692 type (model resource) syntax member(whichcastmember).Modelresource(whichmodelresource).Type description 3d model resource property; the resource type of the referenced model resource. This property’s possible values are: • #box indicates that this model resource is a primitive box resource creat...

  • Page 693

    693 examples the following statement displays the type property of the motion named run. Put member("scene").Motion("run").Type -- #bonesplayer the following statement displays the type property of the motion named defaultmotion. Put member("scene").Motion("defaultmotion").Type -- #none see also bon...

  • Page 694

    694 type (texture) syntax member(whichcastmember).Shader(whichshader).Type description 3d texture property; the texture type of the referenced texture object. This property’s possible values are: • #fromcastmember indicates that this is texture was created from a director cast member supporting the ...

  • Page 695

    695 union() syntax rect(1).Union(rect(2)) union (rect1, rect2) description function; returns the smallest rectangle that encloses the two rectangles rect1 and rect2 . Example this statement returns the rectangle that encloses the specified rectangles: put union (rect (0, 0, 10, 10), rect (15, 15, 20...

  • Page 696

    696 unloadmember syntax unloadmember member(whichcastmember). Unload() unloadmember member whichcastmember member(whichcastmember, whichcastlib). Unload() unloadmember member whichcastmember of castlib whichcast member(firstcastmember). Unload(lastcastmember) unloadmember member firstcastmember, las...

  • Page 697

    697 if the movie isn’t already in ram, the result is -1. Examples this statement checks whether the largest contiguous block of free memory is less than 100k and unloads the movie parsifal if it is: if (the freeblock this statement unloads the movie at http://www.Cbdemille.Com/sunsetblvd.Dir: unload...

  • Page 698

    698 example when used in the following handler, the updateframe command enters the changes that have been made to the current frame and moves to the next frame each time lingo reaches the end of the repeat loop. The number of frames is determined by the argument numberofframes . On animball numberof...

  • Page 699

    699 example this statement instructs director to save changes to the current movie whenever the movie branches to another movie: the updatemovieenabled = true updatestage syntax updatestage description command; redraws the stage immediately instead of only between frames. The updatestage command red...

  • Page 700

    700 urlencode syntax urlencode(proplist_or_string {, serverosstring} {, characterset}) description function; returns the url-encoded string for its first argument. Allows cgi parameters to be used in other commands. The same translation is done as for postnettext and getnettext() when they are given...

  • Page 701

    701 usediffusewithtexture syntax member(whichcastmember).Shader(whichshader).Usediffusewithtexture description 3d standard shader property; allows you to get or set whether the diffuse color is used to modulate the texture ( true ) or not ( false ). When set to true , this property works in conjunct...

  • Page 702

    702 example this statement tells director to use its faster quad calculation code for all quad operations in the movie: the usefastquads = true see also quad usehypertextstyles syntax member(whichtextmember).Usehypertextstyles description text cast member property; controls the display of hypertext ...

  • Page 703

    703 userdata syntax member(whichcastmember).Model(whichmodel).Userdata member(whichcastmember).Light(whichlight).Userdata member(whichcastmember).Camera(whichcamera).Userdata member(whichcastmember).Group(whichcamera).Userdata description 3d property; returns the userdata property list of a model, g...

  • Page 704

    704 username (realmedia) syntax sprite(whichsprite).Username member(whichcastmember).Username sprite(whichsprite).Username = username member(whichcastmember).Username = username description realmedia sprite and cast member property; allows you to set the user name required to access a protected real...

  • Page 705

    705 value() syntax value(stringexpression) description function; returns the value of a string. The string can be any expression that lingo can understand. When value() is called, lingo parses through the stringexpression provided and returns its logical value. Any lingo expression that can be put i...

  • Page 706

    706 this statement parses the string "3 5" and returns the value of the portion of the string that lingo understands: put value("3 5") -- 3 see also string() , integer() , float() vector() syntax vector (x, y, z) description 3d data type and function; a vector describes a point in 3d space according...

  • Page 707

    707 vertex syntax member(whichvectorshapemember).Vertex[whichvertexposition] description chunk expression; enables direct access to parts of a vertex list of a vector shape cast member. Use this chunk expression to avoid parsing different chunks of the vertex list. It’s possible to both test and set...

  • Page 708

    708 example this statement displays the vertextlist value for an arched line with two vertices: put member("archie").Vertexlist -- [[#vertex: point(-66.0000, 37.0000), #handle1: point(-70.0000, -36.0000), \ #handle2: point(-62.0000, 110.0000)], [#vertex: point(66.0000, -5.0000), \ #handle1: point(12...

  • Page 709

    709 example this statement displays the #meshdeform modifier’s vertexlist for the first mesh in the model named triangle: put member("shapes").Model("triangle").Meshdeform.Mesh[1].Vertexlist -- [vector(0,0,0), vector(20,0,0), vector(20, 20, 0)] see also face , vertices , mesh (property) vertices syn...

  • Page 710

    710 example this statement turns off the video associated with the cast member interview: member("interview").Video = false see also settrackenabled , trackenabled video (realmedia) syntax sprite(whichsprite).Video member(whichcastmember).Video description realmedia property; allows you to set or ge...

  • Page 711

    711 viewh syntax sprite(whichvectororflashsprite).Viewh the viewh of sprite whichvectororflashsprite member(whichvectororflashmember).Viewh the viewh of member whichvectororflashmember description cast member and sprite property; controls the horizontal coordinate of a flash movie and vector shape’s...

  • Page 712

    712 changing the view point of a cast member changes only the view of a movie in the sprite’s bounding rectangle, not the location of the sprite on the stage. The view point is the coordinate within a cast member that is displayed at the center of the sprite’s bounding rectangle and is always expres...

  • Page 713

    713 one significant difference between the viewscale and scale properties is that viewscale always scales from the center of the sprite’s bounding rectangle, whereas scale scales from a point determined by the flash movie’s originmode property. This property can be tested and set. Note: this propert...

  • Page 714

    714 visible (sprite property) syntax sprite(whichsprite).Visible the visible of sprite whichsprite description sprite property; determines whether the sprite specified by whichsprite is visible ( true ) or not ( false ). This property affects all sprites in the channel, regardless of their position ...

  • Page 715

    715 • #back specifies that only those polygons facing away from the camera are drawn. Use this setting when you want to draw the inside of a model, or for models which are not drawing correctly, possibly because they were imported from a file format that used a different handiness value when computi...

  • Page 716

    716 examples 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: "female", #index: 5]...

  • Page 717

    717 voicegetpitch() syntax 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. Example these statements check whether the pitch of the current voice is abo...

  • Page 718

    718 example these statements check whether the text-to-speech volume is at least 55 and set it to 55 if is lower: if voicegetvolume() voicesetvolume(55) end if see also voicespeak() , voicepause() , voiceresume() , voicestop() , voicegetrate() , voicesetrate() , voicegetpitch() , voicesetpitch() , v...

  • Page 719

    719 voiceresume() syntax 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. Example these statements resume the speech when the playhead moves to the next frame in the score: on exitframe...

  • Page 720

    720 example this statement sets the pitch for the current voice to 75: voicesetpitch(75) see also voicespeak() , voicepause() , voiceresume() , voicestop() , voicegetrate() , voicesetrate() , voicegetpitch() , voicegetvolume() , voicesetvolume() , voicestate() , voicewordpos() voicesetrate() syntax ...

  • Page 721

    721 voicespeak() syntax voicespeak("string") description command; causes the specified string to be spoken by the text-to-speech engine. When this command is used, any speech currently in progress is interrupted by the new string. Example this statement causes the text-to-speech engine to speak the ...

  • Page 722

    722 example these statements stop the speech when the playhead moves to the next frame in the score: on exitframe voicestop() end exitframe see also voicespeak() , voicepause() , voiceresume() , voicegetrate() , voicesetrate() , voicegetpitch() , voicesetpitch() , voicegetvolume() , voicesetvolume()...

  • Page 723

    723 voidp() syntax voidp(variablename) description function; determines whether the variable specified by variablename has any value. If the variable has no value or is void , this function returns true . If the variable has a value other than void , this function returns false . Example this statem...

  • Page 724

    724 to see an example of volume (sound channel) used in a completed movie, see the sound control movie in the learning/lingo examples folder inside the director application folder. Example this statement sets the volume of sound channel 2 to 130, which is a medium sound level setting: sound(2).Volum...

  • Page 725

    725 width syntax member(whichcastmember).Width the width of member whichcastmember imageobject.Width sprite(whichsprite).Width the width of sprite whichsprite description cast member, image object and sprite property; for vector shape, flash, animated gif, bitmap, and shape cast members, determines ...

  • Page 726

    726 widthvertices syntax member(whichcastmember).Modelresource(whichmodelresource). Widthvertices modelresourceobjectreference.Widthvertices description 3d property; allows you to get or set the number of vertices (as an integer) on the x axis of a model resource whose type is #box or #plane . This ...

  • Page 727

    727 this statement moves the navigation window to the front: movetofront window "navigation" or window("navigation").Movetofront() see also close window , movetoback , movetofront , open window windowlist syntax the windowlist description system property; displays a list of references to all known m...

  • Page 728

    728 windowtype syntax window whichwindow.Windowtype the windowtype of window whichwindow description window property;controls the display style of the window specified by whichwindow , as follows: • 0—movable, sizable window without zoom box • 1—alert box or modal dialog box • 2—plain box, no title ...

  • Page 729

    729 word...Of syntax member(whichcastmember).Word[whichword] textmemberexpression.Word[whichword] chunkexpression.Word[whichword] word whichword of fieldorstringvariable fieldorstringvariable. Word[whichword] textmemberexpression.Word[firstword..Lastword] member(whichcastmember).Word[firstword..Last...

  • Page 730

    730 worldposition syntax member(whichcastmember).Model(whichmodel).Worldposition member(whichcastmember).Light(whichlight).Worldposition member(whichcastmember).Camera(whichcamera).Worldposition member(whichcastmember).Group(whichgroup).Worldposition description 3d property; allows you to get and no...

  • Page 731

    731 worldtransform syntax member(whichmember).Model(whichmodel).Bonesplayer.Bone[index].\ worldtransform description 3d bonesplayer property; allows you to get the world relative transform of a specific bone, as opposed to using the transform property which returns the bone’s parent relative transfo...

  • Page 732

    732 wraptransformlist syntax member( whichcastmember ).Shader( shadername ).Wraptransformlist\ [ texturelayerindex ] member( whichcastmember ).Shader[ shaderlistindex ].\ wraptransformlist[ texturelayerindex ] member( whichcastmember ).Model( modelname ).\ shader.Wraptransformlist[ texturelayerindex...

  • Page 733

    733 xaxis syntax member(whichcastmember).Transform.Xaxis description 3d transform property; allows you to get but not set the vector representing the transform’s canonical x-axis in transform space. Example the first line of this example sets the transform of the model modcylinder to the identity tr...

  • Page 734

    734 xtralist syntax the xtralist description system property; displays a linear property list of all available xtra extensions and their file versions. This property is useful when the functionality of a movie depends on a certain version of an xtra. There are two possible properties that can appear...

  • Page 735

    735 xtras see number of xtras y (vector property) syntax member(whichcastmember).Vector.Y member(whichcastmember).Vector[2] description 3d property; allows you to get or set the y component of a vector. Example this statement shows the y component of a vector: vec = vector(20, 30, 40) put vec.Y -- 3...

  • Page 736

    736 yon syntax member(whichcastmember).Camera(whichcamera).Yon description 3d property; allows you to get or set the distance from the camera defining where along the camera’s z axis the view frustum is clipped. Objects at a distance greater than yon are not drawn. The default value for this propert...

  • Page 737

    737 example the first line of this example sets the transform of the model modcylinder to the identity transform. The next two lines show that the z-axis of modcylinder is the vector ( 0.0000, 0.0000, 1.0000). This means that the z-axis of modcylinder is aligned with the z-axis of the world. The nex...

  • Page 738

    738 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: on zoomwindow centerplace = point(10, 10) sprite(3).Loc = centerplace end see also drawrect , sourcerect , on resizewindow.

  • Page 739

    739 index symbols " (quotation mark) 522 " (string constant) 54 # (symbol definition operator) 43, 517 & (concatenation operator) 45 && (concatenation operator) 46 () (parentheses operator) 47 * (multiplication operator) 47 + (addition operator) 48 - (subtraction operator) 44 -- (comment delimiter) ...

  • Page 740

    Index 740 blend range, end and start 99 bonesplayer modifier 32 borders of field cast members 104 of shape cast members 345 boxes for field cast members 362 lingo for 38 brackets ([]) 52 branching case keyword 120 end case keyword 212 if...Then statements 301 otherwise keyword 455 repeat while keywo...

  • Page 741

    Index 741 cast window, cast members selected in 583 casts activecastlib system property 59 cast numbers 438 castlib keyword 121 castlibnum of member 121 file names of 232 last cast member in 442 names of 413 number of in movies 438 preload mode of 499 saving changes to 567 cgi query 268 channel numb...

  • Page 742

    Index 742 collisions detection, and lingo 33 resolving 549 color depth colordepth property 146 depth of member property 188 of bitmap cast members 188 of monitors 146 setting (macintosh) 646 colors score color assigned to sprites 573 setting background colors with cast members 83 setting foreground ...

  • Page 743

    Index 743 cylinders lingo for 38 open and sealed 674 d date object 581 debugging with put command 515 with showglobals command 602 with showlocals command 602 delete key (macintosh) 85 deleting all items in list 181 cast members 218 chunk expressions 181 contents of frame’s sprite 133 frames from mo...

  • Page 744

    Index 744 on activatewindow 59 on alerthook 215 on closewindow 215 on cuepassed 215 on deactivatewindow 215 on endsprite 215 on enterframe 221, 472 on exitframe 221 on idle 297 on keydown 668 on keyup 332 on keyword 448 on mousedown 391, 669 on mouseenter 396 on mouseleave 396 on mouseup 402 on mous...

  • Page 745

    Index 745 finder, quitting from director to (macintosh) 522 finding empty cast members 238 filenames 270, 580 movies 270 flash asset xtra, endtelltarget command for 652 flash movies mixing sounds 613 setting properties of 592 setting variables in 597 flipped integer value 417 floating-point numbers ...

  • Page 746

    Index 746 importing 310 inker colors of 149 modifier 34 inks ink of sprite property 312 trails effect 681 inserting frames 315 installing menus defined in field cast members 316 integers maxinteger property 364 random 524 internet downloading cast members from 367 playing shockwave movies from 283 p...

  • Page 747

    Index 747 getone command 270 getpos command 273 getprop command 274 getpropat command 274 identifying items in 259, 260, 267, 270, 273, 274 ilk function 303 list operators ([]) 52 maximum value in 364 minimum value in 377 of movie windows 727 position of properties in property lists 238, 239 replaci...

  • Page 748

    Index 748 menus defining custom menus 373 in current movie 443 installing menus defined in field cast members 316 name of menu property 414 mesh colors of 147 lingo for 38 mesh deform modifier 36 message window displaying expression results in 515 displaying global variables 602 writing display to l...

  • Page 749

    Index 749 finding 270 go loop command 281 going to frames 280 idle time and 297 inserting frames 315 last frame in 337 length of in time 410 movie names 406, 409, 466 number of casts in 438 number of menus in 443 on stopmovie event handler 641 pausing 154, 467, 471 playback rates 410 playing from a ...

  • Page 750

    Index 750 parent nodes, lingo for 33 parent scripts ancestor property 71 me keyword 366 objects created by 446 parentheses operator () 47 parents 460 particle systems distribution 197 gravity 280 lingo for 38 particles, lingo for 38 paste command, enabling 208 pasting clipboard contents into cast me...

  • Page 751

    Index 751 rectangles changing dimensions of 312 coordinates of 532, 615 defining 530 inflate rect command 312 inside function 316 intersect function 319 offsetting 447 positioning and sizing 360 type of 303 union rect function 695 rects, identifying 347 redrawing stage 699 reflectivity 534 refreshin...

  • Page 752

    Index 752 shockwave movies names of external parameters 225 number of external parameters 225 opening 284 playing from internet 283 values from external parameters 226 short time format 666 size chunksize of member property 131 fixstagesize property 241 idlereadchunksize property 300 linesize of mem...

  • Page 753

    Index 753 stop time of tracks 680 stretching 642 trails effect 681 visibility of 714 square brackets ([]) 52 stage centering on monitor 124 fixstagesize property 241 position of on desktop 622, 623, 624 printing 507 redrawing 699 setting color of 622 size of after loading movies 241 sprite position ...

  • Page 754

    Index 754 t tab character constant 648 tab key 648 tabbing order, autotab of member property 82 tempo assigned to frames 256 settings 256 tempo channels as puppets 512 text ascii codes 128, 444 char...Of keyword 125 charpostoloc function 126 chars function 127 comparing strings 153 concatenation ope...

  • Page 755

    Index 755 updating frames 697 registration points 475 score 86, 214, 698 stage 699 urls, shockwave audio cast members and 699 user data 703 v values, comparing 120 variables global variables 134, 278, 602 local variables 602 property variables 508 voidp property 723 vectors, lingo for 42, 706 video ...

  • Page 756

    Index 756.