Page 2
This guide contains links to third-party Web sites that are not under the control of Macromedia, and Macromedia is not responsible for the content on any linked site. If you access a third-party Web site mentioned in this guide, then you do so at your own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia endorses or accepts any responsibility for the content on those third-party sites.
Page 3
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 voiceCount()
Page 4
Animated GIFs These terms are useful for working with animated GIFs: directToStage pause (movie playback) frameRate playBackMode linked resume sprite moviePath rewind sprite Animation These terms are useful for creating animation with Lingo: blend locV member (sprite property) regPoint locH tweened Behaviors The terms in this section are useful for authoring behaviors and using behaviors while the...
Page 5
Bitmaps The terms in this section are useful for working with bitmaps. Bitmap properties Use these terms to check and set bitmap properties: alphaThreshold foreColor backColor palette blend picture (cast member property) depth pictureP() dither rect (member) trimWhiteSpace (property) imageCompression imageQuality movieImageCompression movieImageQuality...
Page 6
Cast members The terms in this section are useful for working with cast members. Creating cast members to create cast members. importFileInto new() Authoring , and to work with cast members duplicate member erase member pasteClipBoardInto during authoring. Graphic cast members Use these terms to check and set the images assigned to graphic cast members: center palette...
Page 7
Cast management Use these terms to manage casts: activeCastLib number of members duplicate member pasteClipBoardInto erase member save castLib findEmpty() selection (cast property) move member Computer and operating system Use these terms to check and control the computer: beep freeBlock() beepOn freeBytes() cpuHogTicks...
Page 8
movieTime trackType (cast member property) pausedAtStart (Flash, digital video) trackType (sprite property) quickTimeVersion() trackCount (cast member property) timeScale trackCount (sprite property) trackEnabled video (QuickTime, AVI) trackNextKeyTime videoForWindowsPresent QuickTime Use these terms to work with QuickTime: enableHotSpot nodeType fieldOfView nudge getHotSpotRect() pan (QTVR property) hotSpotExitCallback ptToHotSpotID()
Page 9
Events Use these event handlers for Lingo that runs when a specific event occurs: activeCastLib on moveWindow close window on mouseWithin on cuePassed open window on deactivateWindow on prepareFrame on enterFrame on prepareMovie on EvalScript on resizeWindow on exitFrame on mouseUpOutside on idle on rightMouseDown (event handler) on keyDown...
Page 10
Managing external files Use these terms to manage external files: closeXlib showXlib open sound playFile openXlib Flash These terms are useful for working with Flash cast members: actionsEnabled originV broadcastProps pathName (movie property) bufferSize pausedAtStart (Flash, digital video) buttonsEnabled percentStreamed bytesStreamed play callFrame()
Page 11
hitTest() stream hold streamMode imageEnabled streamSize linked tellTarget() loop (keyword) mouseOverButton viewH newObject() viewPoint obeyScoreRotation viewScale originH viewV originMode volume (cast member property) originPoint These terms are useful for working with global Flash objects, which do not require a Flash cast member: clearAsObjects() setCallback()
Page 12
Interface elements The Lingo terms in this section are useful for working with interface elements. Menus Use these terms to create menus: enabled name (menu item property) installMenu number (menu items) menu number (menus) name (menu property) script Buttons and check boxes Use these terms to specify buttons and check boxes: alert checkBoxType...
Page 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: • is the numerical equivalent of FALSE FALSE • is the numerical equivalent of TRUE TRUE •...
Page 14
Lists The terms in this section are useful for working with lists. Creating lists , or to create a list. [ ] (list) duplicate() (list function) list() Adding list items Use these terms to add items to a list: [ ] (bracket access) addVertex append addVertex...
Page 15
Media synchronization Use these terms to synchronize animation and sound: cuePointNames on cuePassed cuePointTimes isPastCuePoint() mostRecentCuePoint 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 event handler for Lingo that runs when the movie is idle.
Page 16
Memory requirements to determine how much memory required for a cast member or a ramNeeded() size range of frames. Menus See Menus in the Interface elements section. Message window Use these terms to work in the Message window: traceLoad showXlib traceLogFile trace appMinimize...
Page 17
Mouse events Use these terms to set up handlers that respond to mouse events: mouseDownScript on mouseUp (event handler) mouseUpScript on mouseUpOutside on mouseDown (event handler) on mouseWithin on mouseEnter on rightMouseDown (event handler) on mouseLeave on rightMouseUp (event handler) Cursor control , and to control the...
Page 18
Communication between movies Use the command to send messages between movies. tell Movies The terms in this section are useful for managing movies. Stopping movies Use these terms to stop or quit the movie or projector: exitLock quit halt restart pauseState shutDown Movie information...
Page 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. Navigation...
Page 20
For additional on EvalScript externalEvent netStatus information about browser scripting using languages such as JavaScript, see “Shockwave Publishing” on the Director Support Center at www.macromedia.com/support/director/ internet.html. Accessing EMBED and OBJECT tag parameters , and to access...
Page 21
Parent scripts Use these terms to work with parent scripts and child objects: actorList property ancestor on stepFrame new() handler() handlers() rawNew() Points and rectangles These terms are useful for checking and setting points and rectangles. inflate quad inside() rect (camera) intersect() rect (sprite) map()
Page 22
Score The following terms let you work with the Score. Score properties , and to work with the movie’s Score. lastFrame score scoreSelection Score generation Use these terms to create Score content from Lingo: beginRecording scoreSelection clearFrame scriptNum deleteFrame scriptType duplicateFrame tweened endRecording...
Page 23
Sound The terms in this section are useful for playing sounds. Sound information Use these terms to get information about a sound: channelCount soundEnabled sound volume (sprite property) soundBusy() isBusy() sampleCount status Playing sound Use these terms to control how sound plays: puppetSound sound fadeOut sound close...
Page 24
Rotating sprites Use the sprite property to rotate sprites. rotation Dragging sprites Use these terms to set how the user can drag sprites: constrainH() moveableSprite constrainV() sprite...intersects constraint sprite...within Sprites and Lingo Use these terms to manage how Lingo controls sprites: puppetSprite spriteNum puppet...
Page 25
Sprite color Use these terms to check and set a sprite’s color: backColor color (sprite and cast member property) bgColor foreColor Stage These terms are useful for controlling the Stage and determining its size and location: centerStage stageColor fixStageSize stageLeft picture (window property) stageRight stage...
Page 26
line...of string() number (characters) stringP() number (items) value() number (lines) word...of Editable text Use the property to specify whether text is editable. editable Shocked fonts Use these terms to include Shocked fonts with downloaded text: recordFont bitmapSizes originalFont characterSet Character formatting Use these terms to format text: backColor fontf...
Page 27
Mouse pointer position in text Use these terms to detect where the mouse pointer is within text: pointInHyperlink() pointToParagraph() pointToChar() pointToWord() pointToItem() Text boxes for field cast members Use these terms to set up the box for a field cast member: border lineHeight() (function) boxType...
Page 28
Measuring time Use these terms to measure time in a movie: framesToHMS() ticks HMStoFrames() time() milliseconds timer startTimer Timeouts Use these terms to handle timeouts: timeoutKeyDown timeoutMouse timeoutLapsed timeoutPlay timeoutLength timeoutScript name (timeout property) period persistent target time() timeout() timeoutHandler timeoutList Transitions Use these terms to work with transitions:...
Page 29
Vector shapes Use these Lingo terms to work with vector shapes: addVertex gradientType antiAlias imageEnabled backgroundColor moveVertex() broadcastProps moveVertexHandle() centerRegPoint originH closed originMode defaultRect originPoint defaultRectMode originV deleteVertex() rotation directToStage scale endColor scaleMode fillColor showProps() fillCycles skew fillDirection static fillMode strokeColor fillOffset strokeWidth...
Page 30
Xtra extensions Use these terms to work with Xtra extensions: movieXtraList xtra name (system property) xtraList number of xtras xtras Chapter 1...
Page 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 player modifiers.
Page 32
Backdrops and overlays Use these terms to manipulate backdrops and overlays in 3D cast members: addBackdrop regPoint (3D) addOverlay removeBackdrop blend (3D) removeOverlay count rotation (backdrop and overlay) insertBackdrop scale (backdrop and overlay) insertOverlay source loc (backdrop and overlay) Bones player modifier Use these terms to control the functionality of the Bones player modifier: autoblend play() (3D)
Page 33
count scale (transform) deleteCamera transform (property) fieldOfView (3D) translate hither userData isInWorld() worldPosition name newCamera Child and parent nodes Use these terms to control parent-child relationships between models: addChild count child parent Collision detection These terms are useful for detecting and responding to collisions between models: collision (modifier) pointOfContact collisionData...
Page 34
cloneMotionFromCastmember newShader deleteCamera newTexture deleteGroup removeModifier deleteLight removeBackdrop deleteModel removeFromWorld deleteModelResource removeOverlay deleteMotion Use these terms to work with fog: color (fog) far (fog) decayMode enabled (fog) near (fog) Groups Use these terms to work with groups: addChild newGroup addToWorld pointAt boundingSphere pointAtOrientation...
Page 35
Keyframe player modifier Use these terms to control the functionality of the Keyframe player modifier: autoblend playing (3D) blendFactor playlist blendTime playNext() (3D) count playRate currentLoopState positionReset currentTime (3D) queue() (3D) keyframePlayer (modifier) removeLast() lockTranslation rootLock pause() (3D) rotationReset play() (3D) update Level of detail modifier Use these terms to control the functionality of the level of detail (LOD) modifier:...
Page 36
Mesh deform modifier Use these terms to control the functionality of the mesh deform modifier: add (3D texture) normalList face textureCoordinateList mesh (property) textureLayer meshDeform (modifier) vertexList (mesh deform) neighbor Miscellaneous clearAtRender resetWorld clearValue revertToWorldDefaults directToStage sendEvent loadFile() setCollisionCallback() registerForEvent() unregisterAllEvents registerScript() revertToWorldDefaults...
Page 37
name userData newModel visibility pointAt worldPosition pointAtOrientation 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. addModifier modifiers count...
Page 38
Primitives The following sections list the terms used to work with each type of primitive. Use the property to determine which types of primitives are supported by the primitives current 3D renderer. Boxes Use these terms to control properties of 3D boxes: back length (3D) bottom (3D)
Page 39
distribution pathStrength drag region gravity sizeRange (contains end and start) lifetime texture loop (emitter) tweenMode maxSpeed wind Planes Use these terms to control properties of 3D planes: length (3D) width (3D) lengthVertices widthVertices Spheres Use these terms to control properties of 3D spheres: endAngle resolution radius...
Page 40
diffuseColor textureModeList diffuseLightMap textureRepeat emissive textureRepeatList flat textureTransform glossMap textureTransformList name transparent newShader type (shader) renderStyle useDiffuseWithTexture region wrapTransformList reflectivity Engraver shader Use these terms to work with the Engraver shader: density rotation (engraver shader) brightness Newsprint shader Use these terms to work with the Newsprint shader: density brightness Painter shader...
Page 41
Subdivision surfaces modifier Use these terms to control the functionality of the subdivision surfaces (SDS) modifier: depth (3D) sds (modifier) enabled (sds) subdivision error tension Text (3D) Use these terms to control the appearance of 3D text: autoCameraPosition displayMode bevelDepth extrude3D bevelType smoothness...
Page 42
Transforms Use these terms to work with transforms: duplicate preRotate getWorldTransform() preScale() identity() preTranslate() interpolate() rotate interpolateTo() rotation (transform) inverse() scale (transform) invert() transform (property) multiply() translate pointAt worldPosition pointAtOrientation xAxis position (transform) yAxis preMultiply zAxis Vector math Use these terms to perform vector math operations: angleBetween getNormalized axisAngle...
Page 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 examples in a script, copy the example text from Director Help and paste it in the Script window.
Page 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 objectReference.objectProperty textExpression.objectProperty...
Page 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
For example, the command allows one argument that specifies which window to open window 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 &...
Page 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 parentheses is evaluated first. When parentheses are nested, the contents of the inner parentheses are evaluated before the contents of the outer ones.
Page 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 on two numerical expressions. If both expressions are integers, the sum is an integer.
Page 49
subtracts the values of from the corresponding components in vector1 vector2 vector2 and returns a new vector. vector1 subtracts the value of the scalar from each of the components in the vector and vector scaler returns a new vector. * (multiplication) Syntax vector1 * vector2 vector * scalar...
Page 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. < (less than) Syntax expression1 < expression2 Description Comparison operator; compares two expressions and determines whether is less than expression1 ), or whether...
Page 51
= (equals) Syntax expression1 = expression2 Description Comparison operator; compares two expressions, symbols, or objects and determines whether is equal to ), or whether is not equal to expression1 expression2 TRUE expression1 expression2 FALSE This operator can compare strings, integers, floating-point numbers, rects, lists, and points. Lists are compared based on the number of elements in the list.
Page 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, or other Text cast member chunk.
Page 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 command to create duplicate copies of lists. Lists are automatically disposed when they are no longer referred to by any variable. When a list is held within a global variable, it persists from movie to movie.
Page 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 files. Example This statement uses quotation marks to indicate that the string “San Francisco”...
Page 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 @ symbol when navigating between Director movies or changing the source of a linked media cast member.
Page 56
abbr, abbrev, abbreviated These elements are used by the functions. date time 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 handler. This differs from the keyword, exit which returns to the handler from which the current handler was called.
Page 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 Flash movie are enabled ( default) or disabled ( TRUE, FALSE This property can be tested and set.
Page 58
on activateWindow Syntax on activateWindow statement(s) 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 handler in a script that you want executed every time the on activateWindow movie becomes active.
Page 59
activeCastLib Syntax the activeCastLib Description System property; indicates which cast was most recently activated. The property’s activeCastLib value is the cast’s number. property is useful when working with the property. activeCastLib selection castLib Use it to determine which cast the selection refers to. This property can be tested but not set.
Page 60
Description Movie property; a list of child objects that have been explicitly added to this list. Objects in receive a message each time the playhead enters a frame. actorList stepFrame To add an object to , use . The object’s the actorList add actorList, theObject on stepFrame...
Page 61
add (3D texture) Syntax member(whichCastmember).model(whichModel).meshdeform.mesh[index].\ textureLayer.add() Description modifier command; adds an empty texture layer to the model’s mesh. meshdeform You can copy texture coordinates between layers using the following code: modelReference.meshdeform.texturelayer[a].texturecoordinatelist = modelReference.meshdeform.texturelayer[b].texturecoordinatelist Example This statement creates a new texture layer for the first mesh of the model named Ear. member("Scene").model("Ear").meshdeform.mesh[1].\ textureLayer.add() See also...
Page 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 applies the same texture as a backdrop for camera 1 of the cast member named Scene at the point (20, 20) with a rotation of 45 degrees.
Page 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 argument to maintain Bird’s world position. #preserveWorld member("3D").camera("MyCamera").addChild(member("3D").model ("Bird"), #preserveWorld)
Page 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. The overlay is displayed in the 3D sprite at with the indicated rotation. The locWithinSprite parameter is a 2D loc measured from the upper left corner of the sprite.
Page 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 model, group, camera, or light into the 3D world of the cast member as a child of the group named World. When a model, group, camera, or light is created or cloned, it is automatically added to the world.
Page 66
alert Syntax alert message Description Command; causes a system beep and displays an alert dialog box containing the string specified and an OK button. This command is useful for providing error messages of up to message 255 characters in your movie. The message must be a string.
Page 67
The fourth argument can have 1 of these 4 values: • - causes the handler to be triggered by the command. #alert alert • - causes the handler to be triggered by a file not found error while perforoming a #movie go to command.
Page 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 member("Rove").alignment = ("left center right").word[i] end repeat Verbose syntax:...
Page 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 defaults to , and can be tested and set.
Page 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 . This property can be tested and TRUE set. Set this property to to prevent users from changing the size of the movie in browsers FALSE and ShockMachine.
Page 71
Example This statement sets the property of the model named Chair to ambient 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, 0, 0) See also ambientColor newLight...
Page 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 within an ancestor script to 4: legCount me.legCount = 4...
Page 73
The result is 1, which is the numerical equivalent of TRUE The first logical expression in the following statement is ; and the second logical expression is TRUE . Because both logical expressions are not , the logical operator displays the result 0, FALSE TRUE which is the numerical equivalent of...
Page 74
animationEnabled Syntax member(whichCastmember).animationEnabled Description 3D cast member property; indicates whether motions will be executed ( ) or ignored ( TRUE FALSE This property can also be set in the Property inspector. The default value for this property is TRUE Example This statement disables animation for the cast member named Scene.
Page 75
Description This property indicates whether the 3D world in the sprite is anti-aliased. It can be whichSprite tested and set. The default value is , indicating that anti-aliasing is off. If the FALSE property is set to and the 3D renderer changes to a renderer that antiAliasingEnabled TRUE does not support anti-aliasing, the property is set to...
Page 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 property of the text antiAlias cast member is set to TRUE The setting itself is an integer indicating the font point size at which the anti-alias takes place.
Page 77
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 applicationPath & "\Film Noir\Sunset Boulevard")
Page 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 sets the property of the light named HouseLight to the vector (.5, 0, attenuation 0), darkening it slightly.
Page 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: <?xml version="1.0"?> <e1> <tagName attr1="val1" attr2="val2"/> <e2>element 2</e2> <e3>element 3</e3> here is some text </e1>...
Page 80
The following Lingo sets the property for sprite 2 and the cast member Real to , which audio FALSE 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)
Page 81
Example This statement turns off for the model named Alien3. The model’s autoblend blendFactor setting will be used for blending successive motions in the playlist. member("newaliens").model("Alien3").keyframePlayer.\ autoblend = FALSE See also blendFactor blendTime autoCameraPosition Syntax member(whichTextCastmember).autoCameraPosition Description 3D camera property; indicates whether the camera of the 3D text cast member is automatically positioned to show all of the text ( ) or not ( ).
Page 82
Using traditional Lingo syntax, the script is written as: on mouseEnter set the autoMask of member 5 = TRUE on mouseLeave set the autoMask of member 5 = FALSE autoTab Syntax member(whichCastMember).autoTab the autoTab of member whichCastMember Description Cast member property; determines the effect that pressing the Tab key has on the editable field or text cast member specified by .
Page 83
back Syntax member(whichCastmember).modelResource(whichModelResource).back Description model resource property; indicates whether the side of the box intersected by its +Z axis #box is sealed ( ) or open ( TRUE FALSE The default value for this property is TRUE Example This statement sets the property of the model resource named Crate to , meaning the back...
Page 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 to the background color of sprite 5: oldColor oldColor = sprite (5).backColor...
Page 85
indicates the registration point of the backdrop. regPoint (3D) indicates the opacity of the backdrop. blend (3D) indicates the number of items in the camera’s list of backdrops. count Use the following commands to create and remove backdrops: creates a backdrop from a texture and adds it to the end of the camera’s list of backdrops. addBackdrop creates a backdrop from a texture and adds it to the camera’s list of backdrops at a insertBackdrop...
Page 86
beep Syntax beep {numberOfTimes} Description Command; causes the computer’s speaker to beep the number of times specified by . If is missing, the beep occurs once. numberOfTimes numberOfTimes • In Windows, the beep is the sound assigned in the Sounds Properties dialog box. •...
Page 87
Example When used in the following handler, the keyword begins a Score generation beginRecording 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 of frames is determined by the argument numberOfFrames on animBall numberOfFrames...
Page 88
Example This handler plays the sound cast member Stevie Wonder when the sprite begins: on beginSprite me puppetSound "Stevie Wonder" See also on endSprite on prepareFrame scriptInstanceList bevelDepth Syntax member(whichTextCastmember).bevelDepth member(which3DCastmember).modelResource(whichModelResource).\ bevelDepth Description 3D text property; indicates the degree of beveling on the 3D text. For text cast members, this property has no effect unless the member’s property is displayMode...
Page 89
property has the following possible values: bevelType • #none • (the default) #miter • #round Example In this example, the cast member named Logo is a text cast member. This statement sets the of Logo to bevelType #round member("logo").beveltype = #round In this example, the model resource of the model named Slogan is extruded text.
Page 90
bias Syntax member(whichCastmember).model(whichModel).lod.bias Description modifier property; indicates how aggressively the modifier removes detail from the model when its property is set to . This property has no effect when the modifier’s auto TRUE auto property is set to FALSE. The range for this property is from 0.0 (removes all polygons) to +100.0 (removes no polygons). The default setting is 100.0.
Page 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 point sizes that were included when cast member 11 was created: put member(11).bitmapSizes -- [12, 14, 18] See also...
Page 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, which Lingo displays as a base 10 integer. Integer Binary number (abbreviated) 0101...
Page 93
Verbose syntax: property spriteNum on beginSprite me memName = sprite(spriteNum).member.name put "The bitRate of member"&&memName&&"is"&&member(memName).bitRate bitsPerSample Syntax member(whichCastMember).bitsPerSample the bitsPerSample of member whichCastMember Description Shockwave Audio (SWA) cast member property; indicates the bit depth of the original file that has been encoded for Shockwave Audio (SWA). This property is available only after the SWA sound begins playing or after the file has been preloaded using the command.
Page 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 a sprite’s blend value, from 0 to 100, corresponding to the blend values in the Sprite Properties dialog box.
Page 95
Description 3D backdrop, overlay, and shader property; indicates the opacity of the backdrop, #standard overlay, or shader. Setting the property of a shader will have no effect unless the shader’s blend transparent property is set to TRUE The range of this property is 0 to 100, and the default value is 100. Example This statement sets the blend property of the shader for the model named Window to 80.
Page 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 shader property; indicates the ratio used for blending a texture layer of the shader #standard with the texture layer below it. The shader’s texture list and the blend constant list both have eight index positions. Each index position in the blend constant list controls blending for the texture at the corresponding index position in the texture list.
Page 97
is used only when the property of the modifier is set to . If the BlendFactor autoblend FALSE value of the property is 100, the current motion will have none of the blendFactor characteristics of the motion that preceded it. If the value of is 0, the current blendFactor motion will have all of the characteristics of the motion that preceded it and none of its own.
Page 98
Example In this example, the shader list of the model named MysteryBox contains six shaders. This statement sets the property of the second shader to . This enables the settings of the blendFunction #blend List, , and properties. blendSource blendSource blendConstant blendConstantList member("Level2").model("MysteryBox").shaderList[2].\...
Page 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 Inspector, which shows values in the range 0 to 100.
Page 100
blendSource Syntax member(whichCastmember).shader(whichShader).blendSource member(whichCastmember).model(whichModel).shader.blendSource member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendSource Description shader property; indicates whether blending of the first texture layer in the #standard shader’s texture list is based on the texture’s alpha information or a constant ratio. If the shader’s property is set to , the texture blends with the color useDiffuseWithTexture TRUE...
Page 101
Description shader property; indicates whether blending of a texture layer with the texture #standard layers below it is based on the texture’s alpha information or a constant ratio. The shader’s texture list and the blend source list both have eight index positions. Each index position in the blend source list controls blending for the texture at the corresponding index position in the texture list.
Page 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(whichCastmember).modelResource(whichModelResource).\ bone.count member(whichCastmember).model(whichModel).bonesPlayer.\ bone[index].transform member(whichCastmember).model(whichModel).bonesPlayer.\ bone[index].worldTransform Description 3D element;...
Page 103
is a number that is multiplied by the parameter of the playRate scale play() queue() command to determine the playback speed of the motion. returns the number of motions currently queued in the playlist. playlist.count indicates whether the translational component of the motion is used or ignored. rootLock indicates whether the motion plays once or repeats continuously.
Page 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 Title 10 pixels wide. Dot syntax: member("Title").border = 10 Verbose syntax:...
Page 105
Description model resource property; indicates whether the side of the box intersected by its -Y axis #box is sealed ( ) or open ( TRUE FALSE The default value for this property is TRUE Example This statement sets the property of the model resource named GiftBox to , meaning bottom TRUE...
Page 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 portion of the text cast member. chunkExpression The value itself is an integer, where less than 0 indicates less spacing between paragraphs and greater than 0 indicates more spacing between paragraphs.
Page 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 member("newAlien").light[5].boundingSphere -- [vector(166.8667, -549.6362, 699.5773), 1111.0039] See also...
Page 108
breakLoop() Syntax sound(channelNum).breakLoop() Description This function causes the currently looping sound in channel to stop looping and channelNum play through to its . If there is no current loop, this function has no effect. endTime Example This handler causes the background music looping in sound channel 2 to stop looping and play through to its end: on continueBackgroundMusic sound(2).breakLoop()
Page 109
Example This frame script assumes that a Flash movie cast member named Navigation Movie has been set up with its property set to . The script momentarily allows changes to a broadcastProps FALSE Flash movie cast member to be broadcast to its sprites currently on the Stage. It then sets the property of the Flash movie cast member, and that change is broadcast to its sprite.
Page 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 member property can have only integer values. This bufferSize property has an effect only when the cast member’s property is set to preload FALSE...
Page 111
Line 4 defines the three colors allowed by the command. newMesh 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 colors will spread across the first face of Plane in gradients.
Page 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. property can have these values: buttonStyle •...
Page 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 property returns a value bytesStreamed only when the Director movie is playing. It returns an integer value. This property can be tested but not set.
Page 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 (default) and #once #always Specifying tells a movie to get a file from the Internet once and then use the file from the #once cache without looking for an updated version on the Internet.
Page 115
call Syntax call #handlerName, script, {args...} call (#handlerName, scriptInstance, {args...}) Description Command; sends a message that invokes a handler in specified scripts where is the handlerName name of the handler to be activated, references the script or a list of scripts, and script args any optional parameters to be passed to the handler.
Page 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 call msg, m...
Page 117
• This is the ancestor script: -- script "animal" property legCount on new me, newLegCount set legCount = newLegCount return me on run me put "Animal running with "& legCount &" legs" on walk me put "Animal walking with "& legCount &" legs" •...
Page 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{(index)}.whichCameraProperty Description 3D element; an object at a vector position from which the 3D world is viewed. Each sprite has a list of cameras. The view from each camera in the list is displayed on top of the view from camera with lower positions.
Page 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 default camera in a newly created 3D cast member. Example This statement shows that the position of the default camera of the cast member named Babyland is the vector (-117.5992, -78.9491, 129.0254).
Page 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 statements. if...then Lingo compares the value in to the expressions in the lines beneath it, starting case expression at the beginning and continuing through each line in order, until Lingo encounters an expression...
Page 121
This statement tests whether the cursor is over sprite 1, 2, or 3 and runs the corresponding case 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;...
Page 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 Wednesday Schedule.
Page 123
center Syntax member(whichCastMember).center the center of member whichCastMember Description Cast member property; interacts with the cast member property. crop • When property is property has no effect. the crop FALSE the center • When , cropping occurs around the center of the digital video crop TRUE center...
Page 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 Verbose syntax: on beginSprite me if the centerRegPoint of member the memberNum of me = TRUE then set the regPoint of member the memberNum of me = point(0,0) end if See also regPoint...
Page 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 channelCount of member whichCastMember sound(channelNum).channelCount Description Sound channel and cast member property;...
Page 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 keyword. Use the command to modify the char...of put...into...
Page 127
6, 10) -- "media" The following statement tries to identify the sixth through twentieth characters of the word Macromedia. Because the word has only 10 characters, the result includes only the sixth through tenth characters. put chars ("Macromedia", 6, 20) -- "media"...
Page 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").word[3..5].charSpacing member("myCaption").word[3..5].charSpacing = (mySpaceValue + 2) charToNum()
Page 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: • (default)—Lets the user set check boxes and radio buttons on and off. •...
Page 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 ) or not ( default). TRUE FALSE, value can be either a menu item name or a menu item number. The whichItem whichMenu value can be either a menu name or a menu number.
Page 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: <?xml version="1.0"?> <e1> <tagName attr1="val1" attr2="val2"/> <e2>element 2</e2> <e3>element 3</e3> here is some text </e1>...
Page 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 must set each reference to individually.
Page 133
Example This handler clears the cache when the movie starts: on startMovie clearCache See also cacheDocVerify() cacheSize() clearError Syntax member(whichFlashMember).clearError() clearError (member whichFlashMember) Description Flash command; resets the error state of a streaming Flash cast member to 0. When an error occurs while a cast member is streaming into memory, Director sets the cast member’s property to -1 to indicate that an error occurred.
Page 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 See also beginRecording endRecording updateFrame clearGlobals...
Page 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 handler displays the last mouse click location: on mouseDown on mouseDown put the clickLoc end mouseDown If the click were 50 pixels from the left end of the Stage and 100 pixels from the top of the Stage, the Message window would display the following: -- point(50, 100)
Page 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 Verbose syntax: on beginSprite me if the directToStage of sprite the spriteNum of me = FALSE then set the clickMode of sprite the spriteNum of me = #opaque else set the clickMode of sprite the spriteNum of me = #boundingBox...
Page 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; creates a copy of the model, group, light, or camera and all of its children. The clone is named and shares the parent of the model, group, light, or camera from cloneName which it was cloned.
Page 138
cloneModelFromCastmember Syntax member(whichCastmember).cloneModelFromCastmember\ (newModelName, sourceModelName, sourceCastmember) Description 3D command; copies the model named from the cast member sourceModelName , renames it , and inserts it into the cast member sourceCastmember newModelName as a child of its 3D world. whichCastmember This command also copies the children of , as well as the model resources, sourceModelName shaders, and textures used by the model and its children.
Page 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: • —the end points are closed. TRUE •...
Page 140
on closeWindow Syntax on closeWindow statement(s) Description System message and event handler; contains statements that run when the user closes the window for a movie by clicking the window’s close box. handler is a good place to put Lingo commands that you want executed on closeWindow every time the movie’s window closes.
Page 141
collision (modifier) Syntax member(whichCastmember).model(whichModel).\ collision.collisionModifierProperty Description 3D modifier; manages the detection and resolution of collisions. Adding the modifier collision to a model by using the command allows access to the following addModifier collision modifier properties: indicates whether collisions with the model are detected. enabled (collision) indicates whether collisions with the model are resolved.
Page 142
Example This example has three parts. The first part is the first line of code, which registers the handler for the event. The second part is the handler. #putDetails #collideAny #putDetails When two models in the cast member MyScene collide, the handler is called and #putDetails argument is sent to it.
Page 143
Example This example has two parts. The first part is the first line of code, which registers the #explode handler for the event. The second part is the handler. When two models #collideAny #explode in the cast member named MyScene collide, the handler is called and the #explode argument is sent to it.
Page 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) newColorObj.colorType = #paletteIndex put newColorObj -- paletteIndex(106)
Page 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 property is set to fog.enabled TRUE The default setting for this property is rgb(0, 0, 0) Example This statement sets the color of the fog of the camera named BayView to .
Page 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 medium blue: member(3).color = rgb("0033FF") See also...
Page 147
32,768 or 65,536 colors 16,777,216 colors If you try to set a monitor’s color depth to a value that monitor does not support, the monitor’s color depth doesn’t change. On computers with more than one monitor, the property refers to the monitor colorDepth displaying the Stage.
Page 148
This command must be set to a list of the same number of Lingo color values specified in the call. newMesh Example This statement shows that the third color in the of the model resource Mesh2 is colorList rgb(255, 0, 0). put member("shapes").modelResource("mesh2").colorlist[3] -- rgb(255,0,0) See also...
Page 149
You must use the model resource’s command after setting this property; otherwise, the build() changes will not take effect. Example This example creates a model resource whose type is , specifies its properties, and then #mesh creates a new model with it. Line 1 uses the command to create a model resource named Triangle, which...
Page 150
commandDown Syntax the commandDown Description Function; determines whether the Control key (Windows) or the Command key (Macintosh) is being pressed ( ) or not ( TRUE FALSE You can use together with the element to determine when the Control or commandDown the key Command key is pressed in combination with another key.
Page 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).texture(whichTexture).compressed Description 3D texture property; indicates whether the source cast member of the texture is compressed ) or not ( ).
Page 152
Examples These statements check the function for sprite 1 when it has left and right constrainH 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 (sprite 2) when the mouse pointer goes past the edge of the gauge: set the locH of sprite 1 to constrainH(2, the mouseH) See also...
Page 153
constrainV() Syntax constrainV (whichSprite, integerExpression) Description Function; evaluates and then returns a value that depends on the vertical integerExpression coordinates of the top and bottom edges of the sprite specified by , as follows: whichSprite • When the value is between the top and bottom coordinates, the value doesn’t change. •...
Page 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 Note: The string comparison is not sensitive to case or diacritical marks; “a” and Å are treated the same. See also offset() (string function) starts...
Page 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; setting it to 0 hides the controller.
Page 156
You can include an optional property list of parameters in order to manipulate the pixels being copied before they are placed into the . The property list may contain any or all destinationRect of the following parameters: Property Use and Effect #color The foreground color to apply for colorization effects.
Page 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 resized to fit the rectangle into which it is pasted.
Page 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 or applications. Examples This statement copies the cast member named chair to the Clipboard: member("chair").copyToClipboard() This statement copies cast member number 5 to the Clipboard: member(5).copyToClipboard()
Page 159
To see an example of used in a completed movie, see the Text movie in the Learning/ count() 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...
Page 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 World").texture.count put member("3D World").modelResource("mesh2").face.count -- 4 This statement shows that the first mesh of the model named Ear is composed of 58 faces.
Page 161
creaseAngle Syntax member(whichCastmember).model(whichModel).inker.creaseAngle member(whichCastmember).model(whichModel).toon.creaseAngle Description modifier property; indicates the sensitivity of the line drawing function of inker toon the modifier to the presence of creases in the model’s geometry. Higher settings result in more lines (detail) drawn at creases. property of the modifier must be set to for the property to creases...
Page 162
createMask() Syntax imageObject.createMask() Description This function creates and returns a mask object for use with the function. copyPixels() Mask objects aren’t image objects; they’re useful only with the function for copyPixels() duplicating the effect of mask sprite ink. To save time, if you plan to use the same image as a mask more than once, it’s best to create the mask object and save it in a variable for reuse.
Page 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 it for anything.
Page 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 to trim existing cast members, or in conjunction with the picture of the Stage to crop grab a snapshot and then crop it to size for display.
Page 165
cross Syntax vector1.cross(vector2) Description 3D vector method; returns a vector which is perpendicular to both vector1 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 , which is pos1.cross(pos2)
Page 166
Description System message and event handler; contains statements that run each time a sound or sprite passes a cue point in its media. • —The optional parameter is the value of the script being invoked. scriptInstanceRef You must include this parameter when using the message in a behavior. If this parameter is omitted, the other arguments will not be processed correctly.
Page 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, and animation. This property is supported by SoundEdit cast members, QuickTime digital video cast members, and Xtra extension cast members that support cue points.
Page 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 property’s value is 0. currentSpriteNum property is similar to , but it doesn’t require the...
Page 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, duration...
Page 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 not saved. If the stream is playing when the property is set or changed, a seek action takes currentTime...
Page 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
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; determines the cursor used when the pointer is over the sprite specified by the integer expression .
Page 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 member whichCursorCastMember Description Cursor cast member property;...
Page 174
curve Syntax member.curve[curveListIndex] Description This property contains the of an individual curve (shape) from a vector shape cast vertexList member. You can use the curve property along with the property to get individual vertices vertex of a specific curve in a vector shape. is a list of vertices, and each vertex is a property list containing up to three vertexList properties: a #vertex property with the location of the vertex, a #handle1 property with the...
Page 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 to determine what the parts of the short date indicate.) •...
Page 176
The individual properties of the date object instance returned are: #year Integer representing the year #month Integer representing the month of the year #day Integer representing the day of the month Examples These statements create and determine the number of days between two dates: myBirthDay = date(19650712) yourBirthDay = date(19450529) put "There are"...
Page 177
On the Macintosh, rather than a Message window being opened, a log file is generated to allow Lingo statements to output data for debugging purposes. This file is located in the Shockwave folder at HardDrive/System Folder/Extensions/Macromedia/Shockwave. To open this Message window, set the property to .
Page 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 in which fog density builds from minimum to maximum density when the camera’s property is set to fog.enabled TRUE...
Page 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 property to the specified rectangle. defaultRect on setDefaultFlashRect whichCast, whichRect repeat with i = 1 to the number of members of castLib whichCast if member(i, whichCast).type = #flash then member(i, whichCast).defaultRect = whichRect end if...
Page 180
delay Syntax delay numberOfTicks Description Command; pauses the playhead for a given amount of time. The integer expression specifies the number of ticks to wait, where each tick is 1/60 of a second. The numberOfTicks only mouse and keyboard activity possible during this time is stopping the movie by pressing Control+Alt+period (Windows) or Command+period (Macintosh).
Page 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 used in a completed movie, see the Text movie in the Learning/ delete Lingo Examples folder inside the Director application folder.
Page 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 delete it: on myDeleteAt theList, theIndex if theList.count <...
Page 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 edge of a 640-by-480-pixel Stage and deletes the frame if it has: on testSprite beginRecording...
Page 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 delete lights from the cast member named Room. member("Room").deleteLight("ambientRoomLight") member("Room").deleteLight(6) See also...
Page 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 PicnicScene. The second line deletes the fifth motion in PicnicScene. member("PicnicScene").deleteMotion("BackFlip") member("PicnicScene").deleteMotion(5) See also...
Page 186
• For property lists, replace with the name of the property to be deleted. Deleting a item 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 from the list [#height:100, #width: 200, #color: 34, #ink: 15], which is called spriteAttributes:...
Page 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 vertex point in the vector shape Archie: member("Archie").deleteVertex(2) See also moveVertex() originMode vertexList...
Page 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. Depth Number of Colors Black and white 4 colors 4, 8 16 or 256 palette-based colors, or gray levels Thousands of colors Millions of colors...
Page 189
depthBufferDepth Syntax getRendererServices().depthBufferDepth Description property; indicates the precision of the hardware depth buffer of the rendererServices user’s system. The value is either 16 or 24, depending on the user’s hardware settings. Example This statement shows that the value of the user’s video card is 16: depthBufferDepth put getRendererServices().depthBufferDepth -- 16...
Page 190
diffuse Syntax member(whichCastmember).shader(whichShader).diffuse member(whichCastmember).model(whichModel).shader.diffuse member(whichCastmember).model(whichModel).shaderList{[index]}.\ diffuse Description shader property; indicates a color that is blended with the first texture of the #standard shader when the following conditions are met: • the shader’s property is set to , and either useDiffuseWithTexture TRUE •...
Page 191
diffuseLightMap Syntax member(whichCastmember).shader(whichShader).diffuseLightMap member(whichCastmember).model(whichModel).shader.diffuseLightMap member(whichCastmember).model(whichModel).shaderList{[index]}.\ diffuseLightMap Description shader property; specifies the texture to use for diffuse light mapping. #standard When you set this property, the following properties are automatically set: • The second texture layer of the shader is set to the texture you specified. •...
Page 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 #videoForWindows This property can be tested but not set. Example The following statement tests whether the cast member Today’s Events is a QuickTime or AVI (Audio-Video Interleaved) digital video and displays the result in the Message window: put member("Today’s Events").digitalVideoType See also...
Page 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 property of the cast member named Room to rgb(0, directionalColor 255, 0).
Page 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, vector shape, 3D, or Flash Asset cast member plays. If this property is (1), the cast member TRUE plays in front of all other layers on the Stage, and ink effects have no affect.
Page 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 , and . You can show any combination of faces, and the list #front #tunnel #back can be in any order.
Page 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 ( ) or not ( ). When set to , this property displays the TRUE FALSE TRUE RealNetworks logo in the RealMedia viewer at the beginning of the stream, when the video is stopped, or when the video is rewound.
Page 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 property are #gaussian #linear The default value is #linear Example In this example, ThermoSystem is a model resource whose type is .
Page 198
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 when the parser has completed parsing a document using 1 (TRUE) .
Page 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 is the cosine of the angle between the two vectors. dotproduct To manually arrive at the dot of two vectors, multiply the x component of by the x vector1...
Page 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, handler runs. If a second click doesn’t occur within the specified period, doubleClickAction handler runs: singleClickAction...
Page 201
drag Syntax member(whichCastmember).modelResource(whichModelResource).drag Description model resource property; indicates the percentage of each particle’s velocity that is #particle lost in each simulation step. This property has a range of 0 (no velocity lost) to 100 (all velocity lost and the particle stops moving). The default value is 0. Example In this example, ThermoSystem is a model resource whose type is .
Page 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() fill()
Page 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 = member("MyRoom").model[1].transform.position.duplicate() See also clone duplicateFrame Syntax...
Page 204
To see an example of used in a completed movie, see the Vector duplicate() (list function) 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 CustomerRecord CustomerRecord = CustomersToday.duplicate() duplicate() (image function)
Page 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 is a streaming sound file, this property indicates the duration of the whichCastMember sound.
Page 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 parameter to play to completion. This property is always greater than or equal to 0. whichMotion Example This statement shows the length in milliseconds of the motion Kick.
Page 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 ( ) or not ( TRUE FALSE When the cast member property is set, the setting is applied to all sprites that contain the field.
Page 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 , these text operations function. When set to TRUE , these operations are not allowed. FALSE This property can be tested and set.
Page 209
The default value for this property is rgb(0, 0, 0) Example This statement sets the property of the shader named Globe to emissive 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 silhouettes emitter...
Page 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 emulateMultiButtonMouse Description System property;...
Page 211
Example This handler enables or disables all the items in the specified menu. The argument theMenu specifies the menu; the argument specifies . For example, the calling Setting TRUE FALSE statement " " disables all the items in the Special menu. ableMenu ( Special , FALSE)
Page 212
enabled (sds) Syntax member(whichCastmember).model(whichModel).sds.enabled Description modifier property; indicates whether the modifier attached to a model is used by the model. The default setting for this property is TRUE An attempt to add the modifier to a model that already has the modifier inker toon...
Page 213
Example This handler uses the keyword to end the statement: end case case 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...
Page 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. is only valid when the is set to , and the starting color is set endColor fillMode #gradient...
Page 215
Example When used in the following handler, the keyword ends the Score endRecording 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(20).locV = vertical horizontal = horizontal + 3...
Page 216
endTellTarget() 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-point value, allowing for measurement and control of sound playback to fractions of milliseconds.
Page 217
Description System property; this property contains a list with information about the environment under which the Director content is currently running. This design enables Macromedia to add information to the property in the future, environment without affecting existing movies.
Page 218
The information is in the form of property and value pairs for that area. #shockMachine Integer TRUE or FALSE value indicating whether the movie is playing in ShockMachine. #shockMachineVersion String indicating the installed version number of ShockMachine. #platform String containing “Macintosh,PowerPC”, or “Windows,32”. This is based on the current OS and hardware that the movie is running under.
Page 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 modifier property; indicates the percentage of error tolerated by the modifier when #sds synthesizing geometric detail in models.
Page 220
Include only those behaviors in that you want users to control; for security on EvalScript 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.
Page 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 ; if the buttons are disabled, the script eventPassMode #passNotButton sets .
Page 222
Place handlers in behavior, frame, or movie scripts, as follows: on exitFrame • 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. •...
Page 223
Assuming that is set to , nothing occurs automatically when the Control+period/ exitLock TRUE 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 = "."...
Page 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 must be in a scripting language externalEvent supported by the browser.
Page 225
externalParamCount() Syntax externalParamCount() Description Function; returns the number of parameters that an HTML <EMBED> or <OBJECT> 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 projectors.
Page 226
externalParamValue() Syntax externalParamValue(n) Description Function; returns a specific value from the external parameter list in an HTML <EMBED> or <OBJECT> 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 or projectors. •...
Page 227
extrude3D Syntax member(whichTextCastmember).extrude3D(member(which3dCastmember)) Description 3D command; creates a new model resource in the 3D cast member #extruder from the text in which3DCastmember whichTextCastmember Note that this is not the same as using the 3D property of a text cast member. displayMode To create a model using extrude3D: Create a new...
Page 228
Description model resource and modifier property. All model resources are meshes #mesh meshdeform composed of triangles. Each triangle is a face. You can access the properties of the faces of model resources whose type is . Changes to any #mesh of these properties do not take effect until you call the command.
Page 229
fadeIn() Syntax sound(channelNum).fadeIn({milliseconds}) fadeIn(sound(channelNum) {, milliseconds }) Description This function immediately sets the of sound channel to zero and then brings volume channelNum it back to the current volume over the given number of milliseconds. The default is 1000 milliseconds (1 second) value is given. The current pan setting is retained for the entire fade.
Page 230
To see an example of used in a completed movie, see the Sound Control movie in the fadeTo() 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.
Page 231
field Syntax field whichField Description Keyword; refers to the field cast member specified by whichField • When is a string, it is used as the cast member name. whichField • When is an integer, it is used as the cast member number. whichField Character strings and chunk expressions can be read from or placed in the field.
Page 232
The value of this property is meaningful only when the value of the camera’s projection property is set to . When the property is set to , use #perspective projection #orthographic the camera’s property to define the top and bottom of the projection plane. orthoHeight The default setting for this property is 30.0.
Page 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 . This property is useful for switching the external linked file assigned to a whichCastMember cast member while a movie plays, similar to the way you can switch cast members.
Page 234
property accepts URLs as a reference. However, to use a movie file fileName of window from a URL and minimize the download time, use the downloadNetThing preloadNetThing command to download the movie file to a local disk first and then set window property fileName to the file on the local disk.
Page 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...
Page 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 property of the shape is set to fillMode #gradient This property can be tested and set. To see an example of used in a completed movie, see the Vector Shapes movie in fillDirection...
Page 237
Example This statement sets the of member Archie to gradient: fillMode 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 (within space) to offset the fill of the shape. defaultRect This property is only valid when the property of the shape is set to...
Page 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 100: put findEmpty(member 100) findLabel() Syntax...
Page 239
findPosNear Syntax sortedList.findPosNear(valueOrProperty) findPosNear(sortedList, valueOrProperty) Description List command; for sorted lists only, identifies the position of the item specified by in the specified sorted list. valueOrProperty command works only with sorted lists. Replace with a findPosNear valueOrProperty value for sorted linear lists, and with a property for sorted property lists. command is similar to the command, except that when the specified findPosNear...
Page 240
firstIndent Syntax chunkExpression.firstIndent Description Text cast member property; contains the number of pixels the first indent in chunkExpression offset from the left margin of the chunkExpression The value is an integer: less than 0 indicates a hanging indent, 0 is no indention, and greater than 0 is a normal indention.
Page 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 adjustType of #faster:...
Page 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 See also defaultRect defaultRectMode state (Flash, SWA)
Page 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.
Page 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 property. floatPrecision Examples This statement converts the integer 1 to the floating-point number 1: put (1).float -- 1.0 Math operations can be performed using...
Page 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 must be an integer. The maximum value is 15 floatPrecision significant digits; the default value is 4. property determines only the number of digits used to display floatPrecision floating-point numbers;...
Page 246
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).camera{(index)}.fog.enabled member(whichCastmember).camera(whichCamera).fog.far sprite(whichSprite).camera{(index)}.fog.far member(whichCastmember).camera(whichCamera).fog.near sprite(whichSprite).camera{(index)}.fog.near Description 3D camera property; fog introduces a coloring and blurring of models that increases with distance from the camera. The effect is similar to real fog, except that it can be any color. The “See also”...
Page 247
To see an example of used in a completed movie, see the Text movie in the Learning/Lingo font Examples folder inside the Director application folder. Example This statement sets the variable named to the current setting for the field cast oldFont font member Rokujo Speaks:...
Page 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 styles delimited by commas. Lingo uses a font that is a combination of the styles in the string.
Page 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 property be used instead of the property. color foreColor Examples The hexadecimal value for pure red, FF0000, is equivalent to 16711680 in decimal numbers. This statement specifies pure red as a cast member’s forecolor: member(20).foreColor = 16711680 This statement changes the color of the field in cast member 1 to the color in palette entry 250:...
Page 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 command is given, the window and the movie in a window (MIAW) forget window disappear without calling the , or...
Page 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 playhead continues to the next frame.
Page 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 player for Java always uses the browser’s palette.
Page 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("Rotating Chair").frameRate = -2 The following sprite script checks to see if the sprite’s cast member was originally created in Flash with a frame rate of less than 15 frames per second.
Page 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 streaming...
Page 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 recording session, this statement assigns the sound cast member Jazz to the first sound channel:...
Page 256
The resulting string uses the form , where: sHH:MM:SS.FFD A character is used if the time is less than zero, or a space if the time is greater than or equal to zero. Hours. Minutes. Seconds. Indicates a fraction of a second if fractionalSeconds is TRUE or frames if fractionalSeconds is FALSE.
Page 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 contiguous block of memory, in bytes. A kilobyte (K) is 1024 bytes.
Page 258
front Syntax member(whichCastmember).modelResource(whichModelResource).front Description model resource property; indicates whether the side of the box intersected by its -Z axis #box is sealed ( ) or open ( TRUE FALSE The default value for this property is TRUE Example This statement sets the property of the model resource named Crate to , meaning front...
Page 259
If the parameter is set to , each vertex receives a normal for each face to which it style #flat belongs. Furthermore, all three of the vertices of a face will have the same normal. For example, if the vertices of all receive and the vertices of all receive...
Page 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 achieved using bracket access on the same list: put ages[#joe] The result is again 12.
Page 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 format of the list is [[“Dennis”, “consulting”, 510], [“Sherry”, “Distribution”, 973]], and the list is called employeeInfoList.
Page 262
on getBehaviorTooltip Syntax on getBehaviorTooltip statement(s) Description System message and event handler; contains Lingo that returns the string that appears in a tooltip for a script in the Library palette. Director sends the message to the script when the cursor stops over it in getBehaviorTooltip the Library palette.
Page 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 integer values and getError() corresponding messages: getErrorString() getError() value getErrorString() message...
Page 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 command to try to free some memory; it then branches the playhead unloadCast to a frame in the Director movie named Artists, where the Flash movie sprite first appears, so Director can again try to load and play the Flash movie.
Page 265
Possible integer values and corresponding messages are: getError() getErrorString() getError() value getErrorString() message memory network playback device other Example This handler uses to determine whether an error occurred for Shockwave Audio cast getError() member Norma Desmond Speaks, and if so, uses to obtain the error message getErrorString and assign it to a field cast member:...
Page 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 that portion of the Flash movie has not yet been streamed in, this function returns an empty string.
Page 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], #supportedTextureRenderFormats: \ [#rgba8888, #rgba8880, #rgba5650, #rgba5551, #rgba5550, \ #rgba4444], #textureUnits: 2, #depthBufferRange: [16, 24], \ #colorBufferRange: [16, 32]] See also...
Page 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 network ID of a operation to the field cast member Result so getNetText...
Page 269
The function works with relative URLs. To see an example of used in a completed movie, see the Forms and Post movie in getNetText() the Learning/Lingo Examples folder inside the Director application folder. Examples This script retrieves text from the URL http://BigServer.com/sample.txt and updates the field cast member the mouse pointer is on when the mouse button is clicked: property spriteNum property theNetID...
Page 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 function, Director movies must getNthFileNameInFolder be set to visible in the folder structure. (On the Macintosh, other types of files are found whether they are visible or invisible.) If this function returns an empty string, you have specified a number greater than the number of files in the folder.
Page 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 list Answers, which consists of [#a:10, #b:12, #c:15, #d:22]: put Answers.getOne(12) The result is #b, which is the property associated with the value 12.
Page 272
getPlaylist() Syntax sound(channelNum).getPlaylist() getPlaylist(sound(channelNum)) Description This function returns a copy of the list of queued sounds for . This list does not soundObject include the currently playing sound. The list of queued sounds may not be edited directly. You must use setPlayList() The playlist is a linear list of property lists.
Page 273
getPos() Syntax list.getPos(value) getPos(list, value) Description List function; identifies the position of the value specified by in the list specified by value list When the specified value is not in the list, the command returns the value 0. getPos For values contained in the list more than once, only the first occurrence is displayed. This command performs the same function as the command when used for linear lists.
Page 274
getProp() Syntax getProp(list, property) list.property Description Property list function; identifies the value associated with the property specified by property the property list specified by list Almost identical to the command, the command displays an error message if getaProp getProp the specified property is not in the list or if you specify a linear list. Example This statement identifies the value associated with the property in the property list Answers,...
Page 275
message is sent when any action that causes the on getPropertyDescriptionList 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. , and settings are mandatory for each parameter. The #default #format #comment...
Page 276
This statement displays in the message window the current status of a download begun with and the resulting net ID placed in the variable getNetText() netID put getStreamStatus(netID) -- [#URL: "www.macromedia.com", #state: "InProgress", #bytesSoFar: 250, #bytesTotal: 50000, #error: EMPTY] See also on streamStatus tellStreamStatus()
Page 277
= sprite(3).getVariable("gVar",FALSE) This statement returns the value of the variable from the Flash cast member in sprite currentURL 3 and displays it in the Message window: put getVariable(sprite 3, "currentURL") -- "http://www.macromedia.com/software/flash/" See also setVariable() getWorldTransform() Syntax member(whichCastmember).node(whichNode).getWorldTransform() member(whichCastmember).node(whichNode).getWorldTransform().\ position member(whichCastmember).node(whichNode).getWorldTransform().\...
Page 278
property of a node is calculated relative to the transform of the node’s parent, and transform is therefore parent-relative. The command calculates the node’s transform getWorldTransform() relative to the origin of the 3D world, and is therefore world-relative. member(whichCastmember).node(whichNode).getWorldTransform(). to find the position property of the node’s world-relative transform. You can also use position as a shortcut for worldPosition...
Page 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 go movie Example...
Page 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 is set to textureModeList[4] #none • The value of is set to blendFunctionList[4] #multiply Example...
Page 281
The phrase tells the playhead to loop to the previous marker and is a convenient means go loop of keeping the playhead in the same section of the movie while Lingo remains active and avoids the use of in a frame that has a transition which would slow the movie and go to the frame overwhelm the processor.
Page 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. •...
Page 283
Example This statement sends the playhead to the previous marker in the movie: go previous See also go next go loop goToFrame Syntax sprite(whichFlashSprite).goToFrame(frameNumber) goToFrame(sprite whichFlashSprite, frameNumber) sprite(whichFlashSprite).goToFrame(labelNameString) goToFrame(sprite whichFlashSprite, labelNameString) Description Command; plays a Flash movie sprite beginning at the frame identified by the frameNumber parameter.
Page 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, is used as a function. The function returns the gotoNetMovie network ID for the operation. myNetID = gotoNetMovie ("http://www.yourserver.com/movies/ buttons.dcr#Contents") gotoNetPage...
Page 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 . The is only valid when the #linear #radial gradientType fillMode set to #gradient This property can be tested and set. Example This handler toggles between linear and radial gradients in cast member "backdrop": on mouseUp me...
Page 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 handlers that called it and then stops the movie: if the freeBytes <...
Page 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 whichCastMember imageObject.height sprite(whichSprite).height the height of sprite whichSprite Description Cast member, image object and sprite property;...
Page 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 World").modelResource("Tower").height = 225.0 This statement shows that the height of the texture named Marsmap is 512 pixels.
Page 289
Example The following statement sets the property of the modifier for the highlightPercentage toon model named Sphere to 50. Half of the colors available to the modifier for this model will toon be used for the highlight area of the model’s surface. member("shapes").model("Sphere").toon.highlightPercentage = 50 See also highlightStrength...
Page 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 ( ) or not ( default). TRUE FALSE, is a string, it specifies the cast member name. If it is an integer, whichCastMember specifies the cast member number.
Page 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 = "Click here to play the movie."...
Page 292
• String expression that specifies the time in the form , where: hms— sHH:MM:SS.FFD A character is used if the time is less than zero, or a space if the time is greater than or equal to zero. Hours. Minutes. Seconds.
Page 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 See also movieRate pause (movie playback) hotSpot Syntax...
Page 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 VR sprite receives the message first.
Page 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" See also hyperlinkRange hyperlinkState on hyperlinkClicked Syntax on hyperlinkClicked me, data, range...
Page 296
This property can be tested but not set. Like , the returned range of the link contains the first character hyperLink hyperLinkState chunkExpression See also hyperlink hyperlinkState hyperlinks Syntax chunkExpression.hyperlinks Description Text cast member property; returns a linear list containing all the hyperlink ranges for the specified chunk of a text cast member.
Page 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(whichLight).transform.identity() transformReference.identity() Description 3D command; sets the transform to the identity transform, which is transform(1.0000,0.0000,0.0000,0.0000, 0.0000,1.0000,0.0000,0.0000, 0.0000,0.0000,1.0000,0.0000, 0.0000,0.0000,0.0000,1.0000) property of the identity transform is position vector(0, 0, 0) property of the identity transform is rotation vector(0, 0, 0) property of the identity transform is...
Page 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 number of ticks that passes until the movie sends an message.
Page 299
idleLoadDone() Syntax idleLoadDone(loadTag) Description Function; reports whether all cast members with the given tag have been loaded ( ) or are still TRUE waiting to be loaded ( FALSE Example This statement checks whether all cast members whose load tag is 20 have been loaded and then plays the movie Kiosk if they are: if idleLoadDone(20) then play movie("on idle") See also...
Page 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 is 0, which instructs idleLoadPeriod Director to service the load queue as frequently as possible. Example This statement instructs Director to try loading every 1/2 second (30 ticks) any cast members waiting to be loaded:...
Page 301
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(s) else if logicalExpression3 then statement(s) end if if logicalExpression1 then...
Page 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 construction evaluates both conditions, and so must determine the time measurement, which may take a while.
Page 303
These Lingo statements set and then parse the given XML into a ignoreWhiteSpace() FALSE list. Note that the element now has a child containing one space character. <sample> XMLtext = "<sample> </sample>" parserObj.ignorewhitespace(FALSE) parserObj.parseString(XMLtext) theList = parserObj.makelist() put theList -- ["ROOT OF XML DOCUMENT": ["!ATTRIBUTES": [:], "sample": ["!ATTRIBUTES": [:], "!CHARDATA": "...
Page 304
Type of Object ilk(Object) ilk(Object, Type) Example returns returns 1 only if Type = string #string #string ilk ("asdf") rect #rect #rect or #list ilk (sprite(1).rect) point #point #point or #list ilk (sprite(1).loc) color #color #color ilk (sprite(1).color) date #date #date ilk (the systemdate) symbol...
Page 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)
Page 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...
Page 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 , with optional values. bitDepth alphaDepth paletteObject can be 1, 2, 4, 8, 16, or 32. The , if given, is used only for 32-bit bitDepth alphaDepth...
Page 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 frame is deleted.
Page 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 movie or vector shape’s graphics are visible ( , default) or invisible ( TRUE FALSE This property can be tested and set.
Page 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.
Page 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 command to download the preloadNetThing file to a local disk first and then import the file from the local disk.)
Page 312
inflate Syntax rectangle.Inflate(widthChange, heightChange) inflate (rectangle, widthChange, heightChange) Description Command; changes the dimensions of the rectangle specified by relative to the center rectangle of the rectangle, either horizontally or vertically (widthChange) (heightChange) The total change in each direction is twice the number you specify. For example, replacing with 15 increases the rectangle’s width by 30 pixels.
Page 313
For a movie that plays back as an applet, valid values for the sprite property vary for different sprites, as follows: • For bitmap sprites, the sprite property can be 0 (Copy), 8 (Matte), 32 (Blend), or 36 (Background transparent). •...
Page 314
modifier has the following properties: #inker • allows you to get or set the color of lines drawn by the inker. lineColor • allows you to get or set whether lines are drawn to define the edges along the silhouettes border of a model, outlining its shape.
Page 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 command.
Page 316
inside() Syntax point.inside(rectangle) inside(point, rectangle) Description Function; indicates whether the point specified by is within the rectangle specified by point ), or outside the rectangle ( rectangle TRUE FALSE Example This statement indicates whether the point Center is within the rectangle Zone and displays the result in the Message window: put Center.inside(Zone) See also...
Page 317
integer() Syntax (numericExpression).integer integer(numericExpression) Description Function; rounds the value of to the nearest whole integer. numericExpression You can force an integer to be a string by using the function. string() Examples This statement rounds off the number 3.75 to the nearest whole integer: put integer(3.75) -- 4 The following statement rounds off the value in parentheses.
Page 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 function. mMessageList Example This statement displays the output from the function used in the QuickTime Asset Xtra in the Message window: put Xtra("QuickTimeSupport").interface() interpolate()
Page 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 world").model("Sphere").transform tBox.interpolateTo(tSphere, 50)
Page 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(whichSprite).camera{(index)}.transform.inverse() member(whichCastmember).light(whichLight).transform.inverse() transformReference.inverse() Description method; returns a copy of the transform with its position and rotation transform properties inverted. This method does not change the original transform. To invert the original transform, use the function.
Page 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 ( ) or in the black pixels ( , default). TRUE FALSE This property can be tested and set. Example This handler reverses the current setting of the property of a QuickTime movie...
Page 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 if the parent hierarchy of the model, camera, light, or TRUE group terminates in the world. If the value of , the model, camera, light, or isInWorld TRUE group functions in the 3D world of the cast member.
Page 323
Example This statement checks the sprite type the behavior is being attached to and returns for any TRUE graphic sprite except a shape and for the script channel: FALSE on isOKToAttach me, aSpriteType, aSpriteNum case aSpriteType of #graphic: -- any graphic sprite type return sprite(aSpriteNum).member.type <>...
Page 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).isPastCuePoint("climax") then member("field 2").text = "This is the beginning of the piece."...
Page 325
The terms , and must be integers or integer expressions that whichItem firstItem lastItem 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 that hold strings.
Page 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 to determine the last item in the chunk that makes the last item of up a Macintosh pathname.
Page 327
You can use in handlers that perform certain actions when the user presses specific keys the key 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 a key while Lingo is in a repeat loop.
Page 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 function and arrow keys. You can use the function to detect when the user has pressed an arrow or function key, keyCode...
Page 329
on keyDown Syntax on keyDown statement(s) 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 handler: on keyDown primary event handler, editable field sprite script, field cast member script, frame script, and movie script.
Page 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 property is defined, Lingo executes the keyDownScript...
Page 331
Adding the modifier to a model by using the command allows keyframePlayer addModifier access to the following modifier properties: keyframePlayer • indicates whether a model is executing a motion. playing • is a linear list of property lists containing the playback parameters of the motions playList that are queued for a model.
Page 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, is an empty string.
Page 333
When a key is released, Lingo searches these locations, in order, for an handler: primary on keyUp event handler, editable field sprite script, field cast member script, frame script, and movie script. For sprites and cast members, handlers work only for editable strings. A event on on keyUp keyUp...
Page 334
When the instructions you’ve specified for the property are no longer appropriate, keyUpScript turn them off by using the statement set the keyUpScript to empty Examples The following statement sets keyUpScript if the key = RETURN then go the frame + 1 When this statement is in effect, the movie always goes to the next frame whenever the user presses the Return key.
Page 335
Supported containers are field cast members, variables that hold strings, and specified characters, words, items, lines, and ranges within containers. Examples This statement identifies the last word of the string “Macromedia, the multimedia company” and displays the result in the Message window: put the last word of "Macromedia, the multimedia company"...
Page 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 but not set.
Page 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...
Page 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 the Stage. When a movie plays back as an applet, this property’s value is relative to the left edge of the applet.
Page 339
leftIndent Syntax chunkExpression.leftIndent Description Text cast member property; contains the number of pixels the left margin of chunkExpression 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. Example This line indents the first line of text cast member “theStory”...
Page 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 .
Page 341
Example The following statement sets the property of the modifier of the model Spaceship to level 50. If the modifier’s property is set to , Spaceship will be drawn at a medium level auto FALSE of detail. If the modifier’s property is set to , this code will have no effect.
Page 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 sequence of characters delimited by carriage returns, not by line breaks caused by text wrapping. The expressions , and must be integers that specify a line...
Page 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. Example This statement determines how many lines the field cast member Today’s News has when it appears on the Stage and assigns the value to the variable...
Page 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 can be either a cast member name or number. whichCastMember Setting the member property temporarily overrides the system’s setting until the lineHeight movie closes.
Page 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 variable startOfString startOfString = member("Today’s News").linePosToLocV(2) lineSize...
Page 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; controls whether a script, Flash movie, or animated GIF file is stored in an external file ( default), or inside the Director cast ( ).
Page 347
listP() Syntax listP(item) Description Function; indicates whether the item specified by is a list, rectangle, or point (1 ) or item or TRUE not (0 or FALSE Example This statement checks whether the list in the variable is a list, rectangle, or point, and designers displays the result in the Message window: put listP(designers)
Page 348
Description 3D cast member command; imports the assets of the W3D file, , into the cast member. fileName The optional parameter indicates whether the assets of the W3D file replace the assets overwrite of the cast member ( ) or are added to the assets of the cast member ( ).
Page 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 and overlay property; indicates the 2D location of the backdrop or overlay, as measured from the upper left corner of the sprite. This property is initially set as a parameter of the addBackdrop addOverlay insertBackdrop...
Page 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 . The value for is a point location location relative to the upper left corner of the field cast member. The value 1 corresponds to the first character in the string, the value 2 corresponds to the second character in the string, and so on.
Page 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 value last beyond the current sprite, make the sprite a puppet.
Page 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 value, the channel number then takes precedence for deciding the final display order locZ of those two sprites.
Page 353
modifier has the following properties: • allows the modifier to set the level of detail reduction as the distance between the model auto and the camera changes. The value of the modifier’s property is updated, but setting the level property will have no effect when the property is set to level auto...
Page 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(whichCastmember).modelResource(whichModelResource).\ emitter.loop...
Page 355
Description Cast member property; determines whether the specified digital video, sound, or Flash movie cast member is set to loop ( ) or not ( TRUE FALSE Example This statement sets the QuickTime movie cast member Demo to loop: member("Demo").loop = 1 loop (Flash property) Syntax sprite(whichFlashSprite).loop...
Page 356
property has no effect if the movie’s property is set to . If the loopBounds loop FALSE loop property is set to while the movie is playing, the movie continues to play. Director uses these TRUE rules to decide how to loop the movie: •...
Page 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." See also breakLoop() setPlaylist()
Page 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 . If the sound had no loop specified when it was queued, this property is 0. If channelNum this property is tested immediately after a sound starts playing, it returns one less than the number of loops defined with the...
Page 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 magnitude of MyVec1 is 100.0000 and the magnitude of MyVec2 is 141.4214.
Page 360
makeSubList() Syntax XMLnode.makeSubList() Description Function; returns a property list from a child node the same way that returns the makeList() root of an XML document in list format. Example Beginning with the following XML: <?xml version="1.0"?> <e1> <tagName attr1="val1" attr2="val2"/> <e2>element 2</e2>...
Page 361
map (3D) Syntax member(whichCastmember).motion(whichMotion).\ map(whichOtherMotion {, boneName}) Description 3D motion command; maps the motion specified by into the current motion whichOtherMotion ), and applies it to the bone specified by and all of the children of that whichMotion boneName bone. This command replaces any motion previously mapped to the specified bone and its children.
Page 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 accounts for any current transformations to the sprite using , or the rectangle if not transformed. quad This is useful for determining if a particular area on a cast member has been clicked even if there have been major transformations to the sprite on the Stage.
Page 363
If the argument for is a string, returns the frame number of the first frame whose marker marker 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;...
Page 364
For best results, set a QuickTime cast member’s mask property before any of its sprites appear on the Stage in the event handler. Setting or changing the property while the on beginSprite mask cast member is on the Stage can have unpredictable results (for example, the mask may appear as a freeze frame of the digital video at the moment the property took effect).
Page 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 &&...
Page 366
Syntax 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 is used by convention.
Page 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 member property can use large amounts of memory, this property is best used during media authoring only. You can use the member property to copy the content of one cast member into another media...
Page 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).mediaStatus member(whichCastmember).mediaStatus Description...
Page 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 is , this property indicates the cast #fromCastMember member that is used as the source for a texture. This property can be tested and set. If the texture’s type is , this property value is void and cannot be set.
Page 370
Examples The following statement sets the property of the button cast member named Enter Bid hilite 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 type of member Jefferson Portrait in the castLib Presidents: memberType = member("Jefferson Portrait", "Presidents").type This statement determines whether cast member 9 has a name assigned:...
Page 371
sprite property differs from the sprite property, which specifies only the member memberNum sprite’s number to identify its location in the cast but doesn’t specify the cast itself. The member sprite property also differs from and the obsolete sprite properties, neither mouseMember castNum of which specifies the sprite’s cast.
Page 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 . Its value is the cast member number only; the whichSprite cast member’s cast is not specified. property is useful for switching cast members assigned to a sprite so long as the memberNum cast members are within the same cast.
Page 373
members 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 value is the total physical memory available;...
Page 374
On the Macintosh, you can use special characters to define custom menus. These special characters are case sensitive. For example, to make a menu item bold, the letter B must be uppercase. Special symbols should follow the item name and precede the vertical bar symbol (|). You can also use more than one special character to define a menu item.
Page 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 modifier meshDeform attached. When used as this command returns the total number of meshes within mesh.count the referenced model. The properties of each mesh that are accessible are as follows: •...
Page 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 modifier (using the command) to a model #meshDeform addModifier you have access to the following properties of the modifier: #meshDeform Note: For more detailed information about the following properties see the individual property entries referenced in...
Page 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 See also ticks time() timer Syntax list.min min(list)
Page 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 particular font is available or not. This property can be tested but not set.
Page 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 = 1 + (gCounter mod theBitmaps.count) sprite(theChannel).memberNum = theBitmaps[gCounter]...
Page 380
This property can have the value (default). A value of causes all #burst #stream mode #burst particles to be emitted at the same time, while a value of causes a group of particles to be #stream emitted at each frame. The number of particles emitted in each frame is determined using the following equation: particlesPerFrame = resourceObject.emitter.numParticles \ (resourceObject.lifetime x millisecondsPerRenderedFrame)
Page 381
Description 3D command; returns the model found within the referenced cast member that has the name specified by , or is found at the index position specified by . If no model exists whichModel index for the specified parameter, the command returns .
Page 382
Example This example has three parts. The first part is the first line of code, which registers the handler for the event. The second part is the handler. #putDetails #collideAny #putDetails When two models in the cast member named MyScene collide, the handler is #putDetails called and the...
Page 383
modelResource Syntax member(whichCastmember).modelResource(whichModelResource) member(whichCastmember).modelResource[index] member(whichCastmember).modelResource.count member(whichCastmember).modelResource(whichModelResource).\ propertyName member(whichCastmember).modelResource[index].propertyName Description 3D command; returns the model resource found within the referenced cast member that has the name specified by , or is found at the index position specified by the whichModelResource parameter. If no model resource exists for the specified parameter, the command returns index .
Page 384
returns a list of property lists, each representing an intersected model. Each property #detailed list will have the following properties: • is a reference to the intersected model object. #model • is the distance from the camera to the point of intersection with the model. #distance •...
Page 385
The optional parameter allows you to specify the level of detail of the levelOfDetail information returned. The parameter can have the following values: levelOfDetail returns a list containing references to the models found under the point. This is the #simple default setting.
Page 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 within the rect of a sprite using the referenced camera. The location pointWithinSprite is relative to the upper left corner of the sprite, in pixels. pointWithinSprite This command returns if there is no model found under the specified point.
Page 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 Preferences dialog box. This property can be tested but not set.
Page 388
Note that if both the modifiers are applied to a model, only the first one that was toon inker added to the model is returned. This property can be tested but not set. Use the commands addModifier removeModifier to add and remove modifiers from models. Example This statement shows which modifiers are attached to the model named Juggler: put member("ParkScene").model("Juggler").modifier...
Page 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 video, and Xtra extensions that support cue points, indicates the number that identifies the most recent cue point passed in the sprite or sound.
Page 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 VR sprite property; the codec quality used when the user clicks and drags the QuickTime VR sprite.
Page 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 < 1 then exit -- if over a border, final line, etc. hilite char MC of field sprite(spriteNum).member else alert "Sorry, ’hilite’...
Page 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" This handler, assigned to a sprite script, plays a sound when the sprite is clicked: on mouseDown puppetSound "Crickets"...
Page 393
When the mouse button is pressed and the property is defined, Lingo executes mouseDownScript the instructions specified for the property first. No other mouseDownScript on mouseDown handlers are executed, unless the instructions include the command so that the pass mouseDown message can be passed to other objects in the movie.
Page 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(spritenum).member = currentMember + 1 on mouseLeave me...
Page 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 property.) Counting starts at the beginning of the the itemDelimiter field.
Page 396
on mouseLeave Syntax on mouseLeave statement(s) Description System message and event handler; contains statements that run when the mouse leaves the active area of the sprite. The mouse button does not have to be pressed. If the sprite is a bitmap cast member with the matte ink applied, the active area is the portion of the image that is displayed;...
Page 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 ; otherwise, it sets mouseLevel #all mouseLevel #none on prepareFrame...
Page 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 System property;...
Page 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 parameter ( ), or whether the mouse pointer is outside whichFlashSprite TRUE the bounds of the sprite or the mouse pointer is within the bounds of the sprite but over a...
Page 400
Where you place an handler can affect when it runs, as follows: on mouseUp • 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. •...
Page 401
on mouseUpOutside Syntax on mouseUpOutside me statement(s) 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 and then releases it outside the bounding rectangle of the sprite: on mouseUpOutside me puppetSound "Professor Long Hair"...
Page 402
This statement sets to the custom handler . A Lingo custom mouseUpScript myCustomHandler handler must be enclosed in quotation marks when used with the property. mouseUpScript the mouseUpScript = "myCustomHandler" See also stopEvent mouseDownScript on mouseDown (event handler) on mouseUp (event handler) mouseV Syntax the mouseV...
Page 403
If used in a behavior, this event is passed the sprite script or frame script reference 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 mouseLeave mouseWord...
Page 404
moveableSprite Syntax sprite(whichSprite).moveableSprite the moveableSprite of sprite whichSprite Description Sprite property; indicates whether a sprite can be moved by the user ( ) or not ( TRUE FALSE You can make a sprite moveable by using the Moveable option in the Score. However, to control whether a sprite is moveable and to turn this condition on and off as needed, use Lingo.
Page 405
moveToBack Syntax window("whichWindow ").MoveToBack() moveToBack window whichWindow Description Command; moves the window specified by behind all other windows. whichWindow Examples These statements move the first window in behind all other windows: windowList myWindow = the windowList[1] moveToBack myWindow If you know the name of the window you want to move, use the syntax: window("Demo Window").moveToBack() moveToFront Syntax...
Page 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 the vertex handle. The location of the vertex handle is relative to the vertex point it controls. Changing the location of a control handle affects the shape in the same way as dragging the vertex in the editor.
Page 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 movieCopyrightInfo Syntax...
Page 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 in the current movie: put the movieFileSize movieFileVersion Syntax...
Page 409
movieImageQuality Syntax the movieImageQuality Description Movie property; indicates the level of compression to use when the movieImageCompression property is set to . The range of acceptable values is 0–100. Zero yields the lowest image #jpeg quality and highest compression; 100 yields the highest image quality and lowest compression. You can only set this property during authoring and it has no affect until the movie is saved in Shockwave format.
Page 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).movieRate the movieRate of sprite whichSprite Description Digital video sprite property;...
Page 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...
Page 412
multiply() Syntax transform.multiply(transform2) Description 3D command; applies the positional, rotational, and scaling effects of after the transform2 original transform. Example This statement applies the positional, rotational, and scaling effects of the model Mars’s transform to the transform of the model Pluto. This has a similar effect as making Mars be Pluto’s parent for a frame.
Page 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 window: totalCastLibs = the number of castLibs repeat with currentCastLib = 1 to totalCastLibs...
Page 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 command to set up a custom installMenu menu bar.
Page 415
name (window property) Syntax window (whichWindow).name the name of window whichWindow Description Window property; determines the name of the specified window in . (The windowList title window property determines the title that appears in a window’s title bar.) This property can be tested and set. Example This statement changes the name of the window Yesterday to Today: window("Yesterday").name = "Today"...
Page 416
name (XML property) Syntax XMLnode.name Description XML property; returns the name of the specified XML node. Example Beginning with this XML: <?xml version="1.0"?> <e1> <tagName attr1="val1" attr2="val2"/> <e2>element 2</e2> <e3>element 3</e3> </e1> This Lingo returns the name of the second tag that is nested within the tag <e1>...
Page 417
Example The following statement sets the property of the fog of the camera Defaultview to 100. If near the fog’s enabled property is set to and its property is set to , fog will TRUE decayMode #linear first appear 100 world units in front of the camera. member("3d world").camera("defaultview").fog.near = 100.0 See also far (fog)
Page 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() postNetText() In some cases, when a network ID is not available, you can use a URL to stop the transmission of...
Page 419
This handler uses a specific network ID as an argument for to check the status of a netDone 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 See also...
Page 420
4165 Requested object could not be found (URL may be incorrect). 4166 Generic proxy failure. 4167 Transfer was intentionally interrupted by client. 4242 Download stopped by netAbort(url). 4836 Download stopped for an unknown reason, possibly a network error, or the download was abandoned.
Page 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). function can be called only after report that the operation netMIME netDone netError is complete and successful.
Page 422
netStatus Syntax netStatus msgString Description Command; displays the specified string in the status area of the browser window. command doesn’t work in projectors. netStatus Example This statement would place the string “This is a test” in the status area of the browser the movie is running in: on exitFrame netStatus "This is a test"...
Page 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 less time is spent servicing any network activity.
Page 424
When is used to create a timeout object, the timeoutPeriod sets the number of milliseconds new() between timeout events sent by the timeout object. The is a symbol that #timeoutHandler identifies the handler that will be called when each timeout event occurs. The targetObject identifies the name of the child object that contains the .
Page 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 . The second statement makes the myBird bird fly by calling the fly handler in the Bird parent script: myBird = script("Bird").new() myBird.fly() This statement uses a new Bird parent script, which contains the property variable...
Page 426
newCurve() Syntax vectorMember.newCurve(positionInVertexList) newCurve(vectorMember, positionInVertexList) Description Function; adds a symbol to the , which adds a #newCurve vertexList vectorCastMember new shape to the vector shape. The symbol is added at #newCurve positionInVertexList You can break apart an existing shape by calling with a position in the middle of a newCurve() series of vertices.
Page 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 face[index].vertices properties of the new mesh, followed by a call to its command, in order to actually build() generate the geometry.
Page 429
newModelResource Syntax member(whichCastmember).newModelResource(newModelResourceName \ { ,#type, #facing }) Description 3D command; creates a new model resource, of the given (if specified), and #type #facing adds it to the model resource palette. parameter can be one of the following primitives: #type #plane #box #sphere...
Page 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 command.
Page 431
newShader Syntax member(whichCastmember).newShader(newShaderName, #shaderType) Description 3D command; creates a new shader of the specified within the referenced cast #shaderType member’s shader list and returns a reference to the new shader. All shaders in the shader list must have a unique name. The argument determines the style in which the shader is #shaderType applied and the has the following possible values:...
Page 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 must have a unique name. The parameters are optional, and if not #typeIndicator sourceObjectReference...
Page 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 keyword. exit repeat Example This repeat loop displays only odd numbers in the Message window: repeat with i = 1 to 10 if (i mod 2) = 0 then next repeat put i...
Page 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 three arguments: parameter, the ID of the node that the movie is about to leave, and the ID of the node that the movie is about to switch to.
Page 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(whichCastmember).modelResource(whichModelResource).\ normalList model.meshDeform.mesh[index].normalList Description 3D property; when used with a model resource whose type is , this property allows you to #mesh get or set the...
Page 436
This property must be set to the same length as the list, or it can be an face[index].verticies empty list [ ]. Do not set any value for this property if you are going to generate normal vectors using the command.
Page 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 statement that contains no explicit if...then...else command for the clause may require , so that Lingo does not interpret the else else nothing clause as part of the preceding...
Page 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 cast members that are in each of the movie’s casts: repeat with n = 1 to the number of castLibs put castLib(n).name &&...
Page 439
Note: The count() function provides a more efficient alternative for determining the number of characters in a chunk expression. Examples This statement displays the number of characters in the string “Macromedia, the Multimedia Company” in the Message window: put the number of chars in "Macromedia, the Multimedia Company"...
Page 440
Note: The count() function provides a more efficient alternative for determining the number of lines in a chunk expression. Examples This statement displays the number of lines in the string “Macromedia, the Multimedia Company” in the Message window: put the number of lines in "Macromedia, the Multimedia Company"...
Page 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 current movie: put the number of menus See also installMenu...
Page 442
Note: The count() function provides a more efficient alternative for determining the number of words in a chunk expression. Examples This statement displays in the Message window the number of words in the string “Macromedia, the multimedia company”: put the number of words in "Macromedia, the multimedia company"...
Page 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 command or those present in the openxlib standard Xtras folder. This property can be tested but not set.
Page 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).modelResource(whichModelResource).\ numSegments Description 3D property; when used with a model resource whose type is , allows you to get or set #cylinder property of the model resource.
Page 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 - 32 if theASCII = min(max(63, theASCII), 91) then put numToChar(theASCII) after output...
Page 446
On the Macintosh, the string comparison is not sensitive to case or diacritical marks. For example, Lingo considers a and Å to be the same character on the Macintosh. Examples This statement displays in the Message window the beginning position of the string “media” within the string “Macromedia”: put offset("media","Macromedia") The result is 6.
Page 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 within the string...
Page 448
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 function result.
Page 449
open window Syntax window(whichWindow).open() open window whichWindow Description Window command; opens the window object or movie file specified by and brings it whichWindow to the front of the Stage. If no movie is assigned to the window, the Open File dialog box appears. •...
Page 450
openXlib Syntax openXlib whichFile Description Command; opens the Xlibrary file specified by the string expression . If the file is not whichFile in the folder containing the current movie, must include the pathname. whichFile It is good practice to close any file you have opened as soon as you are finished using it. The command has no effect on an open file.
Page 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 Syntax logicalExpression1 or logicalExpression2 Description Operator;...
Page 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 &...
Page 453
Example This sprite script uses the property to set up a Flash movie sprite so it’s origin point originMode can be set to a specific point. It then sets the horizontal and vertical origin points. on beginSprite me sprite(spriteNum of me).originMode = #point sprite(spriteNum of me).originH = 100 sprite(spriteNum of me).originV = 80 See also...
Page 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 scaling and rotation occurs of a Flash movie or vector shape. property is specified as a Director point value: for example, point(100,200). originPoint Setting a Flash movie or vector shape’s origin point with the property is the same as...
Page 455
The origin point can be set with floating-point precision using the separate originH originV properties, or it can be set with integer precision using the single property. originPoint You can set the property only if the property is set to originV originMode #point...
Page 456
orthoHeight Syntax member(whichCastmember).camera(whichCamera).orthoHeight member(whichCastmember).camera[cameraindex].orthoHeight sprite(whichSprite).camera.orthoHeight Description 3D property; when is set to , the value camera.projection #orthographic gives the number of perpendicular world units that fit vertically in the camera.orthoHeight sprite. World units are the measuring units for the particular 3D world. They are internally consistent but arbitrarily chosen, and they can vary from one 3D world to another.
Page 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 whichCastMember Description Field cast member property; returns the height, in pixels, of the area of the field cast member that is visible on the Stage.
Page 458
To display different bitmaps with different palettes simultaneously, set paletteMapping 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 match for each pixel in the new palette.
Page 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 .The channelNum range of values is from –100 to 100. -100 indicates only the left channel is heard. 100 indicate only the right channel is being heard.
Page 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 You would use it by passing in the values you wanted to add: put AddNumbers(3, 4, 5, 6)
Page 461
You can also alter the value of this property by using the command. addChild 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
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 to determine doneParsing() when the parsing operation has completed. errorCode = gParserObject.parseURL("http://www.MyCompany.com/sample.xml") This Lingo parses the file sample.xml and calls the handler.
Page 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 on keyUp handlers attached to editable sprites.
Page 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 stream in the cast member Real or sprite 2.
Page 465
path Syntax member(whichCastmember).modelResource(whichModelResource).\ emitter.path Description 3D property; when used with a model resource whose type is , allows you to get or set #particle property of the resource’s particle emitter. path This property is a list of vectors that define the path particles follow over their lifetime. The default value of this property is an empty list Example In this example, ThermoSystem is a model resource of the type #particle.
Page 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 determines how closely #particle the particles follow the path specified by the property of the emitter. Its range starts at 0.0 path (no strength - so the particles won’t be attracted to the path) and continues to infinity.
Page 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 one, enabling you to create animation using smaller bitmaps: on exitFrame currentPat = member("Background Shape").pattern...
Page 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 command suspends playback of the current sound in sound channel channelNum subsequent command will resume playback.
Page 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 ( or 0) or remains paused FALSE or 1).
Page 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 member property equals 4. The portion of the sound that has already state been downloaded and is available will continue to play until the cache runs out.
Page 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 downloading the entire file, and prevents network congestion or lapses in bandwidth availability from disrupting the playback stream.
Page 472
This property can be tested only after the SWA sound starts playing or has been preloaded by means of the command. This property cannot be set. preLoadBuffer Example This handler displays the percentage of the SWA streaming cast member Frank Sinatra that has played and puts the value in the field cast member Percent Played: on exitFrame whatState = member("Frank Sinatra").state...
Page 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 < 60 then go to the frame end if See also percentPlayed...
Page 474
perpendicularTo Syntax vector1.perpendicularTo(vector2) Description 3D vector command; returns a vector perpendicular to both the original vector and a second vector . This command is equivalent to the vector command. See (vector2) crossProduct crossProduct() 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 .
Page 475
Syntax 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 property. floatPrecision Example This statement uses the constant as part of an equation for calculating the area of a circle: set vArea = PI*power(vRadius,2) picture (cast member property)
Page 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) Description...
Page 477
The following are the possible values for this property’s parameters: • javaVersion • , or browser Netscape UnknownBrowser • , or operatingSystem Macintosh Windows UnknownOS For example, if an applet is playing in Microsoft Internet Explorer with Java 1.1 in Windows, has the value platform Java 1.1, IE, Windows...
Page 478
Each command needs a matching command to avoid using up memory if the play play done 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 named blink: play "blink"...
Page 479
is measured in milliseconds from the beginning of the motion. When endTime looped FALSE the motion begins at and ends at . When , the first iteration of the offset endTime looped TRUE loop begins at and ends at with all subsequent repetitions beginning at offset endTime and end at...
Page 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 (whichMember)) sound(channelNum).play([#member: member(whichmember), {#startTime: milliseconds, #endTime: milliseconds, #loopCount: numberOfLoops, #loopStartTime: milliseconds, #loopEndTime: milliseconds, #preloadTime: milliseconds}]) Description...
Page 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, #loopCount: 6, #loopStartTime: 10500, #loopEndTime: 14000]) See also setPlaylist()
Page 482
command has no effect in a movie that is playing in a window. play done Example This handler returns the playhead to the frame of the movie that was playing before the current movie started: on exitFrame play done See also play playing Syntax...
Page 483
playlist Syntax member(whichCastmember).model(whichModel).keyframePlayer.playlist member(whichCastmember).model(whichModel).bonesPlayer.playlist Description modifier property; returns a linear list of property lists, #keyframePlayer #bonesPlayer each representing a motion queued for playback by the modifier. Each property list will have the following properties: • is the name of the motion to be played. #name •...
Page 484
Example This handler begins the playback of the cast member Big Band: on mouseDown member("Big Band").play() See also pause member stop member playNext() Syntax sound(channelNum).playNext() playNext(sound(channelNum)) Description This command immediately interrupts playback of the current sound playing in the given sound channel and begins playing the next queued sound.
Page 485
playRate Syntax member(whichCastmember).model(whichModel).bonesPlayer.playRate member(whichCastmember).model(whichModel).keyframePlayer.playRate Description modifier property; scale multiplier for the local time #keyframePlayer #bonesPlayer of motions being played. This property only partially determines the speed at which motions are executed by the model. The playback of a motion by a model is the result of either a command.
Page 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 = (the clickLoc - initialLoc) / steps repeat with i = 1 to steps...
Page 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("BrightSpot").pointAt(thisWorldPosn) member("Scene").model("BigGun").pointAt(thisWorldPosn, \ vector(0,0,45)) If you use non-uniform scaling and a custom on the same node, e.g., a pointAtOrientation model, using...
Page 488
pointInHyperlink() Syntax sprite(whichSpriteNumber).pointInHyperlink(point) pointInHyperlink(sprite whichSpriteNumber, point) Description Text sprite function; returns a value ( ) that indicates whether the specified point is TRUE FALSE within a hyperlink in the text sprite. Typically, the point used is the cursor position. This is useful for setting custom cursors.
Page 489
Example This example has two parts. The first part is the first line of code, which registers the #explode handler for the event. The second part is the handler. When two models #collideAny #explode in the cast member MyScene collide, the handler is called and the #explode collisionData...
Page 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 at screen coordinate , or returns -1 if the point is not within spriteNumber pointToTranslate the text. Items are separated by the property, which is set to a comma by default.
Page 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 at screen coordinate , or returns -1 if the point is not spriteNumber pointToTranslate within the text. Paragraphs are separated by carriage returns in a block of text. This function can be used to determine the paragraph under the cursor.
Page 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, position and rotation within a given frame of reference. The default value of this property is vector(0,0,0) A node can be a camera, group, light or model object.
Page 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 posterFrame of member whichFlashMember Description Flash cast member property; controls which frame of a Flash movie cast member is used for its thumbnail image.
Page 494
The optional parameter defaults to but may be set to serverOSString UNIX Windows translates any carriage returns in the argument into those used on the server to avoid postText confusion. For most applications, this setting is unnecessary because line breaks are usually not used in form responses.
Page 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, the movie selects the most suitable available renderer.
Page 496
In Director, setting the property to causes the cast member to load completely preLoad TRUE before playback starts. In Shockwave, setting the property to causes the cast preLoad TRUE member to begin streaming when the movie starts playing. Before perfoming any Lingo operations on a 3D cast member that is streaming, be sure to check that the cast member’s state property has a value greater than or equal to 2.
Page 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 can be preloaded into memory ( ) or not ( default). The whichCastMember TRUE FALSE, TRUE status has the same effect as selecting Enable Preload in the Digital Video Cast Member Properties dialog box.
Page 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 ( ) or not ( , default).
Page 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 when needed. •...
Page 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 with the name of any valid Internet file, such as a Director movie, graphic, or FTP server location.
Page 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 . For example, preLoadRAM if your movie has a data rate of 300K per second, set to 600K if you want to preload...
Page 502
preMultiply Syntax transform1.preMultiply(transform2) Description 3D transform command; alters by pre-applying the positional, rotational, and transform1 scaling effects of transform2 describes a rotation of 90° about the X axis and describes a transform2 transform1 translation of 100 units in the Y axis, transform1.multiply will alter this transform so that it describes a translation followed by a rotation.
Page 503
on prepareMovie Syntax on prepareMovie statement(s) 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
Alternatively, the rotation may also be specified as a rotation about an arbitrary axis. This axis is defined in space by . The amount of rotation about this positionVector directionVector axis is specified by angle may be a reference to a model, group, light, or camera Node Example The following statement performs a rotation of 20°...
Page 505
applies a scale to that transform prior to any existing positional or rotational effects of that Line 2 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 used here instead of , then Moon2 would be pushed out twice as far and...
Page 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 Description 3D function; returns a list of the primitive types that can be used to create new model resources. Example This statement display the available primitive types: put getRendererServices().primitives...
Page 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 . Optionally, you can supply and a fromFrame toFrame reduction value (100%, 50%, or 25%).
Page 508
property Syntax property {property1}{, property2} {,property3} {...} Description Keyword; declares the properties specified by , and so on as property1 property2 property variables. Declare property variables at the beginning of the parent script or behavior script. You can access them from outside the parent script or behavior script by using the operator.
Page 509
proxyServer Syntax proxyServer serverType, "ipAddress", portNum proxyServer() Description Command; sets the values of an FTP or HTTP proxy server, as follows: • — serverType #ftp #http • —A string containing the IP address ipAddress • —The integer value of the port number portNum If you use the syntax , this element returns the settings of an FTP or...
Page 510
While the playhead is in the same sprite, setting the sprite channel’s sprite property to puppet resets the sprite’s properties to those set in the Score. FALSE Making the sprite channel a puppet lets you control many sprite properties, such as member , and , from Lingo after the playhead exits from the sprite.
Page 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, whichCastMember puppetSound whichCastMember puppetSound member whichCastMember puppetSound 0 puppetSound whichChannel, 0...
Page 512
The sprite channel’s initial properties are whatever the channel’s settings are when the command is executed. You can use Lingo to change sprite properties as follows: puppetSprite • If a sprite channel is a puppet, any changes that Lingo makes to the channel’s sprite properties remain in effect after the playhead exits the sprite.
Page 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 followed by the cast puppetTransition member member’s name or number.
Page 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 .
Page 515
Syntax put expression Description Command; evaluates the expression specified by and displays the result in the expression 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 the command in the browser’s Java console window.
Description Command; evaluates a Lingo expression, converts the value to a string, and inserts the resulting string before a specified chunk in a container, without replacing the container’s contents. (If specifies a nonexistent target chunk, the string value is inserted as appropriate chunkExpression into the container.) Chunk expressions refer to any character, word, item, or line in any container.
Page 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 longer be accessible. Note: For security reasons, there is no way to display a listing of all registered keys.
Page 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 sprite property, be aware that you must reset the list of points after quad changing any of the values. This is because when you set a variable to the value of a property, you are placing a copy of the list, not the list itself, in the variable.
Page 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.texturelist[TextureListIndex].quality member(whichCastmember).model(whichModel).shaderList\ [shaderListIndex]. texture(whichTexture).quality member( whichCastmember ).model( whichModel ).shaderList\ [ shaderListIndex ]. texturelist[ TextureListIndex ].quality Description 3D texture property; lets you get or set the image quality of a texture by controlling the level of mipmapping applied to the texture.
Page 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 command. This is play() because Director preloads a certain amount of each sound that is queued, preventing any delay between the command and the start of playback.
Page 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 modifier command; adds the motion specified by keyframePlayer bonesPlayer motionName to the end of the modifier’s property. The motion is executed by the model when all the playList motions ahead of it in the playlist are finished playing.
Page 522
Example This statement inserts quotation mark characters in a string: put "Can you spell" && QUOTE & "Macromedia" & QUOTE & "?" The result is a set of quotation marks around the word Macromedia: Can you spell "Macromedia"?
Page 523
radius Syntax modelResourceObjectReference.radius member(whichCastmember).modelResource(whichModelResource).radius Description 3D model property; when used with model resource of type , allows you to #sphere #cylinder get or set the radius of the model. property determines the sweep radius used to generate the model resource. This radius property’s value must always be set to greater than 0.0, and has a default value of 25.0.
Page 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 position of sprites. To start a set of possible random numbers with a number other than 1, subtract the appropriate amount from the function.
Page 525
randomSeed Syntax the randomSeed Description System property; specifies the seed value used for generating random numbers accessed through function. random() Using the same seed produces the same sequence of random numbers. This property can be useful for debugging during development. Using the property is an easy way to produce a unique ticks random seed since the...
Page 526
rawNew() Syntax parentScript.rawNew() rawNew(parentScript) Description Function; creates a child object from a parent script without calling its handler. This allows on new a movie to create child objects without initializing the properties of those child objects. This is particularly useful when you want to create large numbers of child objects for later use. To initialize the properties of one of these raw child objects, call its handler.
Page 527
Examples The following code shows that the function is set to , which means realPlayerNativeAudio() FALSE that audio in the RealMedia cast member will be processed by Director: put realPlayerNativeAudio() -- 0 The following code sets the function to , which means that audio in realPlayerNativeAudio() TRUE the RealMedia stream will be processed by RealPlayer and all Lingo control of the sound channel...
Page 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 Director movies containing RealMedia content. On Windows systems, build numbers 6.0.8.132 or later indicate that RealPlayer 8 is installed.
Page 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 TrueType or Type 1 font as a cast member. Once embedded, these fonts are available to the author just like other fonts installed in the system.
Page 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.
Page 531
Examples This statement sets the variable to a rectangle whose left side is at 100, top is at 150, newArea right side is at 300, and bottom is at 400 pixels: set newArea = rect(100, 150, 300, 400) The following statement sets the variable to the rectangle defined by the points newArea .
Page 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
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 the movie was created, the movie is cropped in the window, not resized.
Page 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 shader property; allows you to get and set the texture used to create reflections on the surface of a model.
Page 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 , allows you to #particle both get and set the property of the resource’s particle emitter. region The region property defines the location from which particles are emitted. If its value is a single vector, then that vector is used to define a point in the 3D world from which particles will be emitted.
Page 536
parameter can be any of the following predefined Lingo events, or any custom eventName event that you define: • is a collision event. #collideAny • is a collision event involving this specific model. The #collideWith setCollisionCallback() command is a shortcut for using the command for the event.
Page 537
This statement declares the on handler in the same script that contains the promptUser command to be called when any object collides with the model named Pluto in registerForEvent the cast member named Scene: member("Scene").registerForEvent(#collideWith, #promptUser, me, \ member("Scene").model("Pluto")) See also setCollisionCallback() registerScript() play() (3D)
Page 538
• are notification events that occur when a bones or #animationStarted #animationEnded keyframe animation starts or stops playing. The handler will receive three arguments: , and . The argument is either eventName motion time eventName #animationStarted . The argument is the name of the motion that has started or stopped #animationEnded motion playing, and...
Page 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, . Nonvisual members such as sounds do not have a useful property.
Page 540
regPointVertex Syntax vectorMember.regPointVertex the regPointVertex of vectorMember Description Cast member property; indicates whether a vertex of is used as the registration vectorCastMember point for that cast member. If the value is zero, the registration point is determined normally, using the properties.
Page 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(whichModel).bonesPlayer.removeLast() member(whichCastmember).model(whichModel).keyframePlayer.\ removeLast() Description modifier command; removes the last motion from the keyframePlayer bonesPlayer modifier’s...
Page 542
removeOverlay Syntax member(whichCastmember).camera(whichCamera).removeOverlay(index) Description 3D command; removes the overlay found in the position specified by from the camera’s list index of overlays to display. Example The following statement removes the third overlay from the list of overlays for the camera being used by sprite 5.
Page 543
This property is a list that can contain the following possible values: • specifies the openGL drivers for a hardware acceleration which work with both #openGL Macintosh and Windows platforms. • specifies the DirectX 7 drivers for hardware acceleration which work with #directX7_0 Windows platforms only.
Page 544
property determines the pixel format the renderer uses when rendering the renderFormat 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 fidelity (including the precision of the optional alpha channel) and thus the amount of memory used on the video card.
Page 545
While in a repeat loop, Lingo ignores other events. To check the current key in a repeat loop, use property. keyPressed 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.
Page 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 puppetSprite channel, TRUE...
Page 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 property.
Page 548
on resizeWindow Syntax on resizeWindow statement(s) 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.
Page 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 for both models involved in a collision, both models come to TRUE a stop at the point of collision. If only one of the models has the property set to , that resolve...
Page 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 properties. Example The following statement sets the model resource used by the model named NewBox.
Page 551
Examples This handler returns a random roll for two dice: on diceRoll return random(6) + random(6) In the following example, the two statements diceRoll roll = the result are equivalent to this statement: set roll = diceRoll() Note that would not call the handler because there are no parentheses set roll = diceRoll following here is considered a variable reference.
Page 552
return (keyword) Syntax return expression Description Keyword; returns the value of and exits from the handler. The argument expression expression can be any Lingo value. When calling a handler that serves as a user-defined function and has a return value, you must use parentheses around the argument lists, even if there are no arguments, as in the function diceRoll...
Page 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 property must be 4 (loaded) or -1 (error) state before this command can be used, otherwise a script error will occur. This command differs from in that the values used are taken from the state of the resetWorld...
Page 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 lets the playhead continue to the next frame.
Page 555
Example This statement calls the handler when the right edge of sprite 3 is past the right edge offRightEdge of the Stage: if sprite(3).right > (the stageRight - the stageLeft) then offRightEdge See also bottom height left locH locV width right (3D) Syntax member(whichCastmember).modelResource...
Page 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 property is set to emulateMultiButtonMouse ;...
Page 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 ( ) or are currently being TRUE pressed ( FALSE On the Macintosh, only if the property is rightMouseUp...
Page 558
The following handler sends the playhead to different frames when the pointer is over certain sprites on the Stage. It first assigns the 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 rollOver continues to move the mouse.
Page 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 property allows you to modify this rootNode by creating a different default view that limits what’s shown to a particular node and its children.
Page 560
• applies the increments relative to the world coordinate system. If a model’s parent is the #world world, than this is equivalent to using #parent • allows you to specify a node to base your rotation upon, the command applies nodeReference the increments relative to the coordinate system of the specified node.
Page 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 perform continuous rotation, constrain the angles to ±360°.
Page 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 degrees (as a floating-point number) that describes a 2D rotational offset for engraved lines. The default value for this property is 0.0.
Page 563
rotationReset Syntax member(whichCastmember).model(whichModel).bonesPlayer.rotationReset member(whichCastmember).model(whichModel).keyframePlayer.\ rotationReset Description modifier property; indicates the axes around which rotational keyframePlayer bonesPlayer changes are maintained from the end of one motion to the beginning of the next, or from the end of one iteration of a looped motion to the beginning of the next iteration. Possible values of this property include , and .
Page 564
• —The movie is running as a Shockwave plug-in or other scripting environment, BrowserPlugin such as LiveConnect or ActiveX. • —The movie is playing back as a Java applet. Java Applet The safest way to test for particular values in this property is to use the operator.
Page 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 in Shockwave. TRUE In the authoring environment and in projectors, the default value is .
Page 566
Example This statement displays the name and of the cast member currently playing in sound sampleCount 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 Syntax member(whichCastMember).sampleRate...
Page 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).sampleSize save castLib...
Page 568
saveMovie Syntax saveMovie {pathName&fileName} Description Command; saves the current movie. Including the optional parameter saves the movie to the file specified by . This command does not work with compressed files. The pathName:fileName specified filename must include the .dir file extension. command doesn’t support URLs as file references.
Page 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 exitFrame me scaleFactor = sprite(spriteNum).scale[1] currentMemberNum = sprite(spriteNum).memberNum...
Page 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 positional, rotational, and scale offsets held by a referenced node’s transform or the directly referenced transform. The scaling must be specified as either a set of three scalings along the corresponding axes or as a single scaling to be applied uniformly along all axes.
Page 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 rotation within a given frame of reference. The property allows you to scale get and set the degree of scaling of the transform along each of the three axes.
Page 572
• —preserves the original size of the Flash media, regardless of how the sprite is sized on #noScale 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. •...
Page 573
scoreColor Syntax sprite(whichSprite).scoreColor the scoreColor of sprite whichSprite Description Sprite property; indicates the Score color assigned to the sprite specified by . The whichSprite possible values correspond to color chips 0 to 5 in the current palette. This property can be tested and set. Setting this property is useful only during authoring and Score recording.
Page 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 expression can be either a menu item name or a menu item number; the whichItem expression can be either a menu name or a menu number.
Page 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).scriptInstanceList These statements attach the script Big Noise to sprite 5:...
Page 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 whether scripts in a linked movie are enabled or 1) or disabled ( or 0).
Page 577
scriptType Syntax member whichScript.scriptType the scriptType of member whichScript Description Cast member property; indicates the specified script’s type. Possible values are , and #movie #score #parent Example This statement makes the script member Main Script a movie script: member("Main Script").scriptType = #movie scrollByLine Syntax member(whichCastMember).
Page 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).scrollTop the scrollTop of member whichCastMember Description Cast member property;...
Page 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 modifier to a model using , you can set the properties of the modifier.
Page 580
searchCurrentFolder Syntax the searchCurrentFolder Description System property; determines whether Director searches the current folder when searching file names. This property is by default. TRUE • When the property is (1), Director searches the current folder when searchCurrentFolder TRUE resolving filenames. •...
Page 581
Examples This statement displays the paths that Director searches when resolving filenames: put the searchPaths The following statement assigns two folders to in Windows. This version includes searchPaths optional trailing backslashes. set the searchPaths = ["c:\director\projects\", "d:\cdrom\sources\"] This statement is the same, except that trailing backslashes have been omitted: set the searchPaths = ["c:\director\projects", "d:\cdrom\sources"] The following statement assigns two folders to on a Macintosh.
Page 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 value usually becomes and then mediaStatus #seeking #buffering You can use this method to initiate play at points other than the beginning of the RealMedia stream, or to jump forward or backward in the stream.
Page 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).member.selectedText put mySelectionObject.text put mySelectionObject.font...
Page 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(whichTextMember).selection Description...
Page 585
selStart Syntax the selStart Description Cast member property; specifies the starting character of a selection. It is used with selEnd identify a selection in the current editable field, counting from the beginning character. This property can be tested and set. The default value is 0. Examples These statements select “cde”...
Page 586
Example This handler sends the custom message and the argument to all allSpritesShouldBumpCounter sprites when the user clicks the mouse: on mouseDown me sendAllSprites (#allSpritesShouldBumpCounter, 2) See also sendSprite sendEvent Syntax member(whichCastmember).sendEvent(#eventName, arg1, arg2,...) Description 3D command; sends the event , and an arbitrary number of arguments ( eventName arg1, arg2,...
Page 587
Example This handler sends the custom message and the argument to sprite 1 when the user bumpCounter clicks: on mouseDown me sendSprite (1, #bumpCounter, 2) See also sendAllSprites on sendXML Syntax sendXML "sendxmlstring", "window", "postdata" Description Event handler; functions much like the scripting method, which is also available using the getURL Flash Asset Xtra.
Page 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 information. Example This handler would be located in a movie script of a MIAW.
Page 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 . The must be a number from 0–255. Lower values cause the image to alphaImageObject alphaLevel appear more transparent. Higher values cause the image to appear more opaque. The value 255 has the same effect as a value of zero.
Page 590
Examples These statements create a property list and then adds the item to the list: #c:10 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 newList = [#a:1, #b:5]...
Page 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, #LingoHandlerName, lingoScriptObject) Description Flash command; this command can be used as a sprite or a global method to define a Lingo callback handler for a particular event generated by the specified object.
Page 592
setCollisionCallback() Syntax member(whichCastmember).model(whichModel).collision.\ setCollisionCallback (#handlerName, scriptInstance) Description 3D collision command; registers the handler in the given scriptInstance to be called #handlerName when is involved in a collision. whichModel This command works only if the model’s property is . The default collision.enabled TRUE behavior is determined by the value of...
Page 593
Example This statement sets the value of the property of the movie clip Star in the Flash member in #rotate 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), colorObject) imageObject.setPixel(x, y, integerValue) imageObject.setPixel(point(x, y), integerValue) Description Function;...
Page 594
You can specify these parameters for each sound to be queued: Property Description #member The sound cast member to queue. This property must be provided; all others are optional. #startTime The time within the sound at which playback begins, in milliseconds. The default is the startTime beginning of the sound.
Page 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 ; you can manipulate the data in memory and write it over the old file using getPref() setPref In a browser, data written by...
Page 596
setScriptList() Syntax spriteReference.setScriptList(scriptList) sprite(whichSprite).setScriptList(scriptList) Description This command sets the of the given sprite. The indicates which scripts are scriptList scriptList attached to the sprite and what the settings of each script property are. By setting this list, you can change which behaviors are attached to a sprite or change the behavior properties. The list takes the form: [ [ (whichBehaviorMember), "...
Page 597
Flash version 4. Example The following statement sets the value of the variable currentURL in the Flash cast member in sprite 3. The new value of currentURL will be “http://www.macromedia.com/software/flash/”. setVariable(sprite 3, "currentURL", "http://www.macromedia.com/software/flash/") See also hitTest(), getVariable()
Page 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 used to define the appearance of the surface of the model. The shader is the “skin” which is wrapped around the model resource used by the model.
Page 599
shaderList Syntax member(whichCastmember).model(whichModel).shaderList member(whichCastmember).model(whichModel).shaderList[index] Description 3D model property; a linear list of applied to the model. The number of entries shadowPercentage in this list equals the number of meshes in the model resource used by the model. Each mesh can be shaded by only one shader.
Page 600
The range of this property is 0 to 100, and the default value is 50. The number of colors used by the modifier and shader for a model is determined by toon painter property of the model’s modifier or shader. colorSteps toon painter...
Page 601
shiftDown Syntax the shiftDown Description System property; indicates whether the user is pressing the Shift key ( ) or not ( TRUE FALSE In the Director player for Java, this function returns only if the Shift key and another key are TRUE pressed simultaneously.
Page 602
short 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 clearGlobals global globals showLocals...
Page 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 cast as a parameter, searches that cast for Flash movie cast members, and displays the cast member name, number, and properties in the Message window:...
Page 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 end if See also...
Page 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 in a field named How Big: member("How Big").text = string(member("shrine").size) sizeRange Syntax...
Page 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°...
Page 607
After a list is sorted, it maintains its sort order even when you add new variables using the command. Example The following statement puts the list Values, which consists of [ ], into #a: 1, #d: 2, #c: 3 alphanumeric order. The result appears below the statement. put values -- [#a: 1, #d: 2, #c: 3] values.sort()
Page 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...
Page 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 contains RealMedia cast members that play concurrently, their sounds are played simultaneously in the same sound channel, Examples...
Page 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 sound device list on a Windows computer: Put the soundDeviceList --["QT3Mix", "MacroMix", "DirectSound"] See also...
Page 611
syntax performs the fade over a specified number of sound(whichChannel).fadeIn() frames or milliseconds. • When is specified, the fade in occurs evenly over that period of time. milliseconds • When is not specified, the default number of ticks is calculated as 15 * (1000 / milliseconds (tempo setting)) based on the tempo setting for the first frame of the fade in.
Page 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. volume Note: You may want to use the sound property to create a custom sound fade to allow more control over the actual volume of the channel.
Page 613
This property can be tested and set. To see an example of used in a completed movie, see the Sound Control movie in the soundLevel Learning/Lingo Examples folder inside the Director application folder. Examples This statement sets the variable equal to the current sound level: oldSound oldSound = the soundLevel This statement sets the sound level to 5:...
Page 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 Description Command;...
Page 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 of the Flash cast member “SWF”...
Page 616
specular (light) Syntax member(whichCastmember).light(whichLight).specular Description 3D light property; allows you to get or set whether specularity is on or off (TRUE) (FALSE) Specularity refers to the ability to have a highlight appear on a model where the light hitting the model is reflected toward the camera.
Page 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.
Page 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.0 and 180.00, and has a default value of 90.0. The float value you specify corresponds to half the angle;...
Page 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 touches ( ) or does not touch ( ) the quad of sprite1 TRUE FALSE sprite2 If both sprites have matte ink, their actual outlines, not the quads, are used. A sprite’s outline is defined by the nonwhite pixels that make up its border.
Page 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.
Page 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. form of this command is a shortcut for using camera.spriteSpaceToWorldSpace() camera(1).spriteSpaceToWorldSpace()
Page 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...
Page 623
Examples This statement sets the variable to the index number of the current Stage color: oldColor 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...
Page 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
When the movie plays back as an applet, the property is always 0, which is the location stageTop 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 of the Stage is beyond the top of the screen and calls the handler...
Page 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) Description System message and event handler; contains statements that run just before the playhead enters the first frame of the movie.
Page 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 whichSprite sound(channelNum).startTime...
Page 628
Example This handler sets the timer to 0 when a key is pressed: on keyDown startTimer See also lastClick() lastEvent() lastKey lastRoll timeoutLength timeoutMouse timeoutPlay timeoutScript timer state (3D) Syntax member(whichCastmember).state Description 3D property; returns the current state of the referenced member in the streaming and loading process.
Page 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 can be changed only when the SWA sound is stopped. preLoadTime The following properties for the SWA file return meaningful information only after the file begins streaming:...
Page 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 finishes loading into memory.
Page 631
indicates that streaming has begun but is in the very early stages of connecting to 1 (connecting) the server, and there is not enough information available locally to do anything with the cast member. This state is the equivalent of for the property.
Page 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 = "has animation."...
Page 633
on stepFrame Syntax on stepFrame statement(s) Description System message and event handler; works in script instances in because these are the actorList only objects that receive messages. This event handler is executed when the playhead on stepFrame enters a frame or the Stage is updated. handler is a useful location for Lingo that you want to run frequently for a on stepFrame specific set of objects.
Page 634
Example This statement checks whether the mouse button is being pressed and calls the handler if it is: dragProcedure if the stillDown then dragProcedure See also the mouseDown (system property) stop (Flash) Syntax sprite(whichFlashSprite).stop() stop sprite whichFlashSprite Description Flash command; stops a Flash movie sprite that is playing in the current frame. Example This frame script stops the Flash movie sprites playing in channels 5 through 10: on enterFrame...
Page 635
stop() (sound) Syntax sound(channelNum).stop() stop(sound(channelNum)) Description Command; stops the currently playing sound in sound channel . Issuing a channelNum play() command begins playing the first sound of those that remain in the queue of the given sound channel. To see an example of stop used in a completed movie, see the Sound Control movie in () (sound) the Learning/Lingo Examples folder inside the Director application folder.
Page 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. When the cast member is stopped, the member property equals 0.
Page 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 measured in ticks. This property can be tested and set. Example This statement stops the digital video sprite in channel 5 at 100 ticks into the digital video: sprite(5).stopTime = 100 stream Syntax...
Page 638
The script also saves the actual number of bytes streamed in a variable called . If the bytesReceived 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 playhead looping in the current frame until the cast member has finished loading into memory.
Page 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: • default —Streams part of the cast member each time the Director frame advances #frame ( while the sprite is on the Stage.
Page 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 property returns a value only when the Director streamSize movie is playing.
Page 641
on streamStatus Syntax on streamStatus URL, state, bytesSoFar, bytesTotal, error statement(s) 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) been called, and the handler has been added to a movie script.
Page 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 = string(2.0 + 2.5) This statement converts the symbol to a string and inserts it in the field cast member Color: #red...
Page 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 pixels, of the shape’s framing stroke. The value is a floating-point number between 0 and 100 and can be tested and set.
Page 644
subdivision Syntax member(whichCastmember).model(whichModel).sds.subdivision Description modifier property; allows you to get or set the subdivision surfaces mode of operation. Possible values are as follows: • specifies that the mesh is uniformly scaled up in detail, with each face subdivided the #uniform same number of times.
Page 645
suspendUpdates Syntax sprite(which3dSprite).suspendUpdates Description 3D sprite property; when set to , causes the sprite not to be updated as part of normal screen TRUE redraw operations. This can improve movie playback performance. Certain kinds of screen updates will still affect the sprite, such as those due to dragging another window over the sprite. When the property is set to , the sprite is redrawn normally.
Page 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 ( ) or leaves the color depth of the monitor TRUE unchanged when a movie is loaded ( ).
Page 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 is a symbol ( ) or not expression TRUE FALSE The P in stands for predicate.
Page 648
Syntax Description Constant; represents the Tab key. Examples This statement checks whether the character typed is the tab character and calls the handler if it is: doNextField if the key = TAB then doNextField These statements move the playhead forward or backward, depending on whether the user presses Tab or Shift-Tab: if the key = TAB then if the shiftDown then...
Page 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 Math function;...
Page 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 property is only used targetFrameRate if the property is set to .
Page 651
Examples A multiple-line command resembles a handler and requires an statement: tell end tell 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 handler can be found in the global property after the called handler is done.
Page 652
Examples This handler turns the handler on when the movie starts: on prepareMovie on streamStatus on prepareMovie tellStreamStatus(TRUE) This statement determines the status of the stream status handler: on mouseDown put tellStreamStatus() See also on streamStatus tellTarget() Syntax sprite(whichSprite).tellTarget("targetName") sprite(whichSprite).endTellTarget() Definition Command;...
Page 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, the more tightly the subdivided surface matches the original surface. The default is 65.0.
Page 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 made the right decision!" See also selEnd selStart...
Page 655
textureCoordinateList Syntax member(whichCastmember).modelResource(whichmodelResource). textureCoordinateList modelResourceObjectReference.textureCoordinateList Description 3D property; when used with a model resource whose type is , or with a modifier #mesh meshDeform attached to a model, this property allows you to get or set the property of textureCoordinateList the model resource.
Page 656
Description modifier properties; using these properties you can get and set information about meshdeform 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 one layer.
Page 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 property must be set to for the property textureType #member...
Page 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[textureLayerndex] Description 3D standard shader property; allows you to change how a textureLayer is mapped onto the surface of a model. This property is ignored if the modifier is applied to the model resource. #toon Possible values are as follows: •...
Page 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 onto all models which use this shader.
Page 660
Example The following statement sets the global for the 3D member to textureRenderFormat #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 See also renderer preferred3DRenderer...
Page 661
textureRepeatList Syntax shaderReference.textureRepeatList[textureLayerIndex] member(whichCastmember).shader(whichShader).textureRepeatList\ [textureLayerIndex] member(whichCastmember).shader[shaderListIndex].textureRepeatList\ [textureLayerIndex] member(whichCastmember).model(whichModel).shader.textureRepeatList\ [textureLayerIndex] member(whichCastmember).model(whichModel).shaderList\ [shaderListIndex]. textureRepeatList[textureLayerIndex] Description 3D standard shader property; allows you to get or set the texture clamping behavior of any texture layer. When , the default, the texture in can be tiled (repeated) several TRUE textureLayerIndex times across model surfaces.
Page 662
textureTransform Syntax member(whichCastmember).shader(whichShader).textureTransform member(whichCastmember).model(whichModel).shader.textureTransform member(whichCastmember).model(whichModel).shaderList{[index]}.\ textureTransform Description shader property; provides access to a transform which modifies the texture #standard coordinate mapping of the first texture layer of the shader. Manipulate this transform to tile, rotate, or translate the texture before applying it to the surface of the model. The texture itself remains unaffected;...
Page 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(ShaderName).textureTransformList\ [textureLayerIndex] member(whichCastmember).shader[shaderListIndex].texture\ TransformList[textureLayerIndex] member(whichCastmember).model(modelName).shader.texture\ TransformList[textureLayerIndex] member(whichCastmember).model(modelName).shaderList\ [shaderListIndex]. textureTransformList[textureLayerIndex] Description 3D standard shader property; this property provides access to a transform which modifies the texture coordinate mapping of a texture layer.
Page 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, 0.0000, 0.0000, \ 0.0000, 1.0000) The following statement halves the height and width of the fifth texture used by the shader gbCyl3.
Page 665
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 keyword to express cast member and sprite properties.
Page 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
Example This handler determines the time remaining until the next timeout event will be sent by the timeout object by calculating the difference between its property and the current Update time value of the milliseconds and displaying the result in the field Time Until: on prepareFrame msBeforeUpdate = timeout("Update").time - the milliseconds secondsBeforeUpdate = msBeforeUpdate / 1000...
Page 668
timeoutHandler Syntax timeoutObject.timeoutHandler Description System property; represents the name of the handler that will receive timeout messages from the given . Its value is a symbol, such as . The timeoutObject #timeExpiredHandler timeoutHandler always a handler within the timeout object’s object, or in a movie script if the timeout target object has no...
Page 669
Example The following statement sets the Countdown member field to the value of the timeoutLapsed property. Dividing by 60 converts the value to seconds. timeoutLapsed member("Countdown").text = string(the timeoutLapsed / 60) timeoutLength Syntax the timeoutLength Description System property; determines how many ticks must elapse before a timeout event occurs. A timeout occurs when the property reaches the time specified by timeoutLapsed...
Page 670
Examples This statement records the current setting of by setting the variable named timeoutMouse timing the timeoutMouse timing = the timeoutMouse The following statement sets the property to . The result is that the timeoutMouse FALSE property keeps its current value when the mouse button is pressed. timeoutLapsed the timeoutMouse = FALSE See also...
Page 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 property. It is used only for convenience in timing certain timeoutScript events. The command sets timer to 0.
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 displays the window whichWindow title in the window’s title bar. This property can be tested and set for windows other than the Stage.
Page 673
modifier has the following properties: #toon Note: For more detailed information about the following properties see the individual property entries. • allows you to get or set the style applied to color transitions. The following are the style possible values: gives sharp transitions between available colors.
Page 674
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 as the number of pixels from the upper left corner of the Stage. whichSprite When the movie plays back as an applet, this property’s value is relative to the upper left corner of the applet.
Page 675
Example This statement sets the property of the model resource Tube to , meaning the top of topCap FALSE this cylinder will be open: member("3D World").modelResource("Tube").topCap = FALSE topRadius Syntax modelResourceObjectReference.topRadius Description 3D command; when used with a model resource whose type is , allows you to both get #cylinder and set the...
Page 676
This property can be tested and set. Example This statement turns the property on: trace 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: •...
Page 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 statement determines the number of tracks in the digital video cast member Jazz Chronicle and displays the result in the Message window: put member("Jazz Chronicle").trackCount() trackCount (sprite property)
Page 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 can be tested but not set. Example This statement determines the time of the keyframe that follows the current time in track 5 of the digital video assigned to sprite channel 15 and displays the result in the Message window: put sprite(15).trackNextKeyTime(5) trackNextSampleTime...
Page 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 useful for locating text tracks in a digital video. This property can be tested but not set. Example This statement determines the time of the sample in track 5 that precedes the current time in the digital video sprite assigned to channel 15 and displays the result in the Message window:...
Page 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 can be tested but not set. Example This statement determines the stop time of track 5 in the digital video cast member Jazz Chronicle and displays the result in the Message window: put member("Jazz Chronicle").trackStopTime(5) trackStopTime (sprite property)
Page 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(whichTrack) trackType(member whichCastMember, whichTrack) Description Digital video cast member property;...
Page 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 creates a transform object. When this command is used without providing any parameters it creates a transform object equal to the identity transform.
Page 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].transform.transformProperty Description 3D property and command; allows you to get or set the transform associated with a particular node or a specific bone within a model using the modifier. As a command, bonesPlayer provides access to the various commands and properties of the transform object.
Page 684
If you want to modify the property of a bone within a model, then you must store a transform copy of the original transform of the bone, modify the stored copy using the above commands and properties, then reset the bone’s property so that it is equal to the modified transform transform.
Page 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. These increments may be specified explicitly in the form of , and xIncrement...
Page 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 image within the sprite’s bounding box. This offset is expressed in relation to the sprite’s default location as set by its center property.
Page 687
All shaders have access to the shader properties; in addition to these standard shader #standard properties shaders of the types , and have properties unique to #engraver #newsprint #painter their type. For more information, see the newShader Example The following statement causes the model Pluto to be rendered opaque. The setting of the blend property for the model’s shader will have no effect.
Page 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 Bitmap tab of the Property inspector. trimWhitespace() (function) Syntax imageObject.trimWhitespace()
Page 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.
• alters the color of the particle by linearly interpolating the color between #age over the lifetime of the particle. This is the default colorRange.start colorRange.end setting for this property. Example In this example, ThermoSystem is a model resource of the type #particle. This statement sets the ThermoSystem’s tweenMode to #velocity, so its slower particles will not reach the color specified by colorRange.end, while its faster particles will: member(8,2).modelResource("thermoSystem").tweenMode = \...
For movies created in Director 5 and 6, the member property returns for field cast type #field members and for text cast members. However, field cast members originally created in #richText Director 4 return for the member type, providing backward compatibility for movies that #text were created in Director 4.
Page 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: • indicates that this model resource is a primitive box resource created using the #box command. newModelResource •...
Page 693
Examples The following statement displays the property of the motion named Run. type put member("scene").motion("Run").type -- #bonesPlayer The following statement displays the property of the motion named DefaultMotion. type put member("scene").motion("DefaultMotion").type -- #none See also bonesPlayer (modifier) keyframePlayer (modifier) type (shader) Syntax member(whichCastmember).shader(whichShader).type Description...
Page 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: • indicates that this is texture was created from a Director cast member #fromCastMember supporting the property using the command.
Page 695
union() Syntax rect(1).union(rect(2)) union (rect1, rect2) Description Function; returns the smallest rectangle that encloses the two rectangles rect1 rect2 Example This statement returns the rectangle that encloses the specified rectangles: put union (rect (0, 0, 10, 10), rect (15, 15, 20, 20)) -- rect (0, 0, 20, 20) put rect(0, 0, 10, 10).union(rect(15, 15, 20, 20)) --rect (0, 0, 20, 20)
Page 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, lastCastMember Description Command; forces Director to clear the specified cast members from memory. Director automatically unloads the least recently used cast members to accommodate commands preLoad or normal cast loading.
Page 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 < (100 * 1024)) then unLoadMovie "Parsifal" This statement unloads the movie at http://www.cbDemille.com/SunsetBlvd.dir: unLoadMovie "http://www.cbDemille.com/SunsetBlvd.dir"...
Page 698
Example When used in the following handler, the command enters the changes that have updateFrame 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 numberOfFrames beginRecording...
Page 699
For SWA members, it can be set only when the SWA streaming cast member is stopped. Example This statement makes a file on an Internet server the URL for SWA cast member Benny Goodman: on mouseDown member("Benny Goodman").URL = "http://audio.macromedia.com/samples/ classic.swa"...
Page 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 getNetText() when they are given a property list. Use the optional parameter to encode any return characters in serverOSString...
Page 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 ( ) or not ( TRUE FALSE When set to , this property works in conjunction with the TRUE blendFunction properties: when...
Page 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 links in the text cast member. When , all links are automatically colored blue with underlines, useHypertextStyles...
Page 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 property list of a model, group, camera, or light. The default userData value of this property for an object that was created outside of Director is a list of all the properties that were assigned to the model’s property in the 3D modeling tool.
Page 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 RealMedia stream. For security reasons, you cannot use this property to retrieve a previously specified user name.
Page 705
value() Syntax value(stringExpression) Description Function; returns the value of a string. The string can be any expression that Lingo can understand. When is called, Lingo parses through the provided and value() stringExpression returns its logical value. Any Lingo expression that can be in the Message window or set as the value of a variable can also be used with value()
Page 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 to the parameters , and which are the specific distances from the reference point along the x-axis, y-axis, and z- axis, respectively.
Page 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 values of the vertex list using this type of chunk expression. Examples The following code shows how to determine the number of vertex points in a member: put member("Archie").vertex.count...
Page 708
Example This statement displays the value for an arched line with two vertices: vertextList 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(121.0000, 56.0000), #handle2: point(11.0000, -66.0000)]] See also count() deleteVertex() moveVertex() moveVertexHandle() originMode addVertex...
Page 709
Example This statement displays the modifier’s for the first mesh in the model #meshDeform vertexList 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 Syntax member(whichCastmember).modelResource(whichModelResource).\ face[faceIndex].vertices Description 3D face property; when used with a model resource whose type is , this property allows you #mesh to get or set which vertices from the resource’s...
Page 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 get whether the sprite or cast member renders video ( TRUE or 1) or only plays the sounds ( or 0).
Page 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 view point, specified in pixel units. The values can be floating-point numbers. The default value is 0.
Page 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 expressed relative to the movie’s origin (as set by the , and originPoint...
Page 713
One significant difference between the properties is that viewScale scale viewScale always scales from the center of the sprite’s bounding rectangle, whereas scales from a point scale determined by the Flash movie’s property. originMode This property can be tested and set. Note: This property must be set to the default value if the scaleMode property is set to #autoSize, or the sprite will not display correctly.
Page 714
visible (sprite property) Syntax sprite(whichSprite).visible the visible of sprite whichSprite Description Sprite property; determines whether the sprite specified by is visible ( ) or not whichSprite TRUE ). This property affects all sprites in the channel, regardless of their position in the Score. FALSE Note: Setting the visible property of a sprite channel to FALSE makes the sprite invisible and prevents only the mouse-related events from being sent to that channel.
Page 715
• specifies that only those polygons facing away from the camera are drawn. Use this #back 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 computing normals.
Page 716
Examples This statement sets the variable to the property list describing the current text-to- oldVoice speech voice: oldVoice = voiceGet() This statement displays the property list of the current text-to-speech voice: put voiceGet() -- [#name: "Mary", #age: "teen", #gender: "female", #index: 5] See also voiceInitialize() voiceCount()
Page 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 above 10 and set it to 10 if it is: if voiceGetPitch() >...
Page 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() < 55 then voiceSetVolume(55) end if See also voiceSpeak() voicePause() voiceResume() voiceStop() voiceGetRate() voiceSetRate() voiceGetPitch() voiceSetPitch() voiceSetVolume() voiceState() voiceWordPos() voiceInitialize() Syntax...
Page 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 voiceResume() end exitFrame...
Page 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 voiceSetRate(integer) Description Command; sets the playback rate of the text-to-speech engine to the specified integer value. The command returns the new value that has been set.
Page 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 string “Welcome to Shockwave”: voiceSpeak("Welcome to Shockwave") See also voiceSpeak()
Page 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() voiceState() voiceWordPos() voiceSpeak() voiceWordPos() Syntax voiceWordPos() Description Function;...
Page 723
voidP() Syntax voidP(variableName) Description Function; determines whether the variable specified by has any value. If the variableName variable has no value or is , this function returns . If the variable has a value other than VOID TRUE , this function returns VOID FALSE Example...
Page 724
To see an example of used in a completed movie, see the Sound volume (sound channel) 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).volume = 130 See also fadeIn()
Page 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 the width, in pixels, of the cast member specified by .
Page 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 . This property must be greater than or equal to 2, #box #plane and has a default value of 2.
Page 727
This statement moves the Navigation window to the front: moveToFront window "Navigation" 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 movie windows. Examples This statement displays a list of all known movie windows in the Message window: put the windowList This statement clears windowList...
Page 728
windowType Syntax window whichWindow.windowType the windowType of window whichWindow Description Window property; controls the display style of the window specified by , as follows: whichWindow • 0—Movable, sizable window without zoom box • 1—Alert box or modal dialog box • 2—Plain box, no title bar •...
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..lastWord] word firstWord to lastWord of chunkExpression chunkExpression.word[whichWord..lastWord] Description Chunk expression; specifies a word or a range of words in a chunk expression. A word chunk is any sequence of characters delimited by spaces. (Any nonvisible character, such as a tab or carriage return, is considered a space.) The expressions , and...
Page 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 not set the position of the specified node in world coordinates. A node can be a model, group, camera, or light. This property is equivalent in result to using command.
Page 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 property which returns the bone’s parent relative transform. The transform property can only be used with bonesplayer modified models. worldTransform Example This statement stores a bone’s world relative transform in the variable...
Page 732
wrapTransformList Syntax member( whichCastmember ).shader( ShaderName ).wrapTransformList\ [ textureLayerIndex ] member( whichCastmember ).shader[ shaderListIndex ].\ wrapTransformList[ textureLayerIndex ] member( whichCastmember ).model( modelName ).\ shader.wrapTransformList[ textureLayerIndex ] member( whichCastmember ).model( modelName ).shaderList\ [ shaderListIndex ]. wrapTransformList[ textureLayerIndex ] Description 3D standard shader property; this property provides access to a transform that modifies the texture coordinate mapping of a specified texture layer.
Page 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 transform.
Page 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 in XtraList #name Specifies the filename of the Xtra on the current platform.
Page 735
xtras 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 component of a vector. Example This statement shows the component of a vector: vec = vector(20, 30, 40) put vec.y -- 30.0000 yAxis Syntax...
Page 736
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 are not drawn. The default value for this property is 3.40282346638529e38. Example This statement sets the yon property of camera 1 to 50000: member("3d world").camera[1].yon = 50000...
Page 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 next line rotates ModCylinder 90°...
Page 738
Example This handler moves sprite 3 to the coordinates stored in the variable when the centerPlace window that the movie is playing in is resized: on zoomWindow centerPlace = point(10, 10) sprite(3).loc = centerPlace See also drawRect sourceRect on resizeWindow...
Page 739
INDEX Symbols allowZooming movie property 70 " (quotation mark) 522 Alt key (Windows) 450 " (string constant) 54 ampersand operators (& or &&) 45, 46 # (symbol definition operator) 43, 517 ancestor, sending messages to 116 & (concatenation operator) 45 and logical operator 72 &&...
Page 740
blend range, end and start 99 castLibNum of member 121 bonesPlayer modifier 32 changing cast member names 413 borders changing cast members used for cursors 170 of field cast members 104 copying 158, 204, 367, 475 of shape cast members 345 creating 423 boxes cursor command 170...
Page 741
Cast window, cast members selected in 583 item...of keyword 324 casts last function 335 activeCastLib system property 59 length function 339 cast numbers 438 line...of keyword 342 castLib keyword 121 numerical values of 705 castLibNum of member 121 offset function 446 file names of 232 put...after command 515 last cast member in 442...
Page 742
collisions continuation symbol (¬) 54 detection, and Lingo 33 Control key (Macintosh) 154 resolving 549 Control key (Windows) 150, 154 color depth converting colorDepth property 146 ASCII codes to characters 444 depth of member property 188 characters to ASCII codes 128 of bitmap cast members 188 duration in time to frames 291 of monitors 146...
Page 743
cylinders digital video sprite properties Lingo for 38 trackNextKeyTime 678 open and sealed 674 trackNextSampleTime 678 trackPreviousKeyTime 678 trackPreviousSampleTime 679 date object 581 trackText 680 debugging trackType (sprite) 681 with put command 515 digital video sprites with showGlobals command 602 counting tracks on 677 with showLocals command 602 media in tracks 681...
Page 744
on activateWindow 59 fading in sound 610 on alertHook 215 fading out sound 611 on closeWindow 215 FALSE logical constant 230 on cuePassed 215 field cast member properties on deactivateWindow 215 autoTab of member 82 on endSprite 215 border of member 104 on enterFrame 221, 472 boxDropShadow of member 107 on exitFrame 221...
Page 745
Finder, quitting from Director to (Macintosh) 522 marker labels and 334 finding markers before and after 362 empty cast members 238 memory needed to display 523 filenames 270, 580 number of palette in 252 movies 270 on enterFrame event handler 221 Flash Asset Xtra, endTellTarget command for 652 on exitFrame event handler 221 Flash movies...
Page 746
importing 310 level of detail (LOD) inker modifier 35 colors of 149 modifier properties 352 modifier 34 lights 78 inks ambient light 190 ink of sprite property 312 directional light 193 trails effect 681 Lingo for 35 inserting frames 315 line spacing for cast members 344 installing menus defined in field cast members 316 line wrapping 729...
Page 747
getOne command 270 loops getPos command 273 loop keyword 354 getProp command 274 next repeat keyword 433 getPropAt command 274 repeat with keyword 545 identifying items in 259, 260, 267, 270, 273, repeat with...down to keyword 546 repeat with...in list keyword 547 ilk function 303 list operators ([]) 52 Macintosh computers...
Page 748
menus motion 389 defining custom menus 373 playback 478 in current movie 443 timing 169 installing menus defined in field cast members 316 mouse clicks name of menu property 414 assigning scripts for 392, 401 mesh clickLoc function 135 colors of 147 clickOn function 136 Lingo for 38 determining if mouse button is pressed 392, 398...
Page 749
finding 270 normals 259, 375, 434 go loop command 281 list of 435 going to frames 280 not equal operator (<>) 50 idle time and 297 not logical operator 436 inserting frames 315 number sign (#) 43, 517 last frame in 337 numbers length of in time 410 cast member number of frame scripts 254...
Page 750
parent nodes, Lingo for 33 position parent scripts of cast members 126 ancestor property 71 of mouse pointer 394, 402, 403 me keyword 366 of sprites 152, 348, 349, 351, 619 objects created by 446 of Stage on desktop 622, 623, 624 parentheses operator () 47 positioning rectangles and points 360 parents 460...
Page 751
rectangles Score changing dimensions of 312 associated with current movie 572 coordinates of 532, 615 channels selected in 573 defining 530 recording 86, 214 inflate rect command 312 Score color assigned to sprites 573 inside function 316 updating 86, 698 intersect function 319 screens offsetting 447...
Page 752
Shockwave movies volume of sound 723 names of external parameters 225 volume of sprite 724 number of external parameters 225 sound sprites, current playing time of 168 opening 284 space character 615 playing from Internet 283 specular (3D property) values from external parameters 226 light property 616 short time format 666 shader property 616...
Page 753
stop time of tracks 680 integer function 317 stretching 642 item...of keyword 324 trails effect 681 last function 335 visibility of 714 length function 339 square brackets ([]) 52 line...of keyword 342 Stage numerical value of 705 centering on monitor 124 offset function 446 fixStageSize property 241 put...after command 515...
Page 754
ticks TAB character constant 648 converting time to 665 Tab key 648 lastClick function 336 tabbing order, autoTab of member property 82 lastKey function 337 tempo lastRoll function 337 assigned to frames 256 movieTime of sprite property 410 settings 256 number of before timeout occurs 669 tempo channels as puppets 512 ticks function 665...
Page 755
updating on activateWindow event handler 59 frames 697 on closeWindow event handler 215 registration points 475 on deactivateWindow event handler 215 Score 86, 214, 698 on moveWindow event handler 449 Stage 699 on openWindow event handler 449 URLs, Shockwave Audio cast members and 699 on zoomWindow event handler 448 user data 703 opening 449...
Need help?
Do you have a question about the DIRECTOR MX-LINGO DICTIONARY and is the answer not in the manual?
Questions and answers