Lingo Dictionary Macromedia Director MX
Trademarks Afterburner, AppletAce, Attain, Attain Enterprise Learning System, Attain Essentials, Attain Objects for Dreamweaver, Authorware, Authorware Attain, Authorware Interactive Studio, Authorware Star, Authorware Synergy, Backstage, Backstage Designer, Backstage Desktop Studio, Backstage Enterprise Studio, Backstage Internet Studio, Contribute, Design in Motion, Director, Director Multimedia Studio, Doc Around the Clock, Dreamweaver, Dreamweaver Attain, Drumbeat, Drumbeat 2000, Extreme 3D, Fireworks,
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.
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 ink member (sprite property) loc regPoint locH tweened Behaviors The terms in this section are useful for authoring behaviors and using behaviors while the movie plays.
Bitmaps The terms in this section are useful for working with bitmaps.
Cast members The terms in this section are useful for working with cast members. Creating cast members Use importFileInto and new() to create cast members. Authoring Use duplicate member, erase during authoring.
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 maxInteger emulateMultiButtonMouse multiSound floatPrecision romanLingo Operating system control Use restart and shutDown to control the operating system.
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() hotSpotEnterCallback quickTimeVersion() invertMask
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 on rightMouseUp (event handler) on keyUp on startMovie on mouseDown (event handler) on stepFrame on mouseEnter on streamStatus on mouseLeave on
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: 10 actionsEnabled originV broadcastProps pathName (movie property) bufferSize pausedAtStart (Flash, digital video) buttonsEnabled percentStreamed bytesStreamed play callFrame() playBackMode centerRegPoint playing clearError posterFrame clickMode print() defaultRect printAsBitmap() defaultRectMode qualit
hitTest() stream hold streamMode imageEnabled streamSize linked tellTarget() loop (keyword) URL 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() newObject() Frames The Lingo terms in this section let you work with frames.
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 buttonStyle checkMark buttonType hilite (cast member property) checkBoxAccess Keys The Lingo terms in this section are related to using the keyboard.
Lingo The Lingo terms in this section are important language elements that you use to construct scripts. Boolean values Use these terms to test whether a condition exists: • • • • FALSE (0 TRUE (1 is the numerical equivalent of FALSE). is the numerical equivalent of TRUE). not or Script control Use these terms to control how a script executes: abort pass do result exit scriptsEnabled halt scriptText nothing stopEvent Code structures Use if to create if..then statements.
Lists The terms in this section are useful for working with lists. Creating lists Use [ ] (list), duplicate() (list function), or list() to create a list.
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 on idle event handler for Lingo that runs when the movie is idle.
Memory requirements Use ramNeeded() and size to determine how much memory required for a cast member or a range of frames. Menus See Menus in the Interface elements section. Message window Use these terms to work in the Message window: put traceLoad showXlib traceLogFile trace appMinimize Monitor Use colorDepth, deskTopRectList, and switchColorDepth to check and control the monitor. Mouse interaction The terms in this section are useful for Lingo related to using the mouse.
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 Use cursor (command), cursor pointer (cursor). (sprite property), and cursorSize to control the Movies in a window The terms in this section are useful for working with movies in a window.
Communication between movies Use the tell command to send messages between movies. Movies The terms in this section are useful for managing movies.
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.
Working with the local computer Use these terms to work with the user’s computer: browserName() clearCache (For projectors and authoring only) cacheDocVerify() (For projectors and authoring only) getPref() cacheSize() (For projectors and authoring only) setPref Browsers Use on EvalScript, externalEvent, and netStatus to interact with browsers. For additional information about browser scripting using languages such as JavaScript, see “Shockwave Publishing” on the Director Support Center at www.
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() sourceRect offset() (rectangle function) union() point() For Lingo that controls a sprite’s bounding rectangle, see Sprite dimensions.
Score The following terms let you work with the Score. Score properties Use lastFrame, score, and scoreSelection to work with the movie’s Score.
Sound The terms in this section are useful for playing sounds.
Rotating sprites Use the rotation sprite property to rotate sprites. Dragging sprites Use these terms to set how the user can drag sprites: constrainH() moveableSprite constrainV() sprite...intersects constraint sprite...
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 stageTop stageBottom updateStage Tempo Use the puppetTempo command to control a movie’s tempo. Text The terms in this section are useful for working with text, strings, and fields.
line...of string() number (characters) stringP() number (items) value() number (lines) word...of Editable text Use the editable property to specify whether text is editable.
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 lineHeight (cast member property) lineCount pageHeight Scrolling text Use these terms to work with scrolling text: linePosToLocV() scrollByLine locToCharPos() scrollByPage locVToLinePos()
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: changeArea puppetTransition chunkSize transitionType duration Variables The terms
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 fillScale vertexList flashRect viewPoint flipH
Xtra extensions Use these terms to work with Xtra extensions: 30 movieXtraList xtra name (system property) xtraList number of xtras xtras Chapter 1
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.
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) blendTime playing (3D) bonesPlayer (modifier) playlist count playNext(
count scale (transform) deleteCamera transform (property) fieldOfView (3D) translate hither userData isInWorld() worldPosition name yon 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 registerForEvent() collisionNormal registerScript() enabled (collision
cloneMotionFromCastmember newShader deleteCamera newTexture deleteGroup removeModifier deleteLight removeBackdrop deleteModel removeFromWorld deleteModelResource removeOverlay deleteMotion Fog Use these terms to work with fog: color (fog) far (fog) decayMode fog enabled (fog) near (fog) Groups Use these terms to work with groups: addChild newGroup addToWorld pointAt boundingSphere pointAtOrientation child position (transform) clone removeFromWorld cloneDeep rotate count scale
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: auto level bias lod (
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 Model resources Use these terms to work with 3D
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.
Primitives The following sections list the terms used to work with each type of primitive. Use the primitives property to determine which types of primitives are supported by the current 3D renderer.
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 state (3D) Selecting models Use these terms to enable individual models in a 3D cast member to be selected and respond to mouse clicks.
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 Use these terms to work
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 displayFace tunnelDepth Textures Use these terms to work with textures: compressed newTexture count quality (3D) deleteTexture renderFormat height (3D) texture member
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: 42 angleBetween getNormalized axisAngle magnitude cross norm
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.
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 object.commandOrFunction() Description Operator; used to test or set properties of objects, or to issue a command or execute a function of the object.
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. (Subtraction): This statement subtracts the floating-point number 1.5 from the floating-point number 3.25 and displays the result in the Message window: put 3.25 - 1.5 The result is 1.75, which is a floating-point number.
For example, the open window command allows one argument that specifies which window to open. If you use the & operator to define a pathname and filename, Director interprets only the string before the & operator as the filename. For example, Lingo interprets the statement open window the applicationPath & "theMovie" as (open window the applicationPath) & ("theMovie").
() (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. This is a grouping operator with a precedence level of 5.
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. If either or both expressions are floating-point numbers, the sum is a floating-point number.
vector1 vector1 - vector2 subtracts the values of vector2 from the corresponding components in and returns a new vector. - scaler subtracts the value of the scalar from each of the components in the vector and returns a new vector.
/ (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 expression1 is less than expression2 (TRUE), or whether expression1 is greater than or equal to expression2 (FALSE). This operator can compare strings, integers, floating-point numbers, rects, and points.
= (equals) Syntax expression1 = expression2 Description Comparison operator; compares two expressions, symbols, or objects and determines whether expression1 is equal to expression2 (TRUE), or whether expression1 is not equal to expression2 (FALSE). This operator can compare strings, integers, floating-point numbers, rects, lists, and points. Lists are compared based on the number of elements in the list. The list with more elements is considered larger than the than the list with fewer elements.
[ ] (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. Example This outputs the first word of the third line in the text cast member First Names: put member("First Names").text.line[3].word[1] [ ] (list) Syntax [entry1, entry2, entry3, ...
Lingo treats an instance of a list as a reference to the list. This means each instance is the same piece of data, and changing it will change the original. Use the duplicate command to create copies of lists. Lists are automatically disposed when they are no longer referred to by any variable. When a list is held within a global variable, it persists from movie to movie.
" (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” is a literal string, the name of a cast member: put member("San Francisco").
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. The @ symbol does not work when the FileIO Xtra or other functions are used outside those available within Director.
abbr, abbrev, abbreviated These elements are used by the date and time functions. See also date() (system clock) abort Syntax abort Description Command; tells Lingo to exit the current handler and any handler that called it without executing any of the remaining statements in the handler. This differs from the exit keyword, which returns to the handler from which the current handler was called. The abort command does not quit Director.
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 (TRUE, default) or disabled (FALSE). This property can be tested and set. Example This handler accepts a sprite reference as a parameter, and then toggles the sprite’s actionsEnabled property on or off.
on activateWindow Syntax on activateWindow statement(s) end Description System message and event handler; contains statements that run in a movie when the user clicks the inactive window and the window comes to the foreground. You can use an on activateWindow handler in a script that you want executed every time the movie becomes active. Clicking the main movie (the main Stage) does not generate an on activateWindow handler.
activeCastLib Syntax the activeCastLib Description System property; indicates which cast was most recently activated. The activeCastLib property’s value is the cast’s number. The activeCastLib property is useful when working with the selection Use it to determine which cast the selection refers to. castLib property. This property can be tested but not set.
Description Movie property; a list of child objects that have been explicitly added to this list. Objects in actorList receive a stepFrame message each time the playhead enters a frame. To add an object to the actorList, use add actorList, theObject. The object’s on stepFrame handler in its parent or ancestor script will then be called automatically at each frame advance. To clear objects from the actorList, set actorList to [ ], which is an empty list.
add (3D texture) Syntax member(whichCastmember).model(whichModel).meshdeform.mesh[index].\ textureLayer.add() Description 3D meshdeform modifier command; adds an empty texture layer to the model’s mesh. You can copy texture coordinates between layers using the following code: 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.
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. t1 = member("Scene").newTexture("Rough", #fromCastMember, \ member("Cedar")) sprite(5).
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 #preserveWorld argument to maintain Bird’s world position. member("3D").camera("MyCamera").addChild(member("3D").model ("Bird"), #preserveWorld) See also parent, addToWorld, removeFromWorld addModifier Syntax member(whichCastmember).
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 locWithinSprite with the indicated rotation. The locWithinSprite parameter is a 2D loc measured from the upper left corner of the sprite.
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.
alert Syntax alert message Description Command; causes a system beep and displays an alert dialog box containing the string specified by message and an OK button. This command is useful for providing error messages of up to 255 characters in your movie. The message must be a string. If you want to include a number variable in an alert, use the function to convert the variable to a string.
The fourth argument can have 1 of these 4 values: • • #alert • • #script - causes the handler to be triggered by the alert command. #movie - causes the handler to be triggered by a file not found error while perforoming a go to movie command. - causes the handler to be triggered by a script error. #safeplayer - causes the handler to be triggered by a check of the safePlayer property. Depending on the Lingo within it, the on another way.
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").
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 TRUE, and can be tested and set.
allowZooming Syntax the allowZooming Description Movie property; determines whether the movie may be stretched or zoomed by the user when playing back in Shockwave and ShockMachine. Defaults to TRUE. This property can be tested and set. Set this property to FALSE to prevent users from changing the size of the movie in browsers and ShockMachine. See also allowGraphicMenu, allowSaveLocal, allowTransportControl, allowVolumeControl alphaThreshold Syntax member(whichMember).
Example This statement sets the ambient property of the model named Chair to rgb(255, 255, 0). Chair will fully reflect the red and green components of the ambient light in the scene and completely ignore its blue component. member("Room").model("Chair").shader.ambient = rgb(255, 0, 0) See also ambientColor, newLight, type (light), diffuse, specular (shader) ambientColor Syntax member(whichCastmember).
The ancestor script can contain independent property variables that can be obtained by child objects. To refer to property variables within the ancestor script, you must use this syntax: me.propertyVariable = value For example, this statement changes the property variable legCount within an ancestor script to 4: me.legCount = 4 Use the syntax the variableName of scriptName to access property variables that are not contained within the current object.
The result is 1, which is the numerical equivalent of TRUE. The first logical expression in the following statement is TRUE; and the second logical expression is Because both logical expressions are not TRUE, the logical operator displays the result 0, which is the numerical equivalent of FALSE. FALSE. put 1 < 2 and 2 < 1 -- 0 See also not, or angle Syntax member(whichCastmember).modelResource(whichModelResource).\ emitter.
animationEnabled Syntax member(whichCastmember).animationEnabled Description 3D cast member property; indicates whether motions will be executed (TRUE) or ignored (FALSE). This property can also be set in the Property inspector. The default value for this property is TRUE. Example This statement disables animation for the cast member named Scene. member("Scene").animationEnabled = FALSE antiAlias Syntax member(whichMember).antiAlias sprite(whichVectorSprite).
Description This property indicates whether the 3D world in the sprite whichSprite is anti-aliased. It can be tested and set. The default value is FALSE, indicating that anti-aliasing is off. If the antiAliasingEnabled property is set to TRUE and the 3D renderer changes to a renderer that does not support anti-aliasing, the property is set to FALSE. The value of this property is not saved when the movie is saved.
antiAliasThreshold Syntax member(whichTextMember).antiAliasThreshold Description Text cast member property; this setting controls the point size at which automatic anti-aliasing takes place in a text cast member. This has an effect only when the antiAlias property of the text cast member is set to TRUE. The setting itself is an integer indicating the font point size at which the anti-alias takes place. This property defaults to 14 points. See also antiAlias append Syntax list.
Examples This statement displays the pathname for the folder that contains the Director application. put the applicationPath --"Z:\Program Files\Macromedia\Director" This statement opens the movie Sunset Boulevard in a window (on a Windows machine): open window (the applicationPath & "\Film Noir\Sunset Boulevard") See also @ (pathname), moviePath appMinimize Syntax appMinimize Description Command; on Windows, appMinimize causes a projector to minimize to the Windows Task Bar.
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 attenuation property of the light named HouseLight to the vector (.5, 0, 0), darkening it slightly. member("3d world").light("HouseLight").attenuation = \ vector(.
attributeValue Syntax XMLnode.attributeValue[ attributeNameOrNumber ] Description XML property; returns the value of the specified child node of a parsed XML document. Example Beginning with the following XML: element 2 element 3 here is some text This Lingo returns the value of the first attribute of the tag called tagName: put gParserObject.child[1].child[1].
The following Lingo sets the audio property for sprite 2 and the cast member Real to FALSE, which means that the audio portion of the RealMedia stream will not be played when the movie is played. sprite(2).audio = FALSE member("Real").audio = FALSE See also soundChannel (RealMedia), video (RealMedia), sound auto Syntax member(whichCastmember).model(whichModel).lod.
Example This statement turns autoblend off for the model named Alien3. The model’s blendFactor setting will be used for blending successive motions in the playlist. member("newaliens").model("Alien3").keyframePlayer.\ autoblend = FALSE See also blendFactor, blendTime 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 (TRUE) or not (FALSE).
Using traditional Lingo syntax, the script is written as: on mouseEnter set the autoMask of member 5 = TRUE end on mouseLeave set the autoMask of member 5 = FALSE end autoTab Syntax member(whichCastMember).autoTab the autoTab of member whichCastMember Description Cast member property; determines the effect that pressing the Tab key has on the editable field or text cast member specified by whichCastMember. The property can be made active (TRUE) or inactive (FALSE).
back Syntax member(whichCastmember).modelResource(whichModelResource).back Description 3D #box model resource property; indicates whether the side of the box intersected by its +Z axis is sealed (TRUE) or open (FALSE). The default value for this property is TRUE. Example This statement sets the back property of the model resource named Crate to FALSE, meaning the back of this box will be open. member("3D World").modelResource("Crate").
Examples This statement changes the color of the characters in cast member 1 to the color in palette entry 250. Dot syntax: member(1).backColor = 250 Verbose Lingo syntax: set the backColor of member 1 to 250 The following statement sets the variable oldColor to the background color of sprite 5: oldColor = sprite (5).backColor The following statement randomly changes the background color of a random sprite between sprites 11 and 13 to color number 36: sprite(10 + random(3)).
regPoint (3D) blend (3D) count indicates the registration point of the backdrop. indicates the opacity of the backdrop. indicates the number of items in the camera’s list of backdrops. Use the following commands to create and remove backdrops: addBackdrop creates a backdrop from a texture and adds it to the end of the camera’s list of backdrops. creates a backdrop from a texture and adds it to the camera’s list of backdrops at a specific index position.
beep Syntax beep {numberOfTimes} Description Command; causes the computer’s speaker to beep the number of times specified by numberOfTimes. If numberOfTimes is missing, the beep occurs once. • In Windows, the beep is the sound assigned in the Sounds Properties dialog box. • For the Macintosh, the beep is the sound selected from Alert Sounds on the Sound control panel. If the volume on the Sound control panel is set to 0, the menu bar flashes instead.
Example When used in the following handler, the beginRecording keyword begins a Score generation session that animates the cast member Ball by assigning the cast member to sprite channel 20 and then moving the sprite horizontally and vertically over a series of frames. The number of frames is determined by the argument numberOfFrames. 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).
Example This handler plays the sound cast member Stevie Wonder when the sprite begins: on beginSprite me puppetSound "Stevie Wonder" end See also on endSprite, on prepareFrame, scriptInstanceList bevelDepth Syntax member(whichTextCastmember).bevelDepth member(which3DCastmember).modelResource(whichModelResource).\ bevelDepth Description 3D text property; indicates the degree of beveling on the 3D text.
The bevelType property has the following possible values: • • • #none #miter (the default) #round Example In this example, the cast member named Logo is a text cast member. This statement sets the bevelType of Logo to #round. member("logo").beveltype = #round In this example, the model resource of the model named Slogan is extruded text. This statement sets the bevelType of Slogan’s model resource to #miter. member("scene").model("Slogan").resource.
bias Syntax member(whichCastmember).model(whichModel).lod.bias Description 3D lod modifier property; indicates how aggressively the modifier removes detail from the model when its auto property is set to TRUE. This property has no effect when the modifier’s auto property is set to 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.
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 recordFont, characterSet, originalFont bitNot() Syntax (integer).
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.
Verbose syntax: property spriteNum on beginSprite me memName = sprite(spriteNum).member.name put "The bitRate of member"&&memName&&"is"&&member(memName).bitRate end bitsPerSample Syntax member(whichCastMember).bitsPerSample the bitsPerSample of member whichCastMember Description Shockwave Audio (SWA) cast member property; indicates the bit depth of the original file that has been encoded for Shockwave Audio (SWA).
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. The possible colors depend on the colors available in the palette, regardless of the monitor’s color depth.
Description 3D backdrop, overlay, and #standard shader property; indicates the opacity of the backdrop, overlay, or shader. Setting the blend property of a shader will have no effect unless the shader’s transparent property is set to TRUE. The range of this property is 0 to 100, and the default value is 100. Example This statement sets the blend property of the shader for the model named Window to 80. If the transparent property of Window’s shader is set to TRUE, the model will be slightly transparent.
blendConstantList Syntax member(whichCastmember).shader(whichShader).blendConstantList member(whichCastmember).model(whichModel).shader.blendConstant\ List{[index]} member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendConstantList{[index]} Description 3D #standard shader property; indicates the ratio used for blending a texture layer of the shader with the texture layer below it. The shader’s texture list and the blend constant list both have eight index positions.
BlendFactor is used only when the autoblend property of the modifier is set to FALSE. If value of the blendFactor property is 100, the current motion will have none of the characteristics of the motion that preceded it. If the value of blendFactor is 0, the current the motion will have all of the characteristics of the motion that preceded it and none of its own.
Example In this example, the shader list of the model named MysteryBox contains six shaders. This statement sets the blendFunction property of the second shader to #blend. This enables the settings of the blendSource, blendSourceList, blendConstant, and blendConstantList properties. member("Level2").model("MysteryBox").shaderList[2].
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. The results are the same, the scales simply differ. This property is the equivalent of the blend sprite property. Example sprite(3).
blendSource Syntax member(whichCastmember).shader(whichShader).blendSource member(whichCastmember).model(whichModel).shader.blendSource member(whichCastmember).model(whichModel).shaderList{[index]}.\ blendSource Description 3D #standard shader property; indicates whether blending of the first texture layer in the shader’s texture list is based on the texture’s alpha information or a constant ratio.
Description 3D #standard shader property; indicates whether blending of a texture layer with the texture layers below it is based on the texture’s alpha information or a constant ratio. The shader’s texture list and the blend source list both have eight index positions. Each index position in the blend source list controls blending for the texture at the corresponding index position in the texture list.
Example This statement sets the length of the transition between motions in the playlist of the modifier for the model named Alien5 to 1200 milliseconds. member("newaliens").model("Alien5").keyframePlayer.\ blendTime = 1200 See also autoblend, blendFactor bone Syntax member(whichCastmember).modelResource(whichModelResource).\ bone.count member(whichCastmember).model(whichModel).bonesPlayer.\ bone[index].transform member(whichCastmember).model(whichModel).bonesPlayer.\ bone[index].
is a number that is multiplied by the scale parameter of the play() or queue() command to determine the playback speed of the motion. playRate playlist.count rootLock returns the number of motions currently queued in the playlist. indicates whether the translational component of the motion is used or ignored. currentLoopState indicates whether the motion plays once or repeats continuously.
border 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: set the border of member "Title" to 10 bottom Syntax sprite(whichSprite).
Description 3D #box model resource property; indicates whether the side of the box intersected by its -Y axis is sealed (TRUE) or open (FALSE). The default value for this property is TRUE. Example This statement sets the bottom property of the model resource named GiftBox to TRUE, meaning the bottom of this box will be closed. member("3D World").modelResource("GiftBox").bottom = TRUE See also back, front, top (3D), left (3D), right (3D), bottomCap bottomCap Syntax member(whichCastmember).
bottomSpacing Syntax chunkExpression.bottomSpacing Description Text cast member property; enables you to specify additional spacing applied to the bottom of each paragraph in the chunkExpression portion of the text cast member. The value itself is an integer, where less than 0 indicates less spacing between paragraphs and greater than 0 indicates more spacing between paragraphs. The default value is 0, which results in default spacing between paragraphs.
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 debug boxDropShadow Syntax member(whichCastMember).
breakLoop() Syntax sound(channelNum).breakLoop() Description This function causes the currently looping sound in channel channelNum to stop looping and play through to its endTime. If there is no current loop, this function has no effect. Example This handler causes the background music looping in sound channel 2 to stop looping and play through to its end: on continueBackgroundMusic sound(2).
Example This frame script assumes that a Flash movie cast member named Navigation Movie has been set up with its broadcastProps property set to FALSE. The script momentarily allows changes to a Flash movie cast member to be broadcast to its sprites currently on the Stage. It then sets the viewScale property of the Flash movie cast member, and that change is broadcast to its sprite. The script then prevents the Flash movie from broadcasting changes to its sprites.
bufferSize Syntax member(whichFlashMember).bufferSize the bufferSize of member whichFlashMember Description Flash cast member property; controls how many bytes of a linked Flash movie are streamed into memory at one time. The bufferSize member property can have only integer values. This property has an effect only when the cast member’s preload property is set to FALSE. This property can be tested and set. The default value is 32,768 bytes.
Line 4 defines the three colors allowed by the newMesh command. Line 5 assigns the colors to the first face of Plane. The third color in the color list is applied to the first vertex of Plane, the second color to the second vertex, and the first color to the third vertex. The colors will spread across the first face of Plane in gradients. Line 6 creates the normals of Plane with the generateNormals() command. Line 7 calls the build() command to construct the mesh. nm = member("Shapes").
buttonStyle Syntax the buttonStyle Description Movie property; determines the visual response of buttons when the user rolls the pointer off them. This property applies only to buttons created with the Button tool in the Tool palette. The buttonStyle property can have these values: • 0 (list style: default)—Subsequent buttons are highlighted when the pointer passes over them. Releasing the mouse button activates the script associated with that button.
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 bytesStreamed property returns a value only when the Director movie is playing. It returns an integer value. This property can be tested but not set.
cacheDocVerify() Syntax cacheDocVerify #setting cacheDocVerify() Description Function; sets how often the contents of a page on the Internet are refreshed with information from the projector’s cache. Possible values are #once (default) and #always. Specifying #once tells a movie to get a file from the Internet once and then use the file from the cache without looking for an updated version on the Internet.
call Syntax call #handlerName, script, {args...} call (#handlerName, scriptInstance, {args...}) Description Command; sends a message that invokes a handler in specified scripts where handlerName is the name of the handler to be activated, script references the script or a list of scripts, and args are any optional parameters to be passed to the handler. If script is a single script instance, an error alert occurs if the handler is not defined in the script’s ancestor script.
• The following statements use the parent script and ancestor script.
• This is the ancestor script: -- script "animal" property legCount on new me, newLegCount set legCount = newLegCount return me end on run me put "Animal running with "& legCount &" legs" end on walk me put "Animal walking with "& legCount &" legs" end • The following statements use the parent script and ancestor script.
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.
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). member("Babyland").
case Syntax case expression of expression1 : Statement expression2 : multipleStatements . . . expression3, expression4 : Statement {otherwise: statement(s)} end case Description Keyword; starts a multiple branching logic structure that is easier to write than repeated if...then statements.
This case statement tests whether the cursor is over sprite 1, 2, or 3 and runs the corresponding Lingo if it is: case the rollOver of 1: puppetSound "Horn" 2: puppetSound "Drum" 3: puppetSound "Bongos" end case castLib Syntax castLib whichCast Description Keyword; indicates that the cast specified in whichCast is a cast. The default cast is cast number 1. To specify a cast member in a cast other than cast 1, set castLib to specify the alternative cast.
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. Dot syntax: sprite(5).castLibNum = castLib("Wednesday Schedule").
center Syntax member(whichCastMember).center the center of member whichCastMember Description Cast member property; interacts with the crop cast member property. • When the crop property is FALSE, the center property has no effect. • When crop is TRUE and center is TRUE, cropping occurs around the center of the digital video cast member. • When crop is TRUE and center is FALSE, the digital video’s right and bottom sides are cropped. This property can be tested and set.
Dot syntax: on beginSprite me if sprite(the spriteNum of me).member.centerRegPoint = TRUE then sprite(the spriteNum of me).member.
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).
The expressions must be integers that specify a character or range of characters in the chunk. Characters include letters, numbers, punctuation marks, spaces, and control characters such as Tab and Return. You can test but not set the char...of keyword. Use the put...into command to modify the characters in a string. Examples This statement displays the first character of the string $9.00: put ("$9.00").char[1..1] -- "$" This statement displays the entire string $9.00: put ("$9.00").char[1..5] -- "$9.
Values for charPosToLoc are in pixels from the top left corner of the field cast member. The nthCharacter parameter is 1 for the first character in the field, 2 for the second character, and so on.
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) end charToNum() Syntax (stringExpression).
checkBoxAccess Syntax the checkBoxAccess Description Movie property; specifies one of three possible results when the user clicks a check box or radio button created with button tools in the Tools window: • 0 (default)—Lets the user set check boxes and radio buttons on and off. • 1—Lets the user set check boxes and radio buttons on but not off. • 2—Prevents the user from setting check boxes and radio buttons at all; the buttons can be set only by scripts. This property can be tested and set.
checkMark Syntax the checkMark of menuItem whichItem of menu whichMenu Description Menu item property; determines whether a check mark appears next to the custom menu item (TRUE) or not (FALSE, default). The whichItem value can be either a menu item name or a menu item number. The whichMenu value can be either a menu name or a menu number. This property can be tested and set.
child (XML) Syntax XMLnode.child[ childNumber ] Description XML property; refers to the specified child node of a parsed XML document’s nested tag structure. Example Beginning with the following XML: element 2 element 3 here is some text This Lingo returns the name of the first child node of the preceding XML: put gParserObject.child[1].name -- "e1" chunkSize Syntax member(whichCastMember).
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 VOID individually.
Example This handler clears the cache when the movie starts: on startMovie clearCache end See also cacheDocVerify(), cacheSize() clearError Syntax member(whichFlashMember).clearError() clearError (member whichFlashMember) Description Flash command; resets the error state of a streaming Flash cast member to 0. When an error occurs while a cast member is streaming into memory, Director sets the cast member’s state property to -1 to indicate that an error occurred.
Example The following handler clears the content of each frame before it edits that frame during Score generation: on newScore beginRecording repeat with counter = 1 to 50 clearFrame the frameScript to 25 updateFrame end repeat endRecording end See also beginRecording, endRecording, updateFrame clearGlobals Syntax clearGlobals Description Command; sets all global variables to VOID.
clickLoc Syntax the clickLoc Description Function; identifies as a point the last place on the screen where the mouse was clicked. Example The following on mouseDown handler displays the last mouse click location: on mouseDown put the clickLoc end mouseDown If the click were 50 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) clickMode Syntax sprite(whichFlashSprite).
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).
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 cloneName and shares the parent of the model, group, light, or camera from which it was cloned.
cloneModelFromCastmember Syntax member(whichCastmember).cloneModelFromCastmember\ (newModelName, sourceModelName, sourceCastmember) Description 3D command; copies the model named sourceModelName from the cast member sourceCastmember, renames it newModelName, and inserts it into the cast member whichCastmember as a child of its 3D world. This command also copies the children of sourceModelName, as well as the model resources, shaders, and textures used by the model and its children.
closed Syntax member(whichCastMember).closed Description Vector shape cast member property; indicates whether the end points of a path are closed or open. Vector shapes must be closed in order to contain a fill. The value can be as follows: • • TRUE—the end points are closed. FALSE—the end points are open. close window Syntax window(windowIdentifier).close() close window windowIdentifier Description Window command; closes the window specified by windowIdentifier.
on closeWindow Syntax on closeWindow statement(s) end Description System message and event handler; contains statements that run when the user closes the window for a movie by clicking the window’s close box. The on closeWindow handler is a good place to put Lingo commands that you want executed every time the movie’s window closes.
collision (modifier) Syntax member(whichCastmember).model(whichModel).\ collision.collisionModifierProperty Description 3D modifier; manages the detection and resolution of collisions. Adding the collision modifier to a model by using the addModifier command allows access to the following collision modifier properties: enabled (collision) resolve indicates whether collisions with the model are detected. indicates whether collisions with the model are resolved.
Example This example has three parts. The first part is the first line of code, which registers the #putDetails handler for the #collideAny event. The second part is the #putDetails handler. When two models in the cast member MyScene collide, the #putDetails handler is called and the collisionData argument is sent to it. This handler displays the four properties of the collisionData object in the message window. The third part of the example shows the results from the message window.
Example This example has two parts. The first part is the first line of code, which registers the #explode handler for the #collideAny event. The second part is the #explode handler. When two models in the cast member named MyScene collide, the #explode handler is called and the collisionData argument is sent to it. The first ten lines of the #explode handler create the model resource SparkSource and set its properties. This model resource is a single burst of particles.
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) This statement obtains the hexadecimal representation of a color regardless of its type: someColorObj = color(#paletteIndex, 32) put someColorObj.
color (fog) Syntax member(whichCastmember).camera(whichCamera).fog.color sprite(whichSprite).camera{(index)}.fog.color Description 3D property; indicates the color introduced into the scene by the camera when the camera’s fog.enabled property is set to TRUE. The default setting for this property is rgb(0, 0, 0). Example This statement sets the color of the fog of the camera named BayView to rgb(255, 0, 0). If the camera’s fog.enabled property is set to TRUE, models in the fog will take on a red hue.
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 color(), bgColor, foreColor colorBufferDepth Syntax getRendererServices().
16 32,768 or 65,536 colors 32 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 colorDepth property refers to the monitor displaying the Stage. If the Stage spans more than one monitor, the colorDepth property indicates the greatest depth of those monitors; colorDepth tries to set all those monitors to the specified depth. This property can be tested and set.
This command must be set to a list of the same number of Lingo color values specified in the newMesh call. Example This statement shows that the third color in the colorList of the model resource Mesh2 is rgb(255, 0, 0). put member("shapes").modelResource("mesh2").colorlist[3] -- rgb(255,0,0) See also face, colors colorRange Syntax member(whichCastmember).modelResource(whichModelResource).\ colorRange.start member(whichCastmember).modelResource(whichModelResource).\ colorRange.
You must use the model resource’s build() command after setting this property; otherwise, the changes will not take effect. Example This example creates a model resource whose type is #mesh, specifies its properties, and then creates a new model with it. Line 1 uses the newMesh() command to create a #mesh model resource named Triangle, which has one face, three vertices, and a maximum of three colors. The number of normals and the number of texture coordinates are not set.
commandDown Syntax the commandDown Description Function; determines whether the Control key (Windows) or the Command key (Macintosh) is being pressed (TRUE) or not (FALSE). You can use commandDown together with the element the key to determine when the Control or Command key is pressed in combination with another key. This lets you create handlers that are executed when the user presses specified Control or Command key combinations.
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 (TRUE) or not (FALSE).
Examples These statements check the constrainH function for sprite 1 when it has left and right coordinates of 40 and 60: put constrainH(1, 20) -- 40 put constrainH(1, 55) -- 55 put constrainH(1, 100) -- 60 This statement constrains a moveable slider (sprite 1) to the edges of a gauge (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 constrainV(), constraint, left, right constraint Syntax sprite(whichSprite).
constrainV() Syntax constrainV (whichSprite, integerExpression) Description Function; evaluates integerExpression and then returns a value that depends on the vertical coordinates of the top and bottom edges of the sprite specified by whichSprite, as follows: • When the value is between the top and bottom coordinates, the value doesn’t change. • When the value is less than the top coordinate, the value changes to the value of the top coordinate.
Example This example determines whether a character passed to it is a digit: on isNumber aLetter digits = "1234567890" if digits contains aLetter then return TRUE else return FALSE end if end Note: The string comparison is not sensitive to case or diacritical marks; “a” and Å are treated the same. See also offset() (string function), starts continue This Lingo is obsolete. Use go to the frame +1.
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. The controller member property applies to a QuickTime digital video only.
You can include an optional property list of parameters in order to manipulate the pixels being copied before they are placed into the destinationRect. The property list may contain any or all of the following parameters: Property Use and Effect #color The foreground color to apply for colorization effects. The default color is black. #bgColor The background color to apply for colorization effects or background transparency. The default background color is white.
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. member("flower").image.copyPixels(member("Happy").
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).
To see an example of count() used in a completed movie, see the Text movie in the Learning/ Lingo Examples folder inside the Director application folder. Example This statement displays the number 3, the number of entries: put [10,20,30].count -- 3 See also globals count Syntax member(whichCastmember).light.count member(whichCastmember).camera.count member(whichCastmember).modelResource(whichModelResource).\ bone.count member(whichCastmember).model.count member(whichCastmember).group.
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. put member("Scene").model("Ear").meshdeform.mesh[1].
creaseAngle Syntax member(whichCastmember).model(whichModel).inker.creaseAngle member(whichCastmember).model(whichModel).toon.creaseAngle Description 3D inker and toon modifier property; indicates the sensitivity of the line drawing function of the modifier to the presence of creases in the model’s geometry. Higher settings result in more lines (detail) drawn at creases. The creases property of the modifier must be set to TRUE for the creaseAngle property to have an effect. CreaseAngle has a range of -1.
createMask() Syntax imageObject.createMask() Description This function creates and returns a mask object for use with the copyPixels() function. Mask objects aren’t image objects; they’re useful only with the copyPixels() function for duplicating the effect of mask sprite ink. To save 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.
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. This property can be tested and set.
crop() (member command) Syntax member(whichMember).crop(rectToCropTo) crop member whichMember, rectToCropTo Description Bitmap command; allows a bitmap cast member to be cropped to a specific size. You can use crop to trim existing cast members, or in conjunction with the picture of the Stage to grab a snapshot and then crop it to size for display. The registration point is kept in the same location so the bitmap does not move in relation to the original position.
cross Syntax vector1.cross(vector2) Description 3D vector method; returns a vector which is perpendicular to both vector1 and vector2. Example In this example, pos1 is a vector on the x axis and pos2 is a vector on the y axis. The value returned by pos1.cross(pos2) is vector( 0.0000, 0.0000, 1.00000e4 ), which is perpendicular to both pos1 and pos2. pos1 = vector(100, 0, 0) pos2 = vector(0, 100, 0) put pos1.cross(pos2) -- vector( 0.0000, 0.0000, 1.
Description System message and event handler; contains statements that run each time a sound or sprite passes a cue point in its media. • me—The optional me parameter is the scriptInstanceRef value of the script being invoked. You must include this parameter when using the message in a behavior. If this parameter is omitted, the other arguments will not be processed correctly. • channelID—The number of the sound or sprite channel for the file where the cue point occurred.
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.
currentSpriteNum Syntax the currentSpriteNum Description Movie property; indicates the channel number of the sprite whose script is currently running. It is valid in behaviors and cast member scripts. When used in frame scripts or movie scripts, the currentSpriteNum property’s value is 0. The currentSpriteNum property is similar to spriteNum reference. of me, but it doesn’t require the me This property can be tested but not set.
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 currentTime (3D) Syntax member(whichCastmember).model(whichModel).keyframePlayer.\ currentTime member(whichCastmember).model(whichModel).bonesPlayer.
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 currentTime property is set or changed, a seek action takes place, the stream rebuffers, and then playback resumes at the new time.
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. • Use the syntax cursor whichCursor to specify default system cursors.
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 whichSprite. This property stays in effect until you turn it off by setting the cursor to 0.
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; specifies the size of the animated color cursor cast member whichCursorCastMember.
curve Syntax member.curve[curveListIndex] Description This property contains the vertexList of an individual curve (shape) from a vector shape cast member. You can use the curve property along with the vertex property to get individual vertices of a specific curve in a vector shape.
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.) • On the Macintosh, you can customize the date display by using the Date and Time control panel.
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" && abs(yourBirthday - myBirthday) && "days between our birthdays.
on deactivateWindow Syntax on deactivateWindow statement(s) end Description System message and event handler; contains statements that run when the window that the movie is playing in is deactivated. The on deactivate event handler is a good place for Lingo that you want executed whenever a window is deactivated. Example This handler plays the sound Snore when the window that the movie is playing in is deactivated: on deactivateWindow puppetSound 2, "Snore" end debug Syntax member(whichCastmember).
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 fog.enabled property is set to TRUE.
Example This handler accepts a cast reference and a rectangle as parameters. It then searches the specified cast for Flash cast members and sets their defaultRect property to the specified rectangle. on setDefaultFlashRect whichCast, whichRect repeat with i = 1 to the number of members of castLib whichCast if member(i, whichCast).type = #flash then member(i, whichCast).
delay Syntax delay numberOfTicks Description Command; pauses the playhead for a given amount of time. The integer expression numberOfTicks specifies the number of ticks to wait, where each tick is 1/60 of a second. The only mouse and keyboard activity possible during this time is stopping the movie by pressing Control+Alt+period (Windows) or Command+period (Macintosh). Because it increases the time of individual frames, the delay command is useful for controlling the playback rate of a sequence of frames.
delete Syntax delete chunkExpression Description Command; deletes the specified chunk expression (character, word, item, or line) in any string container. Sources of strings include field cast members and variables that hold strings. To see an example of delete used in a completed movie, see the Text movie in the Learning/ Lingo Examples folder inside the Director application folder.
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 < theIndex then beep else theList.deleteAt(theIndex) end if end See also addAt deleteCamera Syntax member(whichCastmember).
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 if sprite(10).
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 newLight deleteModel Syntax member(whichCastmember).
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 newMotion(), removeLast() deleteOne Syntax list.
• For property lists, replace item with the name of the property to be deleted. Deleting a property also deletes its associated value. If the list has more than one of the same property, only the first property in the list is deleted. Example This statement deletes the color property from the list [#height:100, #width: 200, #color: 34, #ink: 15], which is called spriteAttributes: spriteAttributes.deleteProp(#color) The result is the list [#height:100, #width: 200, #ink: 15].
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 addVertex, moveVertex(), originMode, vertexList density Syntax member(whichCastmember).shader(whichShader).density member(whichCastmember).
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 1 Black and white 2 4 colors 4, 8 16 or 256 palette-based colors, or gray levels 16 Thousands of colors 32 Millions of colors This property can be tested but not set.
depthBufferDepth Syntax getRendererServices().depthBufferDepth Description 3D rendererServices property; indicates the precision of the hardware depth buffer of the user’s system. The value is either 16 or 24, depending on the user’s hardware settings. Example This statement shows that the depthBufferDepth value of the user’s video card is 16: put getRendererServices().
diffuse Syntax member(whichCastmember).shader(whichShader).diffuse member(whichCastmember).model(whichModel).shader.diffuse member(whichCastmember).model(whichModel).shaderList{[index]}.
diffuseLightMap Syntax member(whichCastmember).shader(whichShader).diffuseLightMap member(whichCastmember).model(whichModel).shader.diffuseLightMap member(whichCastmember).model(whichModel).shaderList{[index]}.\ diffuseLightMap Description 3D #standard shader property; specifies the texture to use for diffuse light mapping. 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.
digitalVideoType Syntax member(whichCastMember).digitalVideoType the digitalVideoType of member whichCastMember Description Cast member property; indicates the format of the specified digital video. Possible values are #quickTime or #videoForWindows. This property can be tested but 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").
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 directionalColor property of the cast member named Room to rgb(0, 255, 0). The default directional light of the cast member will be green. This property can also be set in the Property inspector. member("Room").
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 TRUE (1), the cast member plays in front of all other layers on the Stage, and ink effects have no affect.
displayFace Syntax member(whichTextCastmember).displayFace member(which3DCastmember).modelResource(whichModelResource).\ displayFace Description 3D text property; a linear list indicating which face or faces of the 3D text to display. Possible values include #front, #tunnel, and #back. You can show any combination of faces, and the list can be in any order. The default value of this property is [#front, #back, #tunnel]. For text cast members, this is a member property.
displayRealLogo Syntax sprite(whichSprite).displayRealLogo member(whichCastmember).displayRealLogo Description RealMedia sprite or cast member property; allows you to set or get whether the RealNetworks logo is displayed (TRUE) or not (FALSE). When set to TRUE, this property displays the RealNetworks logo in the RealMedia viewer at the beginning of the stream, when the video is stopped, or when the video is rewound. The default value of this property is TRUE (1).
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 or #linear. The default value is #linear. Example In this example, ThermoSystem is a model resource whose type is #particle.
The do command works with multiple-line strings as well as single lines. Example This statement performs the statement contained within quotation marks: do "beep 2" do commandList[3] doneParsing() Syntax parserObject.doneParsing() Description Function; returns 1 (TRUE) when the parser has completed parsing a document using parseURL(). The return value is 0 (FALSE) until the parsing is complete. See also parseURL() dot() Syntax vector1.
dotProduct() Syntax vector1.dotProduct(vector2) Description 3D vector method; returns the sum of the products of the x, y, and z components of two vectors. If both vectors are normalized, the dotproduct is the cosine of the angle between the two vectors.
The following handler tests for a double-click. When the user clicks the mouse, a repeat loop runs for the time set for a double-click (20 ticks in this case). If a second click occurs within 20 ticks, the doubleClickAction handler runs.
drag Syntax member(whichCastmember).modelResource(whichModelResource).drag Description 3D #particle model resource property; indicates the percentage of each particle’s velocity that is lost in each simulation step. This property has a range of 0 (no velocity lost) to 100 (all velocity lost and the particle stops moving). The default value is 0. Example In this example, ThermoSystem is a model resource whose type is #particle.
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(), setPixel() drawRect Syntax window windowName.drawRect the drawRect of window windowName Description Window property; identifies the rectangular coordinates of the Stage of the movie that appears in the window.
duplicate Syntax vectorReference.duplicate() transformReference.duplicate() Description 3D vector and transform method; returns a copy of the vector or transform. Example This statement creates a copy of the position of model 1 and stores it in the variable zz. zz = member("MyRoom").model[1].transform.position.
To see an example of duplicate() (list function) used in a completed movie, see the Vector Shapes movie in the Learning/Lingo Examples folder inside the Director application folder. Example This statement makes a copy of the list CustomersToday and assigns it to the variable CustomerRecord: CustomerRecord = CustomersToday.duplicate() duplicate() (image function) Syntax imageObject.duplicate() Description This function creates and returns a copy of the given imageObject.
duration Syntax member(whichCastMember).duration the duration of member whichCastMember Description Cast member property; determines the duration of the specified Shockwave Audio (SWA), transition, and QuickTime cast members. • When whichCastMember is a streaming sound file, this property indicates the duration of the sound. The duration property returns 0 until streaming begins. Setting preLoadTime to 1 second allows the bit rate to return the actual duration.
duration (3D) Syntax member(whichCastmember).motion(whichMotion).duration motionObjectReference.duration Description 3D property; lets you get the time in millisecond that it takes the motion specified in the whichMotion parameter to play to completion. This property is always greater than or equal to 0. Example This statement shows the length in milliseconds of the motion Kick. put member("GbMember").motion("Kick").duration -- 5100.
editable Syntax member(whichCastMember).editable the editable of member whichCastMember sprite(whichSprite).editable the editable of sprite whichSprite Description Cast member and sprite property; determines whether the specified field cast member can be edited on the Stage (TRUE) or not (FALSE). When the cast member property is set, the setting is applied to all sprites that contain the field. When the sprite property is set, only the specified sprite is affected.
editShortCutsEnabled Syntax the editShortCutsEnabled Description Movie property; determines whether cut, copy, and paste operations and their keyboard shortcuts function in the current movie. When set to TRUE, these text operations function. When set to FALSE, these operations are not allowed. This property can be tested and set. The default is TRUE for movies made in Director 8 and later, FALSE for movies made in versions of Director prior to Director 8.
The default value for this property is rgb(0, 0, 0). Example This statement sets the emissive property of the shader named Globe to rgb(255, Models using this shader will appear to be illuminated by a red light: 0, 0). member("MysteryWorld").shader("Globe").emissive = rgb(255, 0, 0) See also silhouettes emitter Syntax member(whichCastmember).modelResource(whichModelResource).\ emitter.numParticles member(whichCastmember).modelResource(whichModelResource).\ emitter.mode member(whichCastmember).
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; determines whether a movie interprets a mouse click with the Control key pressed on the Macintosh the same as a right mouse click in Windows (TRUE) or not (FALSE).
Example This handler enables or disables all the items in the specified menu. The argument theMenu specifies the menu; the argument Setting specifies TRUE or FALSE. For example, the calling statement ableMenu ("Special", FALSE) disables all the items in the Special menu.
enabled (sds) Syntax member(whichCastmember).model(whichModel).sds.enabled Description 3D sds modifier property; indicates whether the sds modifier attached to a model is used by the model. The default setting for this property is TRUE. An attempt to add the sds modifier to a model that already has the inker or toon modifier attached fails without an error message.
Example This handler uses the end case keyword to end the case statement: on keyDown case the key of "A": go to frame "Apple" of "B", "C" : puppetTransition 99 go to frame "Mango" otherwise beep end case end keyDown See also case endAngle Syntax member(whichCastmember).modelResource(whichModelResource).\ endAngle Description 3D #cylinder or #sphere model resource property; indicates how much of the sphere or cylinder is drawn.
endColor Syntax the endColor of member whichCastMember Description Vector shape cast member property; the ending color of a gradient shape’s fill specified as an RGB value. endColor is only with fillColor. valid when the fillMode is set to #gradient, and the starting color is set This property can be tested and set. To see an example of endColor used in a completed movie, see the Vector Shapes movie in the Learning/Lingo Examples folder inside the Director application folder.
Example When used in the following handler, the endRecording keyword ends the Score generation session: on animBall numberOfFrames beginRecording horizontal = 0 vertical = 100 repeat with i = 1 to numberOfFrames go to frame i sprite(20).member = member "Ball" sprite(20).locH = horizontal sprite(20).
endTellTarget() See tellTarget(). endTime Syntax sound(channelNum).endTime the endTime of sound channelNum Description This property is the specified end time of the currently playing, paused or queued sound. This is the time within the sound member when it will stop playing. It’s a floating-point value, allowing for measurement and control of sound playback to fractions of milliseconds. The default value is the normal end of the sound.
on enterFrame Syntax on enterFrame statement(s) end Description System message and event handler; contains statements that run each time the playhead enters the frame. Place on enterFrame handlers in behavior, frame, or movie scripts, as follows: • To assign the handler to an individual sprite, 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.
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. #runMode String containing “Author”, “Projector”, “Plugin”, or “Java Applet”.
This handler deletes cast members start through finish: on deleteMember start, finish repeat with i = start to finish member(i).erase() end repeat end on deleteMember See also new() error Syntax member(whichCastmember).model(whichModel).sds.error Description 3D #sds modifier property; indicates the percentage of error tolerated by the modifier when synthesizing geometric detail in models. This property works only when the modifier’s subdivision property is set to #adaptive.
Include only those behaviors in on EvalScript that you want users to control; for security reasons, don’t give complete access to behaviors. Note: If you place a return at the end of your EvalScript handler, the value returned can be used by JavaScript in the browser.
This property can be tested and set. Example The following frame script checks to see whether the buttons in a Flash movie sprite are currently enabled, and if so, sets eventPassMode to #passNotButton; if the buttons are disabled, the script sets eventPassMode to #passAlways. The effect of this script is the following: • Mouse events on nonbutton objects always pass to sprite scripts. • Mouse events on button objects are passed to sprite scripts when the buttons are disabled.
Place on exitFrame handlers in behavior, frame, or movie scripts, as follows: • To assign the handler to an individual sprite, put the handler in a behavior attached to the sprite. • To assign the handler to an individual frame, put the handler in the frame script. • To assign the handler to every frame unless explicitly instructed otherwise, put the handler in a movie script.
Assuming that exitLock is set to TRUE, nothing occurs automatically when the Control+period/ Q/W, Esc, or Command+period/Q/W keys are used. This handler checks keyboard input for keys to exit and takes the user to a custom quit sequence: on checkExit if the commandDown and (the key = ".
externalEvent Syntax externalEvent "string" Description Command; sends a string to the browser that the browser can interpret as a scripting language instruction, allowing a movie playing or a browser to communicate with the HTML page in which it is embedded. The string sent by externalEvent must be in a scripting language supported by the browser. This command works only for movies in browsers. To enable communication between an applet and a browser, use Java, JavaScript, or VBScript.
externalParamCount() Syntax externalParamCount() Description Function; returns the number of parameters that an HTML
externalParamValue() Syntax externalParamValue(n) Description Function; returns a specific value from the external parameter list in an HTML
extrude3D Syntax member(whichTextCastmember).extrude3D(member(which3dCastmember)) Description 3D command; creates a new #extruder model resource in the 3D cast member which3DCastmember from the text in whichTextCastmember. Note that this is not the same as using the 3D displayMode property of a text cast member. To create a model using extrude3D: 1 Create a new #extruder model resource in a 3D cast member: textResource = member("textMember").
Description 3D #mesh model resource and meshdeform modifier property. All model resources are meshes composed of triangles. Each triangle is a face. You can access the properties of the faces of model resources whose type is #mesh. Changes to any of these properties do not take effect until you call the build() command. Note: For detailed information about the following properties, see the individual property entries.
fadeIn() Syntax sound(channelNum).fadeIn({milliseconds}) fadeIn(sound(channelNum) {, milliseconds }) Description This function immediately sets the volume of sound channel channelNum to zero and then brings it back to the current volume over the given number of milliseconds. The default is 1000 milliseconds (1 second) value is given. The current pan setting is retained for the entire fade.
To see an example of fadeTo() used in a completed movie, see the Sound Control movie in the Learning/Lingo Examples folder inside the Director application folder. Example The following statement changes the volume of sound channel 4 to 150 over a period of 2 seconds. It can be a fade up or a fade down, depending on the original volume of sound channel 4 when the fade begins. sound(4).
field Syntax field whichField Description Keyword; refers to the field cast member specified by whichField. • When whichField is a string, it is used as the cast member name. • When whichField is an integer, it is used as the cast member number. Character strings and chunk expressions can be read from or placed in the field. The term field was used in earlier versions of Director and is maintained for backward compatibility. For new movies, use member to refer to field cast members.
The value of this property is meaningful only when the value of the camera’s projection property is set to #perspective. When the projection property is set to #orthographic, use the camera’s orthoHeight property to define the top and bottom of the projection plane. The default setting for this property is 30.0. Example This statement sets the fieldOfView property of camera 1 to 90: member("3d world").camera[1].fieldOfView = 90 See also orthoHeight fileName (cast property) Syntax castLib(whichCast).
fileName (cast member property) Syntax member(whichCastMember).fileName the fileName of member whichCastMember Description Cast member property; refers to the name of the file assigned to the linked cast member specified by whichCastMember. This property is useful for switching the external linked file assigned to a cast member while a movie plays, similar to the way you can switch cast members. When the linked file is in a different folder than the movie, you must include the file’s pathname.
The fileName of window property accepts URLs as a reference. However, to use a movie file from a URL and minimize the download time, use the downloadNetThing or preloadNetThing command to download the movie file to a local disk first and then set fileName window property to the file on the local disk. This property can be tested and set. Examples This statement assigns the file named Control Panel to the window named Tool Box: window("Tool Box").
The following statement draws a filled oval in the image object TestImage. The oval has a green fill and a 5-pixel-wide red border. TestImage.fill(0, 0, 100, 100, [#shapeType: #oval, #lineSize: 5, #color: rgb(0, 255, 0), \ #bgColor: rgb(255, 0, 0)]) See also color(), draw() fillColor Syntax member(whichCastMember).fillColor Description Vector shape cast member property; the color of the shape’s fill specified as an RGB value.
fillDirection Syntax member(whichCastMember).fillDirection Description Vector shape cast member property; specifies the amount in degrees to rotate the fill of the shape. This property is only valid when the fillMode property of the shape is set to #gradient. This property can be tested and set. To see an example of fillDirection used in a completed movie, see the Vector Shapes movie in the Learning/Lingo Examples folder inside the Director application folder.
Example This statement sets the fillMode of member Archie to gradient: member("Archie").fillMode = #gradient See also endColor, fillColor fillOffset Syntax member(whichCastMember).fillOffset Description Vector shape cast member property; specifies the horizontal and vertical amount in pixels (within the defaultRect space) to offset the fill of the shape. This property is only valid when the fillMode property of the shape is set to #gradient, but can be both tested and set.
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 sprite(whichFlashSprite).
findPosNear Syntax sortedList.findPosNear(valueOrProperty) findPosNear(sortedList, valueOrProperty) Description List command; for sorted lists only, identifies the position of the item specified by valueOrProperty in the specified sorted list. The findPosNear command works only with sorted lists. Replace valueOrProperty with a value for sorted linear lists, and with a property for sorted property lists.
firstIndent Syntax chunkExpression.firstIndent Description Text cast member property; contains the number of pixels the first indent in chunkExpression is offset from the left margin of the chunkExpression. The value is an integer: less than 0 indicates a hanging indent, 0 is no indention, and greater than 0 is a normal indention. This property can be tested and set. Example This statement sets the indent of the first line of member Desk to 0 pixels: member("Desk").
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: sprite(whichSprite).fixedRate = sprite(whichSprite).fixedRate + howMuch #slower: sprite(whichSprite).fixedRate = sprite(whichSprite).
This property can be tested but not set. Example This sprite script resizes a Flash movie sprite so that it is equal to the original size of its Flash movie cast member: on beginSprite me sprite(me.spriteNum).rect = sprite(me.spriteNum).member.FlashRect end See also defaultRect, defaultRectMode, state (Flash, SWA) flashToStage() Syntax sprite(whichFlashSprite).
Flat shading uses one color per face of the mesh. The color used for the face is the color of its first vertex. Flat shading is faster than Gouraud shading. Gouraud shading assigns a color to each vertex of a face and interpolates the colors across the face in a gradient. Gouraud shading requires more time and calculation, but creates a smoother surface. The default value for this property is FALSE. Example The following statement sets the flat property of the shader named Wall to TRUE.
float() Syntax (expression).float float (expression) Description Function; converts an expression to a floating-point number. The number of digits that follow the decimal point (for display purposes only, calculations are not affected) is set using the floatPrecision property. Examples This statement converts the integer 1 to the floating-point number 1: put (1).float -- 1.
floatPrecision Syntax the floatPrecision Description Movie property; rounds off the display of floating-point numbers to the number of decimal places specified. The value of floatPrecision must be an integer. The maximum value is 15 significant digits; the default value is 4. The floatPrecision property determines only the number of digits used to display floating-point numbers; it does not change the number of digits used to perform calculations.
fog Syntax member(whichCastmember).camera(whichCamera).fog.color sprite(whichSprite).camera{(index)}.fog.color member(whichCastmember).camera(whichCamera).fog.decayMode sprite(whichSprite).camera{(index)}.fog.decayMode member(whichCastmember).camera(whichCamera).fog.enabled sprite(whichSprite).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)}.
To see an example of font used in a completed movie, see the Text movie in the Learning/Lingo Examples folder inside the Director application folder. Example This statement sets the variable named oldFont to the current font setting for the field cast member Rokujo Speaks: oldFont = member("Rokujo Speaks").font See also text, alignment, fontSize, fontStyle, lineHeight (cast member property) fontSize Syntax member(whichCastMember).
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.
It is not recommended to apply this property to bitmap cast members deeper than 1-bit, as the results are difficult to predict. It is recommended that the newer color property be used instead of the foreColor property. Examples The hexadecimal value for pure red, FF0000, is equivalent to 16711680 in decimal numbers. This statement specifies pure red as a cast member’s forecolor: member(20).
forget Syntax window(whichWindow).forget() forget window whichWindow Description Window property; instructs Lingo to close and delete the window specified by whichWindow when it’s no longer in use and no other variables refer to it. When a forget window command is given, the window and the movie in a window (MIAW) disappear without calling the on stopMovie, on closeWindow, or on deactivateWindow handlers.
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. (This script assumes that the movie was designed to stop on its final frame and that it has not been set for looped playback.) on exitFrame if sprite(5).frame < sprite(5).member.
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. For the most reliable color when authoring a movie for playback as a Director player for Java, use the default palette for the authoring system.
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.
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 got to frame 1 end if end The following frame script checks to see if frame 25 of a Flash movie sprite in channel 5 can be rendered.
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: the frameSound1 = member("Jazz").
The resulting string uses the form sHH:MM:SS.FFD, where: s A character is used if the time is less than zero, or a space if the time is greater than or equal to zero. HH Hours. MM Minutes. SS Seconds. FF Indicates a fraction of a second if fractionalSeconds is TRUE or frames if fractionalSeconds is FALSE. D A "d" is used if dropFrame is TRUE, or a space if dropFrame is FALSE. Example The following statement converts a 2710-frame, 30 frame-per-second movie.
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. A megabyte (MB) is 1024 kilobytes. Loading a cast member requires a free block at least as large as the cast member.
front Syntax member(whichCastmember).modelResource(whichModelResource).front Description 3D #box model resource property; indicates whether the side of the box intersected by its -Z axis is sealed (TRUE) or open (FALSE). The default value for this property is TRUE. Example This statement sets the front property of the model resource named Crate to FALSE, meaning the front of this box will be open: member("3D World").modelResource("Crate").
If the style parameter is set to #flat, each vertex receives a normal for each face to which it belongs. Furthermore, all three of the vertices of a face will have the same normal. For example, if the vertices of face[1] all receive normal[1] and the vertices of face[2] all receive normal[2], and the two faces share vertex[8], then the normal of vertex[8] is normal[1] in face[1] and normal[2] in face[2]. Use of the #flat parameter results in very clear delineation of the faces of the mesh.
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. If you want the value at a certain position in the list, you can also use bracket access.
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.
on getBehaviorTooltip Syntax on getBehaviorTooltip statement(s) end Description System message and event handler; contains Lingo that returns the string that appears in a tooltip for a script in the Library palette. Director sends the getBehaviorTooltip message to the script when the cursor stops over it in the Library palette. Place the on getBehaviorTooltip handler within the behavior. The use of the handler is optional. If no handler is supplied, the cast member name appears in the tooltip.
Description Function; for Shockwave Audio (SWA) or Flash cast members, indicates whether an error occurred as the cast member streamed into memory and returns a value. Shockwave Audio cast members have the following possible getError() integer values and corresponding getErrorString() messages: getError() value getErrorString() message 0 OK 1 memory 2 network 3 playback device 99 other Flash movie cast members have the following possible getError values: • • • • • • FALSE—No error occurred.
The following handler checks to see whether an error occurred for a Flash cast member named Dali, which was streaming into memory. If an error occurred, and it was a memory error, the script uses the unloadCast command to try to free some memory; it then branches the playhead to a frame in the Director movie named Artists, where the Flash movie sprite first appears, so Director can again try to load and play the Flash movie.
Possible getError() integer values and corresponding getErrorString() messages are: getError() value getErrorString() message 0 OK 1 memory 2 network 3 playback device 99 other Example This handler uses getError() to determine whether an error occurred for Shockwave Audio cast member Norma Desmond Speaks, and if so, uses getErrorString to obtain the error message and assign it to a field cast member: on exitFrame if member("Norma Desmond Speaks").
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.
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.
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.
The function works with relative URLs. To see an example of getNetText() used in a completed movie, see the Forms and Post movie in the Learning/Lingo Examples folder inside the Director application folder. Examples This script retrieves text from the URL http://BigServer.com/sample.txt and updates the field cast member the mouse pointer is on when the mouse button is clicked: property spriteNum property theNetID on mouseUp me theNetID = getNetText ("http://BigServer.com/sample.
getNthFileNameInFolder() Syntax getNthFileNameInFolder(folderPath, fileNumber) Description Function; returns a filename from the directory folder based on the specified path and number within the folder. To be found by the getNthFileNameInFolder function, Director movies must be set to visible in the folder structure. (On the Macintosh, other types of files are found whether they are visible or invisible.
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. See also getPos() getPixel() Syntax imageObject.
getPlaylist() Syntax sound(channelNum).getPlaylist() getPlaylist(sound(channelNum)) Description This function returns a copy of the list of queued sounds for soundObject. This list does not include the currently playing sound. The list of queued sounds may not be edited directly. You must use setPlayList(). The playlist is a linear list of property lists. Each property list corresponds to one queued sound cast member.
getPos() Syntax list.getPos(value) getPos(list, value) Description List function; identifies the position of the value specified by value in the list specified by list. When the specified value is not in the list, the getPos command returns the value 0. For values contained in the list more than once, only the first occurrence is displayed. This command performs the same function as the getOne command when used for linear lists.
getProp() Syntax getProp(list, property) list.property Description Property list function; identifies the value associated with the property specified by property in the property list specified by list. Almost identical to the getaProp command, the getProp command displays an error message if the specified property is not in the list or if you specify a linear list.
The on getPropertyDescriptionList message is sent when any action that causes the Behavior Inspector to open occurs: either when the user drags a behavior to the Score or the user double-clicks a behavior in the Behavior Inspector. The #default, #format, and #comment settings are mandatory for each parameter. The following are possible values for these settings: #default The parameter’s initial setting.
• textureRenderFormat indicates the pixel format used by the renderer. Possible values include #rgba8888, #rgba8880, #rgba5650, #rgba5550, #rgba5551, and #rgba4444. The four digits in each symbol indicate how many bits are used for each red, green, blue, and alpha component. • • depthBufferDepth indicates the bit depth of the hardware output buffer. colorBufferDepth indicates the bit depth of the color buffer. This property can be tested but not set.
getVariable() Syntax sprite(flashSpriteNum).getVariable("variableName" {, returnValueOrReference}) getVariable(sprite flashSpriteNum, "variableName" {, returnValueOrReference}) Description Function; returns the current value of the given variable from the specified Flash sprite. Flash variables were introduced in Flash version 4. This function can be used in two ways. Setting the optional returnValueOrReference parameter to TRUE (the default) returns the current value of the variable as a string.
The transform property of a node is calculated relative to the transform of the node’s parent, and is therefore parent-relative. The getWorldTransform() command calculates the node’s transform relative to the origin of the 3D world, and is therefore world-relative. Use member(whichCastmember).node(whichNode).getWorldTransform(). position to find the position property of the node’s world-relative transform. You can also use worldPosition as a shortcut for getWorldTransform().position.
Shockwave movies playing on the Internet cannot access global variables within other movies, even movies playing on the same HTML page. The only way movies can share global variables is if an embedded movie navigates to another movie and replaces itself through either goToNetMovie or go movie. Example The following example sets the global variable StartingPoint to an initial value of 1 if it doesn’t already contain a value. This allows navigation to and from the movie without loss of stored data.
When you set this property, the following properties are automatically set: • The fourth texture layer of the shader is set to the texture you specified. • The value of textureModeList[4] is set to #none. • The value of blendFunctionList[4] is set to #multiply. Example This statement sets the texture named Oval as the glossMap value for the shader used by the model named GlassBox: member("3DPlanet").model("GlassBox").shader.glossMap = \ member("3DPlanet").
The phrase go loop tells the playhead to loop to the previous marker and is a convenient means of keeping the playhead in the same section of the movie while Lingo remains active and avoids the use of go to the frame in a frame that has a transition which would slow the movie and overwhelm the processor. It is best to refer to marker labels instead of frame numbers; editing a movie can cause frame numbers to change. Using marker labels also makes it easier to read scripts.
If no markers are to the left of the playhead, the playhead branches to: • The next marker to the right if the current frame does not have a marker. • The current frame if the current frame has a marker. • Frame 1 if the movie contains no markers. The go loop command is equivalent to the statement go versions of Lingo.
Example This statement sends the playhead to the previous marker in the movie: go previous See also go, go next, go loop goToFrame Syntax sprite(whichFlashSprite).goToFrame(frameNumber) goToFrame(sprite whichFlashSprite, frameNumber) sprite(whichFlashSprite).goToFrame(labelNameString) goToFrame(sprite whichFlashSprite, labelNameString) Description Command; plays a Flash movie sprite beginning at the frame identified by the frameNumber parameter.
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, gotoNetMovie is used as a function. The function returns the network ID for the operation. myNetID = gotoNetMovie ("http://www.yourserver.com/movies/ buttons.
gradientType Syntax member(whichCastMember).gradientType Description Vector shape cast member property; specifies the actual gradient used in the cast member’s fill. Possible values are #linear or #radial. The gradientType is only valid when the fillMode is set to #gradient. This property can be tested and set. Example This handler toggles between linear and radial gradients in cast member "backdrop": on mouseUp me if member("backdrop").gradientType = #radial then member("backdrop").
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 < 50*1024 then halt See also abort, exit, pass, quit handler() Syntax scriptObject.
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).
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. put member("scene").texture("Marsmap").
Example The following statement sets the highlightPercentage property of the toon modifier for the model named Sphere to 50. Half of the colors available to the toon modifier for this model will be used for the highlight area of the model’s surface. member("shapes").model("Sphere").toon.highlightPercentage = 50 See also highlightStrength, brightness highlightStrength Syntax member(whichCastmember).model(whichModel).toon.highlightStrength member(whichCastmember).model(whichModel).shader.
hilite (cast member property) Syntax member(whichCastMember).hilite the hilite of member whichCastMember Description Cast member property; determines whether a check box or radio button created with the button tool is selected (TRUE) or not (FALSE, default). If whichCastMember is a string, it specifies the cast member whichCastMember specifies the cast member number. name. If it is an integer, This property can be tested and set.
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." updateStage else member("Message Line").text = "" end if go the frame end hither Syntax member(whichCastmember).camera(whichCamera).hither sprite(whichSprite).camera{(index)}.
• hms—String expression that specifies the time in the form sHH:MM:SS.FFD, where: s A character is used if the time is less than zero, or a space if the time is greater than or equal to zero. HH Hours. MM Minutes. SS Seconds. FF Indicates a fraction of a second if fractionalSeconds is TRUE or frames if fractionalSeconds is FALSE. D A d is used if dropFrame is TRUE, or a space if dropFrame is FALSE.
Example This frame script holds the Flash movie sprites playing in channels 5 through 10 while allowing the audio for these channels to continue playing: on enterFrame repeat with i = 5 to 10 sprite(i).hold() end repeat end See also movieRate, pause (movie playback) hotSpot Syntax member(whichCursorCastMember).
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. The message has two arguments: the me parameter and the ID of the hot spot that the cursor entered. To clear the callback, set this property to 0.
Example The following handler creates a hyperlink in the first word of text cast member “MacroLink”. The text is linked to Macromedia’s website. on startMovie member("MacroLink").word[1].hyperlink = \ "http://www.macromedia.com" end See also hyperlinkRange, hyperlinkState on hyperlinkClicked Syntax on hyperlinkClicked me, data, range statement(s) end Description System message and event handler; used to determine when a hyperlink is actually clicked.
This property can be tested but not set. Like hyperLink and hyperLinkState, the returned range of the link contains the first character of chunkExpression. See also hyperlink, hyperlinkState hyperlinks Syntax chunkExpression.hyperlinks Description Text cast member property; returns a linear list containing all the hyperlink ranges for the specified chunk of a text cast member.
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.
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 idle message. The default value is 1, which tells the movie to send idle handler messages no more than 60 times per second.
idleLoadDone() Syntax idleLoadDone(loadTag) Description Function; reports whether all cast members with the given tag have been loaded (TRUE) or are still waiting to be loaded (FALSE).
idleLoadPeriod Syntax the idleLoadPeriod Description System property; determines the number of ticks that Director waits before trying to load cast members waiting to be loaded. The default value for idleLoadPeriod is 0, which instructs Director to service the load queue as frequently as possible.
if Syntax if logicalExpression then statement if logicalExpression then statement else statement end if if logicalExpression then statement(s) end if if logicalExpression then statement(s) else statement(s) end if if logicalExpression1 then statement(s) else if logicalExpression2 then statement(s) else if logicalExpression3 then statement(s) end if if logicalExpression1 then statement(s) else logicalExpression2 end if Description Keyword; if...
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.
These Lingo statements set ignoreWhiteSpace() to FALSE and then parse the given XML into a list. Note that the element now has a child containing one space character. XMLtext = " " parserObj.ignorewhitespace(FALSE) parserObj.parseString(XMLtext) theList = parserObj.
Type of Object ilk(Object) returns ilk(Object, Type) returns 1 only if Type = Example 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 #symbol #symbol ilk (#hello) void #void #void ilk (void) picture #picture #picture ilk (member (2).
The following example tests a variable named myVariable and verifies that it is a date object before displaying it in the Message window: myVariable = the systemDate if ilk(myVariable, #date) then put myVariable -- date( 1999, 2, 19 ) ilk (3D) Syntax ilk(object) ilk(object,type) object.ilk object.ilk(type) Description Lingo function; indicates the type of an object. • The syntax ilk(object) and object.ilk return a value indicating the type of object.
Examples This statement shows that MyObject is a motion object: put MyObject.ilk -- #motion The following statement tests whether MyObject is a motion object. The return value of 1 shows that it is. put MyObject.ilk(#motion) -- 1 See also tweenMode image Syntax whichMember.image (the stage).image window(windowName).image Description This property refers to the image object of a bitmap or text cast member, of the Stage, or of a window.
image() Syntax image(width, height, bitDepth {, alphaDepth} {, paletteSymbolOrMember}) Description Function; creates and returns a new image object of the dimensions specified by width, height, and bitDepth, with optional alphaDepth and paletteObject values. The bitDepth can be 1, 2, 4, 8, 16, or 32. The alphaDepth, if given, is used only for 32-bit images and must be 0 or 8.
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. Finally, the sphere is rotated by 1° around the y-axis. The result is a #realMedia video playing on a rotating sphere. on updateShader if member("Real").state = 4 then sphereShader = member("3d").
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 (TRUE, default) or invisible (FALSE). This property can be tested and set.
This property is settable only during authoring and only affects cast members when saving a movie in Shockwave format. The compressed image can be previewed via the Optimize in Fireworks button in the Property inspector’s Bitmap tab or the Preview in Browser command in the File menu. If an image cast member’s imageCompression property is set to #MovieSetting, the movie property movieImageQuality is used instead of imageQuality.
• When downloading files from the Internet, use it to download the file at a specific URL and set the filename of linked media. (However, to import a file from a URL, it’s usually more efficient and minimizes downloading to use the preloadNetThing command to download the file to a local disk first and then import the file from the local disk.) • Use it to import both RTF and HTML documents into text cast members with formatting and links intact.
inflate Syntax rectangle.Inflate(widthChange, heightChange) inflate (rectangle, widthChange, heightChange) Description Command; changes the dimensions of the rectangle specified by rectangle relative to the center of the rectangle, either horizontally (widthChange) or vertically (heightChange). 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.
For a movie that plays back as an applet, valid values for the ink sprite property vary for different sprites, as follows: • For bitmap sprites, the ink sprite property can be 0 (Copy), 8 (Matte), 32 (Blend), or 36 (Background transparent). • For vector shape, Flash, and shape sprites, the ink sprite property can be 0, 8, or 36. • For field sprites, the ink sprite property can be 0 or 36. The player treats Blend and Matte inks as Background transparent.
The #inker modifier has the following properties: • • • • • • • lineColor allows you to get or set the color of lines drawn by the inker. silhouettes allows you to get or set whether lines are drawn to define the edges along the border of a model, outlining its shape. creases allows you to get or set whether lines are drawn in creases. creaseAngle boundary allows you to get or set the sensitivity of crease angle detection for the inker.
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 duplicateFrame command. Example The following handler generates a frame that has the transition cast member Fog assigned in the transition channel followed by a set of empty frames.
inside() Syntax point.inside(rectangle) inside(point, rectangle) Description Function; indicates whether the point specified by point is within the rectangle specified by rectangle (TRUE), or outside the rectangle (FALSE). Example This statement indicates whether the point Center is within the rectangle Zone and displays the result in the Message window: put Center.
integer() Syntax (numericExpression).integer integer(numericExpression) Description Function; rounds the value of numericExpression to the nearest whole integer. You can force an integer to be a string by using the string() function. Examples This statement rounds off the number 3.75 to the nearest whole integer: put integer(3.75) -- 4 The following statement rounds off the value in parentheses. This provides a usable value for the locH sprite property, which requires an integer: sprite(1).
interface() Syntax xtra("XtraName").interface() interface(xtra "XtraName") Description Function; returns a Return-delimited string that describes the Xtra and lists its methods. This function replaces the now obsolete mMessageList function. Example This statement displays the output from the function used in the QuickTime Asset Xtra in the Message window: put Xtra("QuickTimeSupport").interface() interpolate() Syntax transform1.
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) See also interpolate() intersect() Syntax rectangle1.
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.
invertMask Syntax member(whichQuickTimeMember).invertMask the invertMask of member whichQuickTimeMember Description QuickTime cast member property; determines whether Director draws QuickTime movies in the white pixels of the movie’s mask (TRUE) or in the black pixels (FALSE, default). This property can be tested and set. Example This handler reverses the current setting of the invertMask property of a QuickTime movie named Starburst: on toggleMask member("Starburst").
isInWorld() Syntax member(whichCastmember).model(whichModel).isInWorld() member(whichCastmember).camera(whichCamera).isInWorld() member(whichCastmember).light(whichLight).isInWorld() member(whichCastmember).group(whichGroup).isInWorld() Description 3D command; returns a value of TRUE if the parent hierarchy of the model, camera, light, or group terminates in the world. If the value of isInWorld is TRUE, the model, camera, light, or group functions in the 3D world of the cast member.
Example This statement checks the sprite type the behavior is being attached to and returns TRUE for any graphic sprite except a shape and FALSE for the script channel: on isOKToAttach me, aSpriteType, aSpriteNum case aSpriteType of #graphic: -- any graphic sprite type return sprite(aSpriteNum).member.type <> #shape -- works for everything but shape cast members #script: --the frame script channel return FALSE -- doesn’t work as a frame script end case end isPastCuePoint() Syntax sprite(spriteNum).
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." else member("field 2").text = "This is the end of the piece." end if isVRMovie Syntax member(whichCastMember).
The terms whichItem, firstItem, and lastItem must be integers or integer expressions that refer to the position of items in the chunk. Chunk expressions refer to any character, word, item, or line in any source of strings. Sources of strings include field and text cast members and variables that hold strings. When the number that specifies the last item is greater than the item’s position in the chunk expression, the actual last item is specified instead.
Example The following handler finds the last component in a Macintosh pathname. The handler first records the current delimiter and then changes the delimiter to a colon (:). When a colon is the delimiter, Lingo can use the last item of to determine the last item in the chunk that makes up a Macintosh pathname. Before exiting, the delimiter is reset to its original value.
You can use the key in handlers that perform certain actions when the user presses specific keys as shortcuts and other forms of interactivity. When used in a primary event handler, the actions you specify are the first to be executed. Note: The value of the key isn’t updated if the user presses a key while Lingo is in a repeat loop. Use the sample movie Keyboard Lingo to test which characters correspond to different keys on different keyboards.
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 keyCode function to detect when the user has pressed an arrow or function key, which cannot be specified by the key function.
on keyDown Syntax on keyDown statement(s) end Description System message and event handler; contains statements that run when a key is pressed. When a key is pressed, Director searches these locations, in order, for an on keyDown handler: primary event handler, editable field sprite script, field cast member script, frame script, and movie script. For sprites and cast members, on keyDown handlers work only for editable text and field members.
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 keyDownScript property is defined, Lingo executes the instructions specified for the keyDownScript property first.
Adding the keyframePlayer modifier to a model by using the addModifier command allows access to the following keyframePlayer modifier properties: • • playing • • currentTime indicates the local time, in milliseconds, of the currently playing or paused motion. • • • • playlist.count indicates whether a model is executing a motion. is a linear list of property lists containing the playback parameters of the motions that are queued for a model.
keyPressed() Syntax the keyPressed keyPressed (keyCode) keyPressed (asciiCharacterString) Description Function; returns the character assigned to the key that was last pressed if no argument is used. The result is in the form of a string. When no key has been pressed, the keyPressed is an empty string. If an argument is used, either a keyCode or the ASCII string for the key being pressed may be used.
When a key is released, Lingo searches these locations, in order, for an on keyUp handler: primary event handler, editable field sprite script, field cast member script, frame script, and movie script. For sprites and cast members, on keyUp handlers work only for editable strings. A keyUp event on a different type of cast member, such as a bitmap, has no effect. If releasing a key should always have the same response throughout the movie, set keyUpScript.
When the instructions you’ve specified for the keyUpScript property are no longer appropriate, turn them off by using the statement set the keyUpScript to empty. Examples The following statement sets keyUpScript to if the key = RETURN then go the frame When this statement is in effect, the movie always goes to the next frame whenever the user presses the Return key. + 1.
This handler determines the label that starts the current scene: on findLastLabel aa = label(0) repeat with i = 1 to (the labelList.line.count - 1) if aa = label(the labelList.line[i]) then return the labelList.line[i] end if end repeat end See also frameLabel, label(), marker() last() Syntax the last chunk of ( chunkExpression ) the last chunk in (chunkExpression) Description Function; identifies the last chunk specified by chunk in the chunk expression specified by chunkExpression.
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.
Example This statement checks whether 10 seconds have passed since the last mouse click, rollover, or key press and, if so, sends the playhead to the marker Help: if the lastEvent > 10 * 60 then go to "Help" See also lastClick(), lastKey, lastRoll, startTimer lastFrame Syntax the lastFrame Description Movie property; displays the number of the last frame in the movie. This property can be tested but not set.
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. This property can be tested and set.
leftIndent Syntax chunkExpression.leftIndent Description Text cast member property; contains the number of pixels the left margin of chunkExpression is offset from the left side of the text cast member. The value is an integer greater than or equal to 0. This property can be tested and set. Example This line indents the first line of text cast member “theStory” by ten pixels: member("theStory").line[1].leftIndent = 10 See also firstIndent, rightIndent length() Syntax string.
The length of a box is measured along its Z axis. The default length of a box is 50. The length of a plane is measured along its Y axis. The default length of a plane is 1. The length of a vector is its distance in world units from vector(0, the magnitude of the vector. 0, 0). This is the same as Example This statement sets the variable myBoxLength to the length of the model resource named GiftBox. myBoxLength = member("3D World").modelResource("GiftBox").
Example The following statement sets the level property of the lod modifier of the model Spaceship to 50. If the lod modifier’s auto property is set to FALSE, Spaceship will be drawn at a medium level of detail. If the lod modifier’s auto property is set to TRUE, this code will have no effect. member("3D World").model("Spaceship").lod.level = 50 See also lod (modifier), auto, bias lifetime Syntax member(whichCastmember).modelResource(modelResource).
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 whichLine, firstLine, and lastLine must be integers that specify a line in the chunk.
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 numberOfLines: numberOfLines = member("Today’s News").
lineHeight (cast member property) Syntax member(whichCastMember).lineHeight the lineHeight of member whichCastMember Description Cast member property; determines the line spacing used to display the specified field cast member. The parameter whichCastMember can be either a cast member name or number. Setting the lineHeight member property temporarily overrides the system’s setting until the movie closes.
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 Syntax member(whichCastMember).lineSize the lineSize of member whichCastMember sprite whichSprite.
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 (TRUE, default), or inside the Director cast (FALSE).
listP() Syntax listP(item) Description Function; indicates whether the item specified by item is a list, rectangle, or point (1 or not (0 or FALSE). TRUE) or Example This statement checks whether the list in the variable designers is a list, rectangle, or point, and displays the result in the Message window: put listP(designers) The result is 1, which is the numerical equivalent of TRUE. See also ilk(), objectP() loaded Syntax member(whichCastMember).
Description 3D cast member command; imports the assets of the W3D file, fileName, into the cast member. The optional overwrite parameter indicates whether the assets of the W3D file replace the assets of the cast member (TRUE) or are added to the assets of the cast member (FALSE). The default value of overwrite is TRUE. If the optional generateUniqueNames parameter is set to TRUE, any element in the W3D file with the same name as a corresponding element in the cast member is renamed.
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.
Description Function; returns a number that identifies which character in the specified field cast member is closest to the point within the field specified by location. The value for location is a point relative to the upper left corner of the field cast member. The value 1 corresponds to the first character in the string, the value 2 corresponds to the second character in the string, and so on.
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.
This property can have an integer value from negative 2 billion to positive 2 billion. Larger numbers cause the sprite to appear in front of sprites with smaller numbers. If two sprites have the same locZ value, the channel number then takes precedence for deciding the final display order of those two sprites. This means sprites in lower numbered channels appear behind sprites in higher numbered channels even when the locZ values are equal.
The lod modifier has the following properties: • auto • bias • level indicates the amount of detail reduction there will be when the modifier’s auto property is set to FALSE. The range of this property is 0.0 to 100.00. allows the modifier to set the level of detail reduction as the distance between the model and the camera changes. The value of the modifier’s level property is updated, but setting the level property will have no effect when the auto property is set to TRUE.
Example This statement sets the loop property of the cast member named Walkers to TRUE. Motions being executed by the first model in Walker will repeat continuously. member("Walkers").loop = TRUE See also motion, play() (3D), queue() (3D), animationEnabled loop (emitter) Syntax member(whichCastmember).modelResource(whichModelResource).\ emitter.
Description Cast member property; determines whether the specified digital video, sound, or Flash movie cast member is set to loop (TRUE) or not (FALSE). Example This statement sets the QuickTime movie cast member Demo to loop: member("Demo").loop = 1 loop (Flash property) Syntax sprite(whichFlashSprite).loop the loop of sprite whichFlashSprite member (whichFlashMember).
The loopBounds property has no effect if the movie’s loop property is set to FALSE. If the loop property is set to TRUE while the movie is playing, the movie continues to play. Director uses these rules to decide how to loop the movie: • If the ending time specified by loopBounds is reached, the movie loops back to the starting time. • If the end of the movie is reached, the movie loops back to the start of the movie.
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." end See also breakLoop(), setPlaylist(), loopEndTime, loopsRemaining, loopStartTime, queue() loopEndTime Syntax sound(channelNum).
loopsRemaining Syntax sound(channelNum).loopsRemaining the loopsRemaining of sound(channelNum) Description Read-only property; the number of times left to play a loop in the current sound playing in sound channel channelNum. If the sound had no loop specified when it was queued, this property is 0. If this property is tested immediately after a sound starts playing, it returns one less than the number of loops defined with the #loopCount property in the queue() or setPlayList() command.
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, equals 0.) 0) Example This statement shows that the magnitude of MyVec1 is 100.0000 and the magnitude of MyVec2 is 141.4214. MyVec1 = vector(100, 0, 0) put MyVec1.magnitude -- 100.0000 MyVec2 = vector(100, 100, 0) put MyVec2.magnitude -- 141.
makeSubList() Syntax XMLnode.makeSubList() Description Function; returns a property list from a child node the same way that makeList() returns the root of an XML document in list format. Example Beginning with the following XML: element 2 element 3 This statement returns a property list made from the contents of the first child of the tag : put gparser.child[ 1 ].child[ 1 ].
map (3D) Syntax member(whichCastmember).motion(whichMotion).\ map(whichOtherMotion {, boneName}) Description 3D motion command; maps the motion specified by whichOtherMotion into the current motion (whichMotion), and applies it to the bone specified by boneName and all of the children of that bone. This command replaces any motion previously mapped to the specified bone and its children. This command does not change a model’s playlist. The boneName parameter defaults to the root bone if not specified.
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 quad, or the rectangle if not transformed.
If the argument for marker is a string, marker returns the frame number of the first frame whose marker label matches the string. Examples The following statement sends the playhead to the beginning of the current frame if the current frame has a marker; otherwise, it sends the playhead to the previous marker.
For best results, set a QuickTime cast member’s mask property before any of its sprites appear on the Stage in the on beginSprite event handler. Setting or changing the mask property while the cast member is on the Stage can have unpredictable results (for example, the mask may appear as a freeze frame of the digital video at the moment the mask property took effect). Masking is an advanced feature; you may need to experiment to achieve your goal. This property can be tested and set.
Example This statement generates a table, in the Message window, of the maximum decimal value that can be represented by a certain number of binary digits: on showMaxValues b = 31 v = the maxInteger repeat while v > 0 put b && "-" && v b = b-1 v = v/2 end repeat end maxSpeed Syntax member(whichCastmember).modelResource(whichModelResource).\ emitter.
me Syntax me Description Special variable; used within parent scripts and behaviors to refer to the current object that is an instance of the parent script or the behavior or a variable that contains the memory address of the object. The term has no predefined meaning in Lingo. The term me is used by convention. To see an example of me used in a completed movie, see the Parent Scripts movie in the Learning/ Lingo Examples folder inside the Director application folder.
media Syntax member(whichCastMember).media the media of member whichCastMember Description Cast member property; identifies the specified cast member as a set of numbers. Because setting the media member property can use large amounts of memory, this property is best used during authoring only. You can use the media member property to copy the content of one cast member into another cast member by setting the second cast member’s media value to the media value for the first cast member.
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 RealMedia sprite or cast member property; allows you to get a symbol representing the state of the RealMedia stream.
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 #fromCastMember, this property indicates the cast member that is used as the source for a texture. This property can be tested and set.
Examples The following statement sets the hilite property of the button cast member named Enter Bid to TRUE: member("Enter Bid").hilite = TRUE This statement puts the name of sound cast member 132 into the variable soundName: put member(132, "Viva Las Vegas").name This statement checks the 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: if member(9).
The member sprite property differs from the memberNum sprite property, which specifies only the sprite’s number to identify its location in the cast but doesn’t specify the cast itself. The member sprite property also differs from mouseMember and the obsolete castNum sprite properties, neither of which specifies the sprite’s cast. When assigning a sprite’s member property, use one of the following formats: • Specify the full member and cast description (sprite(x).member = member(A, B) .
memberNum Syntax sprite(whichSprite).memberNum the memberNum of sprite whichSprite Description Sprite property; identifies the position of the cast member (but doesn’t identify the castLib) associated with the specified sprite whichSprite. Its value is the cast member number only; the cast member’s cast is not specified. The memberNum property is useful for switching cast members assigned to a sprite so long as the cast members are within the same cast.
members See number of members memorySize Syntax the memorySize Description System property; returns the total amount of memory allocated to the program, whether in use or free memory. This property is useful for checking minimum memory requirements. The value is given in bytes. In Windows, the value is the total physical memory available; on the Macintosh, the value is the entire partition assigned to the application.
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. Using
mesh (property) Syntax member(whichCastmember).model(whichModel).\ meshdeform.mesh[index].meshProperty Description 3D command; allows access to the mesh properties of models that have the meshDeform modifier attached. When used as mesh.count this command returns the total number of meshes within the referenced model. The properties of each mesh that are accessible are as follows: • • • • • colorList allows you to get or set the list of colors used by the specified mesh.
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.
This handler counts the milliseconds and posts an alert if you’ve been working too long: on idle if the milliseconds > 1000 * 60 * 60 * 4 then alert "Take a break" end if end See also ticks, time(), timer min Syntax list.min min(list) min (a1, a2, a3...) Description Function; specifies the minimum value in the list specified by list. Example The following handler assigns the variable vLowest the minimum value in the list bids, which consists of [#Castle:600, #Shields:750, #Wang:230].
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.
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] go the frame end modal Syntax window "window".
This property can have the value #burst or #stream (default). A mode value of #burst causes all particles to be emitted at the same time, while a value of #stream causes a group of particles to be emitted at each frame. The number of particles emitted in each frame is determined using the following equation: particlesPerFrame = resourceObject.emitter.numParticles \ (resourceObject.lifetime x millisecondsPerRenderedFrame) Example In this example, ThermoSystem is a model resource of the type #particle.
Description 3D command; returns the model found within the referenced cast member that has the name specified by whichModel, or is found at the index position specified by index. If no model exists for the specified parameter, the command returns void. As model.count, the command returns the number of models found within the referenced cast member. This command also allows access to the specified model’s properties. Model name comparisons are not case-sensitive.
Example This example has three parts. The first part is the first line of code, which registers the #putDetails handler for the #collideAny event. The second part is the #putDetails handler. When two models in the cast member named MyScene collide, the #putDetails handler is called and the collisionData argument is sent to it. This handler displays the modelA and modelB properties of the collisionData object in the message window. The third part of the example shows the results from the message window.
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 whichModelResource, or is found at the index position specified by the index parameter.
#detailed returns a list of property lists, each representing an intersected model. Each property list will have the following properties: • • • • • #model is a reference to the intersected model object. #distance is the distance from the camera to the point of intersection with the model. #isectPosition #isectNormal is a vector representing the world space position of the point of intersection. is the world space normal vector to the mesh at the point of intersection.
The optional levelOfDetail parameter allows you to specify the level of detail of the information returned. The levelOfDetail parameter can have the following values: #simple returns a list containing references to the models found under the point. This is the default setting. #detailed returns a list of property lists, each representing an intersected model. Each property list will have the following properties: • • #model • • • #isectPosition is a reference to the intersected model object.
modelUnderLoc Syntax member(whichCastmember).camera(whichCamera).\ modelUnderLoc(pointWithinSprite) Description 3D command; returns a reference to the first model found under the point specified by pointWithinSprite within the rect of a sprite using the referenced camera. The location pointWithinSprite is relative to the upper left corner of the sprite, in pixels. This command returns void if there is no model found under the specified point.
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. It is useful for tracking and coordinating Director projects with more than one author, and may also be viewed in the Property inspector’s Member tab.
Note that if both the toon and inker modifiers are applied to a model, only the first one that was added to the model is returned. This property can be tested but not set. Use the addModifier and removeModifier commands to add and remove modifiers from models. Example This statement shows which modifiers are attached to the model named Juggler: put member("ParkScene").model("Juggler").
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. The value is the cue point’s ordinal number.
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. The property’s value can be #minQuality, #maxQuality, or #normalQuality. This property can be tested and set.
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’ and ’mouseChar’ are for fields." end See also mouseItem, mouseLine, mouseWord, char...
Examples This handler checks whether the user clicks anywhere on the Stage and sends the playhead to another frame if a click occurs: on mouseDown if the clickOn = 0 then go to frame "AddSum" end This handler, assigned to a sprite script, plays a sound when the sprite is clicked: on mouseDown puppetSound "Crickets" end See also clickOn, mouseDownScript, mouseUpScript the mouseDown (system property) Syntax the mouseDown Description System property; indicates whether the mouse button is currently being
When the mouse button is pressed and the mouseDownScript property is defined, Lingo executes the instructions specified for the mouseDownScript property first. No other on mouseDown handlers are executed, unless the instructions include the pass command so that the mouseDown message can be passed to other objects in the movie. Setting the mouseDownScript property performs the same function as the when command in earlier versions of Director.
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 end on mouseLeave me -- Determine current cast member and switch to previous in cast currentMember = sprite(spritenum).member.number sprite(spritenum).
mouseItem Syntax the mouseItem Description System property; contains the number of the item under the pointer when the function is called and the pointer is over a field sprite. (An item is any sequence of characters delimited by the current delimiter as set by the itemDelimiter property.) Counting starts at the beginning of the field. If the mouse pointer is not over a field, the result is -1. The value of the mouseItem property can change in a handler or repeat loop.
on mouseLeave Syntax on mouseLeave statement(s) end Description System message and event handler; contains statements that run when the mouse leaves the active area of the sprite. The mouse button does not have to be pressed. If the sprite is a bitmap cast member with the matte ink applied, the active area is the portion of the image that is displayed; otherwise, the active area is the sprite’s bounding rectangle. If used in a behavior, this event is passed the sprite script or frame script reference me.
This property can be tested and set. Example This frame script checks to see if the name of the QuickTime sprite in channel 5 contains the string “QTVR.” If it does, this script sets mouseLevel to #all; otherwise, it sets mouseLevel to #none. on prepareFrame if sprite(5).member.name contains "QTVR" then sprite(5).mouseLevel = #all else sprite(5).
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; returns the cast member assigned to the sprite that is under the pointer when the property is called. When the pointer is not over a sprite, it returns the result VOID.
mouseOverButton Syntax sprite whichFlashSprite.mouseOverButton the mouseOverButton of sprite whichFlashSprite Description Flash sprite property; indicates whether the mouse pointer is over a button in a Flash movie sprite specified by the whichFlashSprite parameter (TRUE), or whether the mouse pointer is outside the bounds of the sprite or the mouse pointer is within the bounds of the sprite but over a nonbutton object, such as the background (FALSE). This property can be tested but not set.
Where you place an on • • • • mouseUp handler can affect when it runs, as follows: To apply the handler to a specific sprite, put it in a sprite script. To apply the handler to a cast member in general, put it in a cast member script. To apply the handler to an entire frame, put it in a frame script. To apply the handler throughout the entire movie, put it in a movie script.
on mouseUpOutside Syntax on mouseUpOutside me statement(s) end Description System message and event handler; sent when the user presses the mouse button on a sprite but releases it (away from) the sprite.
This statement sets mouseUpScript to the custom handler myCustomHandler. A Lingo custom handler must be enclosed in quotation marks when used with the mouseUpScript property. the mouseUpScript = "myCustomHandler" See also stopEvent, mouseDownScript, on mouseDown (event handler), on mouseUp (event handler) mouseV Syntax the mouseV mouseV() Description System property; indicates the vertical position of the mouse cursor, in pixels, from the top of the Stage.
If used in a behavior, this event is passed the sprite script or frame script reference me. Example This statement displays the mouse location when the mouse pointer is over a sprite: on mouseWithin member("Display").text = string(the mouseH) end mouseWithin See also on mouseEnter, on mouseLeave mouseWord Syntax the mouseWord Description System property; contains the number of the word under the pointer when the property is called and when the pointer is over a field sprite.
moveableSprite Syntax sprite(whichSprite).moveableSprite the moveableSprite of sprite whichSprite Description Sprite property; indicates whether a sprite can be moved by the user (TRUE) or not (FALSE). You can make a sprite moveable by using the Moveable option in the Score. However, to control whether a sprite is moveable and to turn this condition on and off as needed, use Lingo.
moveToBack Syntax window("whichWindow ").MoveToBack() moveToBack window whichWindow Description Command; moves the window specified by whichWindow behind all other windows. Examples These statements move the first window in windowList behind all other windows: myWindow = the windowList[1] moveToBack myWindow If you know the name of the window you want to move, use the syntax: window("Demo Window").moveToBack() moveToFront Syntax window("whichWindow ").
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.
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 the movieCopyrightInfo Description Movie property; enters a string during authoring in the Movie Properties dialog box.
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 the movieFileVersion Description Movie property; indicates the version of Director in which the movie was last saved. The result is a string.
movieImageQuality Syntax the movieImageQuality Description Movie property; indicates the level of compression to use when the movieImageCompression property is set to #jpeg. The range of acceptable values is 0–100. Zero yields the lowest image quality and highest compression; 100 yields the 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.
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; controls the rate at which a digital video in a specific channel plays.
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 movieXtraList Syntax the movieXtraList Description Movie property; displays a linear property list of all Xtra extensions in the Movies/Xtras dialog box that have been added to the movie.
multiply() Syntax transform.multiply(transform2) Description 3D command; applies the positional, rotational, and scaling effects of transform2 after the original transform. Example This statement applies the positional, rotational, and scaling effects of the model Mars’s transform to the transform of the model Pluto. This has a similar effect as making Mars be Pluto’s parent for a frame. member("scene").model("Pluto").transform.multiply(member("scene")\ .model("Mars").
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 put "Castlib"&¤tCastLib&&"is named"&&castLib(currentCastLib).
name (menu property) Syntax the name of menu(whichMenu) the name of menu whichMenu Description Menu property; returns a string containing the name of the specified menu number. This property can be tested but not set. Use the installMenu command to set up a custom menu bar. Note: Menus are not available in Shockwave. Examples This statement assigns the name of menu number 1 to the variable firstMenu: firstMenu = menu(1).
name (window property) Syntax window (whichWindow).name the name of window whichWindow Description Window property; determines the name of the specified window in windowList. (The title window property determines the title that appears in a window’s title bar.) This property can be tested and set. Example This statement changes the name of the window Yesterday to Today: window("Yesterday").name = "Today" name (system property) Syntax xtra (whichXtra).
name (XML property) Syntax XMLnode.name Description XML property; returns the name of the specified XML node. Example Beginning with this XML: element 2 element 3 This Lingo returns the name of the second tag that is nested within the tag : put gParserObject.child[1].child[2].name -- "e2" See also attributeName NAN Description Lingo return value; indicates that a specified Lingo expression is not a number.
Example The following statement sets the near property of the fog of the camera Defaultview to 100. If the fog’s enabled property is set to TRUE and its decayMode property is set to #linear, fog will first appear 100 world units in front of the camera. member("3d world").camera("defaultview").fog.near = 100.0 See also fog, far (fog), enabled (fog), decayMode nearFiltering Syntax member(whichCastmember).texture(whichTexture).nearFiltering member(whichCastmember).shader(whichShader).
netAbort Syntax netAbort(URL) netAbort(netID) Description Command; cancels a network operation without waiting for a result. Using a network ID is the most efficient way to stop a network operation. The ID is returned when you use a network function such as getNetText() or postNetText(). In some cases, when a network ID is not available, you can use a URL to stop the transmission of data for that URL. The URL must be identical to that used to begin the network operation.
This handler uses a specific network ID as an argument for netDone to check the status of a specific network operation: on exitFrame -- stay on this frame until the net operation is -- completed global mynetID if netDone(mynetID) = FALSE then go to the frame end if end See also getNetText(), netTextResult(), gotoNetMovie, preloadNetThing() netError() Syntax netError() netError(netID) Description Function; determines whether an error has occurred in a network operation and, if so, returns an error number
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. When a movie plays back as an applet, this function always returns a string. The string either has a length of 0 or consists of text that describes an error.
netMIME() Syntax netMIME() Description Function; provides the MIME type of the Internet file that the last network operation returned (the most recently downloaded HTTP or FTP item). The netMIME function can be called only after netDone and netError report that the operation is complete and successful. After the next operation starts, the Director movie or projector discards the results of the previous operation to conserve memory.
netStatus Syntax netStatus msgString Description Command; displays the specified string in the status area of the browser window. The netStatus command doesn’t work in projectors. Example This statement would place the string “This is a test” in the status area of the browser the movie is running in: on exitFrame netStatus "This is a test" end netTextResult() Syntax netTextResult(netID) netTextResult() Description Function; returns the text obtained by the specified network operation.
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. A low setting allows more time to be spent on network operations, but will adversely affect playback and animation performance.
When new() is used to create a timeout object, the timeoutPeriod sets the number of milliseconds between timeout events sent by the timeout object. The #timeoutHandler is a symbol that identifies the handler that will be called when each timeout event occurs. The targetObject identifies the name of the child object that contains the #timeoutHandler. If no targetObject is given, the #timeoutHandler is assumed to be in a movie script.
The first statement in the following example creates a child object from the above script in the preceding example, and places it in a variable named myBird. The second statement makes the bird fly by calling the fly handler in the Bird parent script: myBird = script("Bird").new() myBird.
newCurve() Syntax vectorMember.newCurve(positionInVertexList) newCurve(vectorMember, positionInVertexList) Description Function; adds a #newCurve symbol to the vertexList of vectorCastMember, which adds a new shape to the vector shape. The #newCurve symbol is added at positionInVertexList. You can break apart an existing shape by calling newCurve() with a position in the middle of a series of vertices.
newMesh Syntax member(whichCastmember).newMesh(name,numFaces, numVertices, numNormals,numColors,numTextureCoordinates) Description 3D command; creates a new mesh model resource using the arguments supplied. Note that after creating a mesh, you must set values for at least the vertexList and face[index].vertices properties of the new mesh, followed by a call to its build() command, in order to actually generate the geometry.
Line 17 calls the build command to construct the mesh. nm = member("Shapes").newMesh("pyramid",6 , 5, 0, 3) nm.vertexList = [ vector(0,0,0), vector(40,0,0), \ vector(40,0,40), vector(0,0,40), vector(20,50,20) ] nm.colorList = [ rgb(255,0,0), rgb(0,255,0), rgb(0,0,255) ] nm.face[1].vertices = [ 4,1,2 ] nm.face[2].vertices = [ 4,2,3 ] nm.face[3].vertices = [ 5,2,1 ] nm.face[4].vertices = [ 5,3,2 ] nm.face[5].vertices = [ 5,4,3 ] nm.face[6].vertices = [ 5,1,4 ] nm.face[1].colors = [3,2,3] nm.face[2].
newModelResource Syntax member(whichCastmember).newModelResource(newModelResourceName \ { ,#type, #facing }) Description 3D command; creates a new model resource, of the given #type and #facing (if specified), and adds it to the model resource palette.
newMotion() Syntax member(whichCastmember).newMotion(name) Description 3D command; creates a new motion within the referenced cast member, and returns a reference to the new motion. A new motion can be used to combine several previously existing motions from the member’s motion list via the map() command. All motions within a referenced cast member must have a unique name.
newShader Syntax member(whichCastmember).newShader(newShaderName, #shaderType) Description 3D command; creates a new shader of the specified #shaderType within the referenced cast member’s shader list and returns a reference to the new shader. All shaders in the shader list must have a unique name.
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 #typeIndicator and sourceObjectReference parameters are optional, and if not specified a new texture with no type or source is created.
next repeat Syntax next repeat Description Keyword; sends Lingo to the next step in a repeat loop in a script. This function differs from that of the exit repeat keyword. Example This repeat loop displays only odd numbers in the Message window: repeat with i = 1 to 10 if (i mod 2) = 0 then next repeat put i end repeat node Syntax sprite(whichQTVRSprite).node the node of sprite whichQTVRSprite Description QuickTime VR sprite property; the current node ID displayed by the sprite.
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: the me 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.
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].
This property must be set to the same length as the face[index].verticies list, or it can be an empty list [ ]. Do not set any value for this property if you are going to generate normal vectors using the command. generateNormals() If you make changes to this property, or a use the generateNormals() command, you need to call the build() command in order to rebuild the mesh.
nothing Syntax nothing Description Command; does nothing. This command is useful for making the logic of an if...then statement more obvious. A nested if...then...else statement that contains no explicit command for the else clause may require else nothing, so that Lingo does not interpret the else clause as part of the preceding if clause. Examples The nested if...then...
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 && "contains" && the number of \ members of castLib(n) && "cast members.
number (characters) Syntax the number of chars in chunkExpression Description Chunk expression; returns a count of the characters in a chunk expression. Chunk expressions are any character (including spaces and control characters such as tabs and carriage returns), word, item, or line in any container of characters. Containers include field cast members and variables that hold strings, and specified characters, words, items, lines, and ranges in containers.
This statement sets the variable itemCounter to the number of items in the field Names: itemCounter = the number of items in member("Names").text You can accomplish the same thing with text cast members using the syntax: itemCounter = member("Names").item.count See also item...of, count(), number (characters), number (lines), number (words) number (lines) Syntax the number of lines in chunkExpression Description Chunk expression; returns a count of the lines in a chunk expression.
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, number (menu items) number (menu items) Syntax the number of menuItems of menu whichMenu Description Menu property; indicates the number of menu items in t
number (words) Syntax the number of words in chunkExpression Description Chunk expression; returns the number of words in the chunk expression specified by chunkExpression. Chunk expressions are any character, word, item, or line in any container of characters. Containers include field cast members and variables that hold strings, and specified characters, words, items, lines, and ranges in containers. To accomplish this functionality with text cast members, see count.
number of xtras Syntax the number of xtras Description System property; returns the number of scripting Xtra extensions available to the movie. The Xtra extensions may be either those opened by the openxlib command or those present in the standard Xtras folder. This property can be tested but not set. Example This statement displays in the Message window the number of scripting Xtra extensions that are available to the movie: put the number of xtras numChannels Syntax member(whichCastMember).
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 #cylinder, allows you to get or set the numSegments property of the model resource.
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 end if end if end repeat return output end See also charToNum() obeyScoreRotation Syntax member(flashMember).
objectP() Syntax objectP(expression) Description Function; indicates whether the expression specified by expression is an object produced by a parent script, Xtra, or window (TRUE) or not (FALSE). The P in objectP stands for predicate. It is good practice to use objectP to determine which items are already in use when you create objects by parent scripts or Xtra instances.
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 stringToFind within the string represented by input and replaces them with the string represented by stringToInsert: on SearchAndReplace input, stringToFind, stringToInsert output = "" findLen = stringToFind.
on Syntax on handlerName {argument1}, {arg2}, {arg3} ... statement(s) end handlerName Description Keyword; indicates the beginning of a handler, a collection of Lingo statements that you can execute using the handler name. A handler can accept arguments as input values and returns a value as a function result. Handlers can be defined in behaviors, movie scripts, and cast member scripts. A handler in a cast member script can be called only by other handlers in the same script.
open window Syntax window(whichWindow).open() open window whichWindow Description Window command; opens the window object or movie file specified by whichWindow and brings it to the front of the Stage. If no movie is assigned to the window, the Open File dialog box appears. • If you replace whichWindow with a movie’s filename, the window uses the filename as the window. • If you replace whichWindow with a window name, the window takes that name.
openXlib Syntax openXlib whichFile Description Command; opens the Xlibrary file specified by the string expression whichFile. If the file is not in the folder containing the current movie, whichFile must include the pathname. It is good practice to close any file you have opened as soon as you are finished using it. The command has no effect on an open file. openXlib The openXlib command doesn’t support URLs as file references. Xlibrary files contain Xtra extensions.
Example This handler checks whether the user is pressing the Alt or the Option key and, if so, calls the handler named doOptionKey: on keyDown if (the optionDown) then doOptionKey(key) end keyDown See also controlDown, commandDown, key(), keyCode(), shiftDown or Syntax logicalExpression1 or logicalExpression2 Description Operator; performs a logical OR operation on two or more logical expressions to determine whether any expression is TRUE. This is a logical operator with a precedence level of 4.
Example The following handler would be located in a movie script of a movie in a window (MIAW). It places the user’s name and serial number into a display field when the window is opened: on prepareMovie displayString = the userName put RETURN & the organizationName after displayString put RETURN & the serialNumber after displayString member("User Info").text = displayString end See also serialNumber, userName, window originalFont Syntax member(whichFontMember).
Example This sprite script uses the originMode property to set up a Flash movie sprite so it’s origin point can be set to a specific point. It then sets the horizontal and vertical origin points. on beginSprite me sprite(spriteNum of me).originMode = #point sprite(spriteNum of me).originH = 100 sprite(spriteNum of me).originV = 80 end See also originV, originMode, originPoint, scaleMode originMode Syntax sprite(whichFlashOrVectorShapeSprite).
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. The originPoint property is specified as a Director point value: for example, point(100,200).
The origin point can be set with floating-point precision using the separate originH and originV properties, or it can be set with integer precision using the single originPoint property. You can set the originV property only if the originMode property is set to #point. This property can be tested and set. The default value is 0. Note: This property must be set to the default value if the scaleMode property is set to #autoSize, or the sprite does not display correctly.
orthoHeight Syntax member(whichCastmember).camera(whichCamera).orthoHeight member(whichCastmember).camera[cameraindex].orthoHeight sprite(whichSprite).camera.orthoHeight Description 3D property; when camera.projection is set to #orthographic, the value camera.orthoHeight gives the number of perpendicular world units that fit vertically in the sprite. World units are the measuring units for the particular 3D world.
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. This property can be tested but not set.
To display different bitmaps with different palettes simultaneously, set paletteMapping to TRUE. Director looks at each onscreen cast member’s reference palette (the palette assigned in its Cast Member Properties dialog box) and, if it is different from the current palette, finds the closest match for each pixel in the new palette. The colors of the nonmatching bitmap will be close to the original colors. Remapping consumes processor time, and it’s usually better to adjust the bitmap’s palette in advance.
pan (sound property) Syntax sound(channelNum).pan the pan of sound(channelNum) Description Property; indicates the left/right balance of the sound playing in sound channel channelNum.The range of values is from –100 to 100. -100 indicates only the left channel is heard. 100 indicate only the right channel is being heard. A value of 0 indicates even left/right balance, causing the sound source to appear to be centered. For mono sounds, pan affects which speaker (left or right) the sound plays through.
Example This handler accepts any number of arguments, adds all the numbers passed in as parameters, and then returns the sum: on AddNumbers sum = 0 repeat with currentParamNum = 1 to the paramCount sum = sum + param(currentParamNum) end repeat return sum end You would use it by passing in the values you wanted to add: put AddNumbers(3, 4, 5, 6) -- 18 put AddNumbers(5, 5) -- 10 See also getAt, param(), paramCount(), return (keyword) paramCount() Syntax the paramCount Description Function; indicates the
You can also alter the value of this property by using the addChild command. Example The following statement sets the parent property of the model named Tire. Its parent is set to the model named Car. member("Scene").model("Tire").parent = \ member("Scene").model("Car") See also child, addChild parseString() Syntax parserObject.parseString(stringToParse) Description Function; used to parse an XML document that is already fully available to the Director movie.
The return value is void if the operation succeeds, or an error code number string if it fails. To parse XML locally, use parseString(). Examples This statement parses the file sample.xml at MyCompany.com. Use doneParsing() to determine when the parsing operation has completed. errorCode = gParserObject.parseURL("http://www.MyCompany.com/sample.xml") This Lingo parses the file sample.xml and calls the on parseDone handler.
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 handlers attached to editable sprites. keyDown and on keyUp The pass command branches to the next location as soon as the command runs. Any Lingo that follows the pass command in the handler does not run.
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. put sprite(2).password -- "" put member("Real").
path Syntax member(whichCastmember).modelResource(whichModelResource).\ emitter.path Description 3D property; when used with a model resource whose type is #particle, allows you to get or set the path property of the resource’s particle emitter. This property is a list of vectors that define 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.
pathName (movie property) This is obsolete. Use moviePath. pathStrength Syntax member(whichCastmember).modelResource(whichModelResource).\ emitter.pathStrength Description 3D property; when used with a model resource whose type is #particle, determines how closely the particles follow the path specified by the path property of the emitter. Its range starts at 0.0 (no strength - so the particles won’t be attracted to the path) and continues to infinity. Its default value is 0.1. Setting pathStrength to 0.
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 nextPat = 57 + ((currentPat - 56) mod 8) member("Background Shape").
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. A subsequent play() command will resume playback.
pausedAtStart (RealMedia) Syntax sprite(whichSprite).pausedAtStart member(whichCastmember).pausedAtStart Description RealMedia sprite or cast member property; allows you to get or set whether a RealMedia stream on the Stage automatically begins to play when buffering is complete (FALSE or 0) or remains paused (TRUE or 1). This property can be set to an expression that evaluates to TRUE or FALSE. Integer values other than 1 or 0 are treated as TRUE. The default setting for this property is FALSE.
pause member Syntax member(whichCastMember). pause() pause member ("whichCastMember") Description Command; pauses the streaming of a Shockwave Audio (SWA) streaming cast member. When the sound is paused, the state member property equals 4. The portion of the sound that has already been downloaded and is available will continue to play until the cache runs out. Example This handler could be used for a Play or Pause button.
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.
This property can be tested only after the SWA sound starts playing or has been preloaded by means of the preLoadBuffer command. This property cannot be set. Example This handler displays the percentage of the SWA streaming cast member Frank Sinatra that has played and puts the value in the field cast member Percent Played: on exitFrame whatState = member("Frank Sinatra").state if whatState > 1 AND whatState < 9 then member("Percent Played").text = / string(member("Frank Sinatra").
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 end See also percentPlayed percentStreamed (3D) Syntax member(whichCastMember).percentStreamed Description 3D property; allows you to get the percentage of a 3D cast member that has been streamed.
perpendicularTo Syntax vector1.perpendicularTo(vector2) Description 3D vector command; returns a vector perpendicular to both the original vector and a second vector (vector2). This command is equivalent to the vector crossProduct command. See crossProduct(). Example In this example, pos1 is a vector on the x axis and pos2 is a vector on the y axis. The value returned by pos1.perpendicularTo(pos2) is vector( 0.0000, 0.0000, 1.00000e4 ).
PI Syntax PI Description Constant; returns the value of pi (π), the ratio of a circle’s circumference to its diameter, as a floating-point number. The value is rounded to the number of decimal places set by the floatPrecision property. Example This statement uses the PI constant as part of an equation for calculating the area of a circle: set vArea = PI*power(vRadius,2) picture (cast member property) Syntax member(whichCastMember).
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 Function; reports whether the state of the picture member property for the specified cast member is TRUE (1) or FALSE (0).
The following are the possible values for this property’s parameters: • • • javaVersion: 1.0 or 1.1 browser: IE, Netscape, or UnknownBrowser operatingSystem: Macintosh, Windows, or UnknownOS For example, if an applet is playing in Microsoft Internet Explorer with Java 1.1 in Windows, platform has the value Java 1.1, IE, Windows. Example This statement checks whether a projector was created for Windows 95 or Windows NT: on exitFrame if the platform contains "Windows,32" then castLib("Win95 Art").
Each play command needs a matching play done command to avoid using up memory if the original calling script isn’t returned to. To avoid this memory consumption, you can use a global variable to record where the movie should return to.
is measured in milliseconds from the beginning of the motion. When looped is FALSE, the motion begins at offset and ends at endTime. When looped is TRUE, the first iteration of the loop begins at offset and ends at endTime with all subsequent repetitions beginning at startTime and end at endTime. Set endTime to -1 if you want the motion to play to the end.
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).
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).
The play done command has no effect in a movie that is playing in a window. Example This handler returns the playhead to the frame of the movie that was playing before the current movie started: on exitFrame play done end See also play playing Syntax sprite(whichFlashSprite).playing the playing of sprite whichFlashSprite Description Flash sprite property; indicates whether a Flash movie is playing (TRUE) or stopped (FALSE). This property can be tested but not set.
playlist Syntax member(whichCastmember).model(whichModel).keyframePlayer.playlist member(whichCastmember).model(whichModel).bonesPlayer.playlist Description 3D #keyframePlayer and #bonesPlayer modifier property; returns a linear list of property lists, each representing a motion queued for playback by the modifier. Each property list will have the following properties: • • • • #name is the name of the motion to be played. #loop indicates whether the motion’s playback should be looped.
Example This handler begins the playback of the cast member Big Band: on mouseDown member("Big Band").play() end See also pause member, stop member playNext() Syntax sound(channelNum).playNext() playNext(sound(channelNum)) Description This command immediately interrupts playback of the current sound playing in the given sound channel and begins playing the next queued sound. If no more sounds are queued in the given channel, the sound simply stops playing.
playRate Syntax member(whichCastmember).model(whichModel).bonesPlayer.playRate member(whichCastmember).model(whichModel).keyframePlayer.playRate Description 3D #keyframePlayer and #bonesPlayer modifier property; scale multiplier for the local time of motions being played. This property only 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 play() or queue() command.
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 sprite(theSprite).
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 pointAtOrientation on the same node, e.g.
pointInHyperlink() Syntax sprite(whichSpriteNumber).pointInHyperlink(point) pointInHyperlink(sprite whichSpriteNumber, point) Description Text sprite function; returns a value (TRUE or FALSE) that indicates whether the specified point is within a hyperlink in the text sprite. Typically, the point used is the cursor position. This is useful for setting custom cursors. See also cursor (command), mouseLoc pointOfContact Syntax collisionData.
Example This example has two parts. The first part is the first line of code, which registers the #explode handler for the #collideAny event. The second part is the #explode handler. When two models in the cast member MyScene collide, the #explode handler is called and the collisionData argument is sent to it. The first nine lines of the #explode handler create the model resource named SparkSource and set its properties. This model resource is a single burst of particles.
pointToItem() Syntax sprite(whichSpriteNumber).pointToItem(pointToTranslate) pointToItem(sprite spriteNumber, pointToTranslate) Description Function; returns an integer representing the item position in the text or field sprite spriteNumber at screen coordinate pointToTranslate, or returns -1 if the point is not within the text. Items are separated by the itemDelimiter property, which is set to a comma by default. This function can be used to determine the item under the cursor.
pointToParagraph() Syntax sprite(whichSpriteNumber).pointToParagraph(pointToTranslate) pointToParagraph(sprite spriteNumber, pointToTranslate) Description Function; returns an integer representing the paragraph number located within the text or field sprite spriteNumber at screen coordinate pointToTranslate, or returns -1 if the point is not within the text. Paragraphs are separated by carriage returns in a block of text. This function can be used to determine the paragraph under the cursor.
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.
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.
The optional parameter serverOSString defaults to UNIX but may be set to Windows or Mac and translates any carriage returns in the postText argument into those used on the server to avoid confusion. For most applications, this setting is unnecessary because line breaks are usually not used in form responses. The optional parameter serverCharSetString applies only if the user is running on a Shift-JIS (Japanese) system. Its possible settings are "JIS", "EUC", "ASCII", and "AUTO".
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.
In Director, setting the preLoad property to TRUE causes the cast member to load completely before playback starts. In Shockwave, setting the preLoad property to TRUE causes the cast member to begin streaming when the movie starts playing. Before perfoming any Lingo operations on a 3D cast member that is streaming, be sure to check that the cast member’s state property has a value greater than or equal to 2.
preLoad (cast member property) Syntax member(whichCastMember).preLoad the preLoad of member whichCastMember Description Cast member property; determines whether the digital video cast member specified by whichCastMember can be preloaded into memory (TRUE) or not (FALSE, default). The TRUE status has the same effect as selecting Enable Preload in the Digital Video Cast Member Properties dialog box.
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 (TRUE) or not (FALSE, default). This property can be tested and set. Setting this property affects the current movie.
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. • 1—Load cast before frame 1. • 2—Load cast after frame 1. The default value for cast members is 0, when needed.
preloadNetThing() Syntax preloadNetThing (url) Description Function; preloads a file from the Internet to the local cache so it can be used later without a download delay. Replace url with the name of any valid Internet file, such as a Director movie, graphic, or FTP server location. The return value is a network ID that you can use to monitor the progress of the operation. The Director player for Java doesn’t support this command because Java’s security model doesn’t allow writing to the local disk.
It is usually safe to preload the first couple of seconds of a video and then continue streaming from that point on. If you know the data rate of your movie, you can estimate the setting for preLoadRAM. For example, if your movie has a data rate of 300K per second, set preLoadRAM to 600K if you want to preload the first 2 seconds of the video file. This is only an estimate, but it works in most situations.
preMultiply Syntax transform1.preMultiply(transform2) Description 3D transform command; alters transform1 by pre-applying the positional, rotational, and scaling effects of transform2. If transform2 describes a rotation of 90° about the X axis and transform1 describes a translation of 100 units in the Y axis, transform1.multiply\ (transform2) will alter this transform so that it describes a translation followed by a rotation. The statement transform1.
on prepareMovie Syntax on prepareMovie statement(s) end Description System message and event handler; contains statements that run after the movie preloads cast members but before the movie does the following: • Creates instances of behaviors attached to sprites in the first frame that plays. • Prepares the first frame that plays, including drawing the frame, playing any sounds, and executing transitions and palette effects.
Alternatively, the rotation may also be specified as a rotation about an arbitrary axis. This axis is defined in space by positionVector and directionVector. The amount of rotation about this axis is specified by angle. Node may be a reference to a model, group, light, or camera Example The following statement performs a rotation of 20° about each axis.
Line 2 applies a scale to that transform prior to any existing positional or rotational effects of that transform. Assume that the transform represents the positional offset and rotational orbit of Moon1 relative to its parent planet. Lets also assume Moon2’s parent is the same as Moon1’s. If we used scale() here instead of preScale(), then Moon2 would be pushed out twice as far and rotated about the planet twice as much as is Moon1.
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().
printFrom Syntax printFrom fromFrame {,toFrame} {,reduction} Description Command; prints whatever is displayed on the Stage in each frame, whether or not the frame is selected, starting at the frame specified by fromFrame. Optionally, you can supply toFrame and a reduction value (100%, 50%, or 25%). The frame being printed need not be currently displayed.
property Syntax property {property1}{, property2} {,property3} {...} Description Keyword; declares the properties specified by property1, property2, and so on as property variables. Declare property variables at the beginning of the parent script or behavior script. You can access them from outside the parent script or behavior script by using the the operator. Note: The spriteNum property is available to all behaviors and simply needs to be declared to be accessed.
proxyServer Syntax proxyServer serverType, "ipAddress", portNum proxyServer() Description Command; sets the values of an FTP or HTTP proxy server, as follows: • • • serverType—#ftp or #http ipAddress—A string containing the IP address portNum—The integer value of the port number If you use the syntax proxyServer(), this element returns the settings of an FTP or HTTP proxy server. Examples This statement sets up an HTTP proxy server at IP address 197.65.208.157 using port 5: proxyServer #http,"197.
While the playhead is in the same sprite, setting the sprite channel’s puppet sprite property to FALSE resets the sprite’s properties to those set in the Score. Making the sprite channel a puppet lets you control many sprite properties, such as member, locH, and width, from Lingo after the playhead exits from the sprite. Setting the puppet sprite property is equivalent to using the puppetSprite command.
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.
The sprite channel’s initial properties are whatever the channel’s settings are when the puppetSprite command is executed. You can use Lingo to change sprite properties as follows: • If a sprite channel is a puppet, any changes that Lingo makes to the channel’s sprite properties remain in effect after the playhead exits the sprite. • If a sprite channel is not a puppet, any changes that Lingo makes to a sprite last for the life of the current sprite only.
puppetTransition Syntax puppetTransition member whichCastMember puppetTransition whichTransition {,time} {, chunkSize} {, changeArea} Description Command; performs the specified transition between the current frame and the next frame. To use an Xtra transition cast member, use puppetTransition member’s name or number. member followed by the cast To use a built-in Director transition, replace whichTransition with a value in the following table.
Transitions marked with an asterisk (*) do not work on monitors set to 32 bits. There is no direct relationship between a low time value and a fast transition. The actual speed of the transition depends on the relation of chunkSize and time. For example, if chunkSize is 1 pixel, the transition takes longer no matter how low the time value, because the computer has to do a lot of work. To make transitions occur faster, use a larger chunk size, not a shorter time.
put Syntax put expression Description Command; evaluates the expression specified by expression and displays the result in the Message window. This command can be used as a debugging tool by tracking the values of variables as a movie plays. The Director player for Java displays the message from the put command in the browser’s Java console window. Access to the console window depends on the browser.
Description Command; evaluates a Lingo expression, converts the value to a string, and inserts the resulting string before a specified chunk in a container, without replacing the container’s contents. (If chunkExpression specifies a nonexistent target chunk, the string value is inserted as appropriate into the container.) Chunk expressions refer to any character, word, item, or line in any container.
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.
Examples This statement displays a typical list describing a sprite: put sprite(1).quad -- [point(153.0000, 127.0000), point(231.0000, 127.0000), point(231.0000, 242.0000), point(153.0000, 242.0000)] \ When modifying the quad sprite property, be aware that you must reset the list of points after 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.
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 ].
Description Function; adds the given sound cast member to the queue of sound channel channelNum. Once a sound has been queued, it can be played immediately with the play() command. This is because Director preloads a certain amount of each sound that is queued, preventing any delay between the play() command and the start of playback. The default amount of sound that is preloaded is 1500 milliseconds.
queue() (3D) Syntax member(whichCastmember).model(whichModel).bonesPlayer.queue\ (motionName {, looped, startTime, endTime, scale, offset}) member(whichCastmember).model(whichModel).keyframePlayer.\ queue(motionName {, looped, startTime, endTime, scale, offset}) Description 3D keyframePlayer and bonesPlayer modifier command; adds themotionspecified bymotionName to the end of the modifier’s playList property.
quickTimeVersion() Syntax quickTimeVersion() Description Function; returns a floating-point value that identifies the current installed version of QuickTime and replaces the current QuickTimePresent function. In Windows, if multiple versions of QuickTime 3.0 or later are installed, quickTimeVersion() returns the latest version number. If a version before QuickTime 3.0 is installed, quickTimeVersion() returns version number 2.1.2 regardless of the version installed.
radius Syntax modelResourceObjectReference.radius member(whichCastmember).modelResource(whichModelResource).radius Description 3D model property; when used with model resource of type #sphere or #cylinder, allows you to get or set the radius of the model. The radius property determines the sweep radius used to generate the model resource. This property’s value must always be set to greater than 0.0, and has a default value of 25.0.
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 random() function.
randomSeed Syntax the randomSeed Description System property; specifies the seed value used for generating random numbers accessed through the random() function. Using the same seed produces the same sequence of random numbers. This property can be useful for debugging during development. Using the ticks property is an easy way to produce a unique random seed since the ticks value is highly unlikely to be duplicated on subsequent uses. This property can be tested and set.
rawNew() Syntax parentScript.rawNew() rawNew(parentScript) Description Function; creates a child object from a parent script without calling its on new handler. This allows a movie to create child objects without initializing the properties of those child objects. This is particularly useful 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 on new handler.
Examples The following code shows that the realPlayerNativeAudio() function is set to FALSE, which means that audio in the RealMedia cast member will be processed by Director: put realPlayerNativeAudio() -- 0 The following code sets the realPlayerNativeAudio() function to TRUE, which means that audio in the RealMedia stream will be processed by RealPlayer and all Lingo control of the sound channel will be ignored: realPlayerNativeAudio(TRUE) See also soundChannel (RealMedia), audio (RealMedia) realPlaye
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. On Macintosh systems, RealPlayer Core component build numbers 6.0.7.
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.
rect (camera) Syntax sprite(whichSprite).camera(whichCamera).rect Description 3D camera property; allows you to get or set the rectangle that controls the size and position of the camera. This rectangle is analogous to the rectangle you see through the eyepiece of a real camera. The default value for the rect property for all cameras rect(0,0,1,1) which makes them invisible until you change the setting. However, when sprite.camera(1) is rendered, its rect is reset to rect(0,0,sprite(whichSprite).
Examples This statement sets the variable newArea to a rectangle whose left side is at 100, top is at 150, right side is at 300, and bottom is at 400 pixels: set newArea = rect(100, 150, 300, 400) The following statement sets the variable newArea to the rectangle defined by the points firstPoint and secondPoint. The coordinates of firstPoint are (100, 150); the coordinates of secondPoint are (300, 400).
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. For a bitmap, the rect member property is measured from the upper left corner of the bitmap, instead of from the upper left corner of the easel in the Paint window.
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. To pan or scale the movie playing in the window, set the drawRect or sourceRect property of the window. This property can be tested and set.
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. This texture is applied to the third texture layer of the shader.
region Syntax member(whichCastmember).modelResource(whichModelResource).\ emitter.region modelResourceObjectReference.emitter.region Description 3D emitter property; when used with a model resource whose type is #particle, allows you to both get and set the region property of the resource’s particle emitter. The region property defines the location from which particles are emitted.
The eventName parameter can be any of the following predefined Lingo events, or any custom event that you define: • • #collideAny • #animationStarted is a collision event. #collideWith is a collision event involving this specific model. The setCollisionCallback() command is a shortcut for using the registerScript() command for the #collideWith event. and #animationEnded are notification events that occur when a bones or keyframe animation starts or stops playing.
This statement declares the on promptUser handler in the same script that contains the registerForEvent command to be called when any object collides with the model named Pluto in the cast member named Scene: member("Scene").registerForEvent(#collideWith, #promptUser, me, \ member("Scene").model("Pluto")) See also setCollisionCallback(), registerScript(), play() (3D), playNext() (3D), autoblend, blendTime, sendEvent, unregisterAllEvents registerScript() Syntax member(whichCastmember).model(whichModel).
• and #animationEnded are notification events that occur when a bones or keyframe animation starts or stops playing. The handler will receive three arguments: eventName, motion, and time. The eventName argument is either #animationStarted or #animationEnded. The motion argument is the name of the motion that has started or stopped playing, and time argument is the current time of the motion.
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, vertical). Nonvisual members such as sounds do not have a useful regPoint property.
regPointVertex Syntax vectorMember.regPointVertex the regPointVertex of vectorMember Description Cast member property; indicates whether a vertex of vectorCastMember is used as the registration point for that cast member. If the value is zero, the registration point is determined normally, using the centerRegPoint and regPoint properties. If the value is nonzero, it indicates the position in the vertextList of the vertex being used as the registration point.
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.
removeOverlay Syntax member(whichCastmember).camera(whichCamera).removeOverlay(index) Description 3D command; removes the overlay found in the position specified by index from the camera’s list of overlays to display. Example The following statement removes the third overlay from the list of overlays for the camera being used by sprite 5. The overlay disappears from the Stage. sprite(5).camera.removeOverlay(1) See also overlay renderer Syntax getRendererServices().
This property is a list that can contain the following possible values: • #openGL specifies the openGL drivers for a hardware acceleration which work with both Macintosh and Windows platforms. • #directX7_0 specifies the DirectX 7 drivers for hardware acceleration which work with Windows platforms only. • #directX5_2 specifies the DirectX 5.2 drivers for hardware acceleration which work with Windows platforms only.
The renderFormat property determines the pixel format the renderer uses when rendering the specified texture. Each pixel format has a number of digits, with each digit indicating the color depth being used for red, green, blue, and alpha. The value you choose determines the accuracy of the color fidelity (including the precision of the optional alpha channel) and thus the amount of memory used on the video card.
While in a repeat loop, Lingo ignores other events. To check the current key in a repeat loop, use the keyPressed property. Only one handler can run at a time. If Lingo stays in a repeat loop for a long time, other events stack up waiting to be evaluated. Therefore, repeat loops are best used for short, fast operations or when users are idle. If you need to process something for several seconds or more, evaluate the function in a loop with some type of counter or test to track progress.
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 end repeat end puppetize See also exit, exit repeat, repeat while, repeat with...down to, repeat with...in list repeat with...
repeat with...in list Syntax repeat with variable in someList Description Keyword; assigns successive values from the specified list to the variable. While in a repeat loop, Lingo ignores other events except keypresses. To check the current key in a repeat loop, use the keyPressed property. Only 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.
on resizeWindow Syntax on resizeWindow statement(s) end Description System message and event handler; contains statements that run when a movie is running as a movie in a window (MIAW) and the user resizes the window by dragging the window’s resize box or one of its edges. An on resizeWindow event handler is a good place to put Lingo related to the window’s dimensions, such as Lingo that positions sprites or crops digital video.
resolve Syntax member(whichCastmember).model(whichModel).collision.resolve Description 3D collision property; allows you to get or set whether collisions are resolved when two models collide. If this property is set to TRUE for both models involved in a collision, both models come to a stop at the point of collision. If only one of the models has the resolve property set to TRUE, that model comes to a stop, and the model with the property not set, or set to FALSE, continues to move.
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. It will now have the same geometry as the model named box. member("3d World").model("NewBox").
Examples This handler returns a random roll for two dice: on diceRoll return random(6) + random(6) end In the following example, the two statements diceRoll roll = the result are equivalent to this statement: set roll = diceRoll() Note that set roll = diceRoll would not call the handler because there are no parentheses following diceRoll; diceRoll here is considered a variable reference. See also return (keyword) resume sprite Syntax sprite(whichGIFSpriteNumber ).
return (keyword) Syntax return expression Description Keyword; returns the value of expression and exits from the handler. The expression argument can be any Lingo value. When calling a handler that serves as a user-defined function and has a return value, you must use parentheses around the argument lists, even if there are no arguments, as in the diceRoll function handler discussed under the entry for the result function.
revertToWorldDefaults Syntax member(whichCastmember).revertToWorldDefaults() Description 3D command; reverts the properties of the specified 3D cast member to the values stored when the member was first created. The member’s state property must be 4 (loaded) or -1 (error) before this command can be used, otherwise a script error will occur.
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. property spriteNum on exitFrame if sprite(spriteNum).playing then go the frame else sprite(spriteNum).
Example This statement calls the handler offRightEdge when the right edge of sprite 3 is past the right edge of the Stage: if sprite(3).right > (the stageRight - the stageLeft) then offRightEdge See also bottom, height, left, locH, locV, top, width right (3D) Syntax member(whichCastmember).modelResource (whichModelResource).right modelResourceObjectReference.right Description 3D property; allows you to get or set the right property of a model resource whose type is #box.
Description System message and event handler; in Windows, specifies statements that run when the right mouse button is pressed. On Macintosh computers, the statements run when the mouse button and Control key are pressed simultaneously and the emulateMultiButtonMouse property is set to TRUE; if this property is set to FALSE, this event handler has no effect on the Macintosh. Example This handler opens the window Help when the user clicks the right mouse button in Windows: on rightMouseDown window("Help").
rightMouseUp (system property) Syntax the rightMouseUp Description System property; indicates whether the right mouse button (Windows) or the mouse button and Control key (Macintosh) are currently not being pressed (TRUE) or are currently being pressed (FALSE). On the Macintosh, rightMouseUp is TRUE only if the emulateMultiButtonMouse property is TRUE.
The following handler sends the playhead to different frames when the pointer is over certain sprites on the Stage. It first assigns the rollOver value to a variable. This lets the handler use the rollOver value that was in effect when the rollover started, regardless of whether the user continues to move the mouse.
rootNode Syntax member(whichCastmember).camera(whichCamera).rootNode sprite(whichSprite).camera.rootNode Description 3D property; allows you to get or set which objects are visible within a sprite. When a camera is first created, it shows all nodes within the world. The rootNode property allows you to modify this by creating a different default view that limits what’s shown to a particular node and its children. For example, light C is a child of model A.
• #world • nodeReference allows you to specify a node to base your rotation upon, the command applies the increments relative to the coordinate system of the specified node. applies the increments relative to the world coordinate system. If a model’s parent is the world, than this is equivalent to using #parent.
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°. This property can be tested and set. The default value is 0.
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.
rotationReset Syntax member(whichCastmember).model(whichModel).bonesPlayer.rotationReset member(whichCastmember).model(whichModel).keyframePlayer.\ rotationReset Description 3D keyframePlayer and bonesPlayer modifier property; indicates the axes around which rotational changes are maintained 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.
• BrowserPlugin—The movie is running as a Shockwave plug-in or other scripting environment, such as LiveConnect or ActiveX. • Java Applet—The movie is playing back as a Java applet. The safest way to test for particular values in this property is to use the contains operator. This helps avoid errors and allows partial matches.
safePlayer Syntax the safePlayer Description System property; controls whether or not safety features in Director are turned on. In a Shockwave movie, this property can be tested but not set. It is always TRUE in Shockwave. In the authoring environment and in projectors, the default value is FALSE. This property may be tested, but it may only be set to TRUE. Once it has been set to TRUE, it cannot be set back to FALSE without restarting Director or the projector.
Example This statement displays the name and sampleCount of the cast member currently playing in sound channel 1 in the Message window: put "Sound cast member" && sound(1).member.name && "contains" && \ sound(1).sampleCount && "samples." See also channelCount, sampleRate, sampleSize sampleRate Syntax member(whichCastMember).sampleRate the sampleRate of member whichCastMember sound(channelNum).
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 Syntax castLib(whichCast).
saveMovie Syntax saveMovie {pathName&fileName} Description Command; saves the current movie. Including the optional parameter saves the movie to the file specified by pathName:fileName. This command does not work with compressed files. The specified filename must include the .dir file extension. The saveMovie command doesn’t support URLs as file references. Example This statement saves the current movie in the Update file: saveMovie the moviePath & "Update.
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 if member(currentMemberNum).crop = FALSE then member(currentMemberNum).
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.
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 scale property allows you to get and set the degree of scaling of the transform along each of the three axes. The default value of this property is vector(1.0,1.0,1.0).
• #noScale—preserves the original size of the Flash media, regardless of how the sprite is sized on the Stage. If the sprite is made smaller than the original Flash movie, the movie displayed in the sprite is cropped to fit the bounds of the sprite. • #autoSize (default)—This specifies that the sprite rectangle is automatically sized and positioned to account for rotation, skew, flipH, and flipV. This means that when a Flash sprite is rotated, it will not crop as in earlier versions of Director.
scoreColor Syntax sprite(whichSprite).scoreColor the scoreColor of sprite whichSprite Description Sprite property; indicates the Score color assigned to the sprite specified by whichSprite. The possible values correspond to color chips 0 to 5 in the current palette. This property can be tested and set. Setting this property is useful only during authoring and Score recording. Example This statement displays in the Message window the value for the Score color assigned to sprite 7: put sprite(7).
script Syntax the script of menuItem whichItem of menu whichMenu childObject.script the script of childObject Description Menu item and child object property. For menu items, determines which Lingo statement is executed when the specified menu item is selected. The whichItem expression can be either a menu item name or a menu item number; the whichMenu expression can be either a menu name or a menu number.
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 end These statements attach the script Big Noise to sprite 5: x = script("Big Noise").new() sprite(5).scriptInstanceList.add(x) See also scriptNum, sendSprite scriptList Syntax sprite(whichSprite).
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 (TRUE or 1) or disabled (FALSE or 0). This property is available for linked Director movie cast members only. This property can be tested and set.
scriptType Syntax member whichScript.scriptType the scriptType of member whichScript Description Cast member property; indicates the specified script’s type. Possible values are #movie, #score, and #parent. Example This statement makes the script member Main Script a movie script: member("Main Script").scriptType = #movie scrollByLine Syntax member(whichCastMember).
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).
sds (modifier) Syntax member(whichCastmember).model(whichModel).sds.whichProperty Description 3D modifier; adds geometric detail to models and synthesizes additional details to smooth out curves as the model moves closer to the camera. After you have added the sds modifier to a model using addModifier(), you can set the properties of the sds modifier. The sds modifier directly affects the model resource.
searchCurrentFolder Syntax the searchCurrentFolder Description System property; determines whether Director searches the current folder when searching file names. This property is TRUE by default. • When the searchCurrentFolder property is TRUE (1), Director searches the current folder when resolving filenames. • When the searchCurrentFolder property is FALSE (0), Director does not search the current folder when resolving filenames. This property can be tested and set.
Examples This statement displays the paths that Director searches when resolving filenames: put the searchPaths The following statement assigns two folders to searchPaths in Windows. This version includes optional trailing backslashes.
seek Syntax sprite(whichSprite).seek(milliseconds) member(whichCastmember).seek(milliseconds) Description RealMedia sprite or cast member method; changes the media stream’s playback location to the location specified by the number of milliseconds from the beginning of the stream. The mediaStatus value usually becomes #seeking and then #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.
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 put mySelectionObject.fontSize put mySelectionObject.
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 Text cast member property; returns a list of the first and last character selected in the text cast member. This property can be tested and set.
selStart Syntax the selStart Description Cast member property; specifies the starting character of a selection. It is used with selEnd to identify a selection in the current editable field, counting from the beginning character. This property can be tested and set. The default value is 0.
Example This handler sends the custom message allSpritesShouldBumpCounter and the argument 2 to all sprites when the user clicks the mouse: on mouseDown me sendAllSprites (#allSpritesShouldBumpCounter, 2) end See also sendSprite sendEvent Syntax member(whichCastmember).sendEvent(#eventName, arg1, arg2,...) Description 3D command; sends the event eventName, and an arbitrary number of arguments (arg1, ...), to all scripts registered to receive the event.
Example This handler sends the custom message bumpCounter and the argument 2 to sprite 1 when the user clicks: on mouseDown me sendSprite (1, #bumpCounter, 2) end See also sendAllSprites on sendXML Syntax sendXML "sendxmlstring", "window", "postdata" Description Event handler; functions much like the getURL scripting method, which is also available using the Flash Asset Xtra. The on sendXML handler is called in Lingo when the XMLobject.
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.
setAlpha() Syntax imageObject.setAlpha(alphaLevel) imageObject.setAlpha(alphaImageObject) Description Function; sets the alpha channel of an image object to a flat alphaLevel or to an existing alphaImageObject. The alphaLevel must be a number from 0–255. Lower values cause the image to appear more transparent. Higher values cause the image to appear more opaque. The value 255 has the same effect as a value of zero.
Examples These statements create a property list and then adds the item #c:10 to the list: newList = [#a:1, #b:5] put newList -- [#a:1, #b:5] setaProp newList, #c, 10 put newList Using the dot operator, you can alter the property value of a property already in a list without using setaProp: newList = [#a:1, #b:5] put newList -- [#a:1, #b:5] newList.
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.
setCollisionCallback() Syntax member(whichCastmember).model(whichModel).collision.\ setCollisionCallback (#handlerName, scriptInstance) Description 3D collision command; registers the handler #handlerName in the given scriptInstance to be called when whichModel is involved in a collision. This command works only if the model’s collision.enabled property is TRUE. The default behavior is determined by the value of collision.resolve, you can override it using the collision.resolveA and/or the collision.
Example This statement sets the value of the #rotate property of the movie clip Star in the Flash member in sprite 3 to 180: sprite(3).setFlashProperty("Star", #rotate, 180) See also getFlashProperty() setPixel() Syntax imageObject.setPixel(x, y, colorObject) imageObject.setPixel(point(x, y), colorObject) imageObject.setPixel(x, y, integerValue) imageObject.
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 beginning of the sound. See startTime. #endTime The time within the sound at which playback ends, in milliseconds. The default is the end of the sound. See endTime.
This command does not perform any sophisticated manipulation of the string data or its formatting. You must perform any formatting or other manipulation in conjunction with getPref(); you can manipulate the data in memory and write it over the old file using setPref. In a browser, data written by setPref is not private; any Shockwave movie can read this information and upload it to a server. Do not store confidential information using setPref.
setScriptList() Syntax spriteReference.setScriptList(scriptList) sprite(whichSprite).setScriptList(scriptList) Description This command sets the scriptList of the given sprite. The scriptList indicates which scripts are attached to the sprite and what the settings of each script property are. By setting this list, you can change which behaviors are attached to a sprite or change the behavior properties. The list takes the form: [ [ (whichBehaviorMember), " [ #property1: value, #property2: value, . . .
Example This statement opens the Flash Settings panel with the Local Storage tab active: sprite(3).settingsPanel(1) See also on mouseDown (event handler), rightMouseDown (system property), controlDown setTrackEnabled Syntax sprite(whichSprite).setTrackEnabled(whichTrack, trueOrFalse ) setTrackEnabled(sprite whichSprite, whichTrack, trueOrFalse) Description Command; determines whether the specified track in the digital video is enabled to play.
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. The shader itself is not an image.
shaderList Syntax member(whichCastmember).model(whichModel).shaderList member(whichCastmember).model(whichModel).shaderList[index] Description 3D model property; a linear list of shadowPercentage applied to the model. The number of entries in this list equals the number of meshes in the model resource used by the model. Each mesh can be shaded by only one shader. Set the shader at the specified index position in the shaderlist with this syntax: member(whichCastmember).model(whichModel).
The range of this property is 0 to 100, and the default value is 50. The number of colors used by the toon modifier and painter shader for a model is determined by the colorSteps property of the model’s toon modifier or painter shader. Example The following statement sets the shadowPercentage property of the toon modifier for the model named Teapot to 50. Half of the colors available to the toon modifier for this model will be used for the shadow area of the model’s surface. member("shapes").
shiftDown Syntax the shiftDown Description System property; indicates whether the user is pressing the Shift key (TRUE) or not (FALSE). In the Director player for Java, this function returns TRUE only if the Shift key and another key are pressed simultaneously. If the Shift key is pressed by itself, shiftDown returns FALSE. The Director player for Java supports key combinations with the Shift key.
short See date() (system clock), time() showGlobals Syntax showGlobals Description Command; displays all global variables in the Message window. This command is useful for debugging scripts. Example This statement displays all global variables in the Message window: showGlobals See also clearGlobals, global, globals showLocals Syntax showLocals Description Command; displays all global variables in the Message window.
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.
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 quit, restart silhouettes Syntax member(whichCastmember).model(whichModel).inker.silhouettes member(whichCastmember).model(whichModel).toon.
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 member(whichCastmember).modelResource (whichModelResource).sizeRange.start modelResourceObjectReference.
When the skew limit is reached (slightly past the 59,652th rotation), the skew resets to +116.47° or -116.48°—not 0.00°. This is because +21,474,836.47° is equal to +116.47°, and 21,474,836.48° is equal to -116.48° (or +243.12°). To avoid this reset condition, constrain angles to ±360° in either direction when using Lingo to perform continuous skewing.
After a list is sorted, it maintains its sort order even when you add new variables using the add command. Example The following statement puts the list Values, which consists of [#a: alphanumeric order. The result appears below the statement. 1, #d: 2, #c: 3], into put values -- [#a: 1, #d: 2, #c: 3] values.sort() put values --[#a: 1, #c: 3, #d: 2] sound Syntax member(whichCastMember).
Example The following statement checks whether a sound is playing in sound channel 1 and loops in the frame if it is. This allows the sound to finish before the playhead goes to another frame. if soundBusy(1) then go to the frame See also sound playFile, sound stop, status soundChannel (SWA) Syntax member(whichCastMember).soundChannel the soundChannel of member whichCastMember Description Shockwave Audio (SWA) cast member property; specifies the sound channel in which the SWA sound plays.
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.
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.
The sound(whichChannel).fadeIn() syntax performs the fade over a specified number of frames or milliseconds. • When milliseconds is specified, the fade in occurs evenly over that period of time. • When milliseconds is not specified, the default number of ticks is calculated as 15 * (1000 / (tempo setting)) based on the tempo setting for the first frame of the fade in. The sound fadeIn whichChannel syntax performs the fade over a specified number of frames or ticks. A tick is a 60th of a second.
If the sound is stopped before it reaches the minimum volume, it remains at the level it was stopped at, causing subsequent playback to be at this volume. Be sure to allow the sound to finish fading completely. Note: You may want to use the volume sound property to create a custom sound fade to allow more control over the actual volume of the channel. Example This statement fades out the sound in channel 1 over 5 seconds: sound(1).
This property can be tested and set. To see an example of soundLevel used in a completed movie, see the Sound Control movie in the Learning/Lingo Examples folder inside the Director application folder.
Examples This statement 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; stops the sound playing in the specified channel. The sound stop command was used puppetSound command instead. in earlier versions of Director.
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 ThisLingosetsthesourceFileNameoftheFlashcastmember“SWF”toC:\FlashFiles\myFile.fla: member("SWF").sourceFileName = "C:\FlashFiles\myFile.fla" sourceRect Syntax window whichWindow.
specular (light) Syntax member(whichCastmember).light(whichLight).specular Description 3D light property; allows you to get or set whether specularity is on (TRUE) or off (FALSE). Specularity refers to the ability to have a highlight appear on a model where the light hitting the model is reflected toward the camera. The shininess of the model’s shader determines how large the specular portion of the highlight is. The value for this property is ignored for ambient lights.
specularColor Syntax member(whichCastmember).specularColor Description 3D cast member property; allows you to get or set the RGB value of the specular color of the first shader in the cast member. The first shader in the cast member’s shader palette is always the default shader. This and all other 3D cast member properties are saved with the cast member and are restored the next time you open the movie. The default value for this property is rgb(255, 255, 255) which is white.
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; for instance if you wish to specify a 90° angle you would pass a value of 45.0.
sprite...intersects Syntax sprite(sprite1).intersects(sprite2) sprite sprite1 intersects sprite2 Description Keyword; operator that compares the position of two sprites to determine whether the quad of sprite1 touches (TRUE) or does not touch (FALSE) the quad of sprite2. If both sprites have matte ink, their actual outlines, not the quads, are used. A sprite’s outline is defined by the nonwhite pixels that make up its border. This is a comparison operator with a precedence level of 5.
spriteNum Syntax spriteNum the spriteNum of me Description Sprite property; determines the channel number the behavior’s sprite is in and makes it available to any behaviors. Simply declare the property at the top of the behavior, along with any other properties the behavior may use. If you use an on new handler to create an instance of the behavior, the script’s on new handler must explicitly set the spriteNum property to the sprite’s number.
The projection plane is defined by the camera’s X and Y axes, and is at a distance in front of the camera such that one pixel represents one world unit of measurement. It is this projection plane that is used for the sprite display on stage. The camera.spriteSpaceToWorldSpace() form of this command is a shortcut for using camera(1).spriteSpaceToWorldSpace().
Examples This statement causes the main Stage movie to go to the marker named Menu. This statement can be used in a movie in a window (MIAW): tell the Stage to go to "Menu" This statement displays the current setting for the Stage: put the stage.rect --rect (0, 0, 640, 480) stageBottom Syntax the stageBottom Description Function; along with stageLeft, stageRight, and stageTop, indicates where the Stage is positioned on the desktop.
Examples This statement sets the variable oldColor to the index number of the current Stage color: Related Lingo: oldColor = the stageColor This statement sets the Stage color to the color assigned to chip 249 on the current palette: Related function: the stageColor = 249 See also backColor, bgColor, foreColor, color() stageLeft Syntax the stageLeft Description Function; along with stageRight, stageTop, and stageBottom, indicates where the Stage is positioned on the desktop.
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, stageTop, locH, locV stageToFlash() Syntax sprite(whichFlashSprite).
When the movie plays back as an applet, the stageTop property is always 0, which is the location of the left side of the applet. This function can be tested but not set. Sprite coordinates are expressed relative to the upper left corner of the Stage.
Example This statement displays the starting frame of the sprite in channel 5 in the Message window: put sprite(5).startFrame See also endFrame() on startMovie Syntax on startMovie statement(s) end Description System message and event handler; contains statements that run just before the playhead enters the first frame of the movie. The startMovie event occurs after the prepareFrame event and before the enterFrame event.
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 Description Sprite and sound property; for digital video sprites, determines when the specified digital video sprite begins. The value of startTime is measured in ticks.
Example This handler sets the timer to 0 when a key is pressed: on keyDown startTimer end See also lastClick(), lastEvent(), lastKey, lastRoll, timeoutLength, timeoutMouse, timeoutPlay, timeoutScript, timer state (3D) Syntax member(whichCastmember).state Description 3D property; returns the current state of the referenced member in the streaming and loading process. This property refers to the initial file import or the last file load requested.
state (Flash, SWA) Syntax member(whichCastMember).state state of member whichCastMember Description Cast member property; for Shockwave Audio (SWA) streaming cast members and Flash movie cast members, determines the current state of the streaming file. The properties streamName, URL, and preLoadTime can be changed only when the SWA sound is stopped.
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. on exitFrame if member("Intro Movie").percentStreamed < 100 then put "Current download state:" && member("Intro Movie").
1 (connecting) indicates that streaming has begun but is in the very early stages of connecting to the server, and there is not enough information available locally to do anything with the cast member. This state is the equivalent of #connecting for the mediaStatus property. 2 (open) indicates that the Lingo properties have been refreshed from the actual stream. When state is greater than or equal to 2, the height, width, and duration properties of the RealMedia stream are known.
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.
on stepFrame Syntax on stepFrame statement(s) end Description System message and event handler; works in script instances in actorList because these are the only objects that receive on stepFrame messages. This event handler is executed when the playhead enters a frame or the Stage is updated. An on stepFrame handler is a useful location for Lingo that you want to run frequently for a specific set of objects.
Example This statement checks whether the mouse button is being pressed and calls the handler dragProcedure if it is: if the stillDown then dragProcedure See also the mouseDown (system property) stop (Flash) Syntax sprite(whichFlashSprite).stop() stop sprite whichFlashSprite Description Flash 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 repeat with i = 5 to 10 sprite(i).
stop() (sound) Syntax sound(channelNum).stop() stop(sound(channelNum)) Description Command; stops the currently playing sound in sound channel channelNum. Issuing a play() command begins playing the first sound of those that remain in the queue of the given sound channel. To see an example of stop() (sound) used in a completed movie, see the Sound Control movie in the Learning/Lingo Examples folder inside the Director application folder.
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 state member property equals 0. For you to change properties such as streamName, preLoadTime, and URL, the SWA streaming cast member must be stopped.
stopTime Syntax sprite(whichSprite).stopTime the stopTime of sprite whichSprite Description Sprite property; determines when the specified digital video sprite stops. The value of measured in ticks. stopTime is 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 member(whichFlashSprite).
The script also saves the actual number of bytes streamed in a variable called bytesReceived. If the number of bytes actually streamed does not match the number of bytes requested, the script updates a text cast member to report the number of bytes actually received. The script keeps the playhead looping in the current frame until the cast member has finished loading into memory. on exitFrame if member(10).percentStreamed < 100 then bytesReceived = member(10).
streamMode Syntax member(whichFlashMember).streamMode the streamMode of member whichFlashMember Description Flash cast member property; controls the way a linked Flash movie cast member is streamed into memory, as follows: • #frame (default)—Streams • #idle—Streams part of the cast member each time an idle event is generated or at least once per Director frame while the sprite is on the Stage.
streamSize Syntax member(whichFlashMember).streamSize the streamSize of member whichFlashMember Description Cast member property; reports an integer value indicating the total number of bytes in the stream for the specified cast member. The streamSize property returns a value only when the Director movie is playing. This property can be tested but not set. Example The following frame script checks to see if a Flash movie cast member named Intro Movie has finished streaming into memory.
on streamStatus Syntax on streamStatus URL, state, bytesSoFar, bytesTotal, error statement(s) end Description System message and event handler; called periodically to determine how much of an object has been downloaded from the Internet. The handler is called only if tellStreamStatus (TRUE) has been called, and the handler has been added to a movie script. The on streamStatus event handler has the following parameters: URL Displays the Internet address of the data being retrieved.
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 #red to a string and inserts it in the field cast member Color: member("Color").
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.
subdivision Syntax member(whichCastmember).model(whichModel).sds.subdivision Description 3D sds modifier property; allows you to get or set the subdivision surfaces mode of operation. Possible values are as follows: • #uniform • #adaptive specifies that additional detail is added only when there are large surface orientation changes and only to those areas of the mesh that are currently visible.
suspendUpdates Syntax sprite(which3dSprite).suspendUpdates Description 3D sprite property; when set to TRUE, causes the sprite not to be updated as part of normal screen redraw operations. This can improve movie playback performance. Certain kinds of screen updates will still affect the sprite, such as those due to dragging another window over the sprite. When the suspendUpdates property is set to FALSE, the sprite is redrawn normally.
switchColorDepth Syntax the switchColorDepth Description System property; determines whether Director switches the monitor that the Stage occupies to the color depth of the movie being loaded (TRUE) or leaves the color depth of the monitor unchanged when a movie is loaded (FALSE). False is the default value. When switchColorDepth is TRUE, nothing happens until a new movie is loaded. Setting the monitor’s color depth to that of the movie is good practice.
This statement displays the symbol #goodbye: x = "goodbye" put x.symbol -- #goodbye See also value(), string() symbolP() Syntax Expression.symbolP symbolP(expression) Description Function; determines whether the expression specified by expression is a symbol (TRUE) or not (FALSE). The P in symbolP stands for predicate. Example This statement checks whether the variable myVariable is a symbol: put myVariable.
TAB Syntax TAB Description Constant; represents the Tab key. Examples This statement checks whether the character typed is the tab character and calls the handler doNextField if it is: if the key = TAB then doNextField These statements move the playhead forward or backward, depending on whether the user presses Tab or Shift-Tab: if the key = TAB then if the shiftDown then go the frame -1 else go the frame +1 end if end if See also BACKSPACE, EMPTY, RETURN (constant) tabCount Syntax chunkExpression.
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; yields the tangent of the specified angle expressed in radians as a floating-point number. Example The following function yields the tangent of pi/4: tan (PI/4.
targetFrameRate Syntax sprite(which3dSprite).targetFrameRate Description 3D sprite property; determines the preferred number of frames per second to use when rendering a 3D sprite. The default value is 30 frames per second. The targetFrameRate property is only used if the useTargetFrameRate property is set to TRUE. If the useTargetFrameRate property is set to TRUE, Director will reduce the polygon count of the models in the sprite if necessary to maintain the specified frame rate.
Examples A multiple-line tell command resembles a handler and requires an end tell statement: global childMovie tell window childMovie go to frame "Intro" the stageColor = 100 sprite(4).member = member "Diana Ross" updateStage end tell When a message calls a handler, a value returned from the handler can be found in the global result property after the called handler is done.
Examples This on prepareMovie handler turns the on streamStatus handler on when the movie starts: on prepareMovie tellStreamStatus(TRUE) end This statement determines the status of the stream status handler: on mouseDown put tellStreamStatus() end See also on streamStatus tellTarget() Syntax sprite(whichSprite).tellTarget("targetName") sprite(whichSprite).endTellTarget() Definition Command;equivalenttotheFlashbeginTellTargetandendTellTargetmethods.
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. Example The following statement sets the tension property of the sds modifier of the model Baby to 35.
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 texture Syntax member(whichCastmember).texture(whichTexture) member(whichCastmember).texture[index] member(whichCastmember).shader(whichShader).
textureCoordinateList Syntax member(whichCastmember).modelResource(whichmodelResource). textureCoordinateList modelResourceObjectReference.textureCoordinateList Description 3D property; when used with a model resource whose type is #mesh, or with a meshDeform modifier attached to a model, this property allows you to get or set the textureCoordinateList property of the model resource.
Description 3D meshdeform modifier properties; using these properties you can get and set information about the texture layers of a specified mesh. You can have up to eight texture layers for a shader, each layer can contain only one texture, but the same texture can be specified for more than one layer. Texture layers are layers of textures used by shaders. Use the following properties to access and manipulate texture layers: meshdeform.mesh[index].texturelayer.
textureMember Syntax member(whichCastmember).textureMember Description 3D cast member property; indicates the name of the bitmap cast member used as the source of the default texture for the 3D cast member. The 3D cast member’s textureType property must be set to #member for the textureMember property to be effective. Example The following statement sets the textureMember property of the cast member named YardScene to "Fence".
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.
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. member("scene").shader("GardenBall).textureList[1] = \ member("scene").texture("FlatShinyBall") member("scene").shader("GardenBall").
Example The following statement sets the global textureRenderFormat for the 3D member to #rgba8888. Each texture in this movie will be rendered in 32-bit color unless its texture.renderFormat property is set to a value other than #default. getRendererServices().textureRenderFormat = #rgba8888 See also renderer, preferred3DRenderer, renderFormat, getRendererServices() textureRepeat Syntax member(whichCastmember).shader(whichShader).textureRepeat member(whichCastmember).model(whichModel).shader.
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].
textureTransform Syntax member(whichCastmember).shader(whichShader).textureTransform member(whichCastmember).model(whichModel).shader.textureTransform member(whichCastmember).model(whichModel).shaderList{[index]}.\ textureTransform Description 3D #standard shader property; provides access to a transform which modifies the texture 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.
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.
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.
the Syntax the property Description Keyword; must precede many functions and all Lingo properties written in verbose syntax. This keyword also distinguishes the property or function from a variable or object name. Earlier versions of Director required you to use the the keyword to express cast member and sprite properties. This syntax is still supported as alternate form. Properties are globally available to handlers even if you don’t declare them globally.
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 the the the the the time short time long time abbreviated time abbrev time abbr time Description Function; returns the current time in the system clock as a string in one of three formats: short, long, or abbreviated. If you don’t specify a format, the default format is short.
Example This handler determines the time remaining until the next timeout event will be sent by the timeout object Update by calculating the difference between its time property and the current value of the milliseconds and displaying the result in the field Time Until: on prepareFrame msBeforeUpdate = timeout("Update").time - the milliseconds secondsBeforeUpdate = msBeforeUpdate / 1000 minutesBeforeUpdate = secondsBeforeUpdate / 60 member("Time Until").
timeoutHandler Syntax timeoutObject.timeoutHandler Description System property; represents the name of the handler that will receive timeout messages from the given timeoutObject. Its value is a symbol, such as #timeExpiredHandler. The timeoutHandler is always a handler within the timeout object’s target object, or in a movie script if the timeout object has no target specified. This property can be tested and set.
Example The following statement sets the Countdown member field to the value of the timeoutLapsed property. Dividing timeoutLapsed by 60 converts the value to seconds. member("Countdown").text = string(the timeoutLapsed / 60) timeoutLength Syntax the timeoutLength Description System property; determines how many ticks must elapse before a timeout event occurs. A timeout occurs when the timeoutLapsed property reaches the time specified by timeoutLength. This property can be tested and set.
Examples This statement records the current setting of timeoutMouse by setting the variable named timing to the timeoutMouse: timing = the timeoutMouse The following statement sets the timeoutMouse property to FALSE. The result is that the timeoutLapsed property keeps its current value when the mouse button is pressed.
timer Syntax the timer Description System property; a free running timer that counts time in ticks (1 tick = 1/60 second). It has nothing to do with the timeoutScript property. It is used only for convenience in timing certain events. The startTimer command sets timer to 0. The timer property is useful for determining the amount of time passed since the startTimer command was issued.
Example This statement makes Action View the title of window X: window("X").title = "Action View" titleVisible Syntax window (whichWindow.titleVisible) the titleVisible of window whichWindow Description Window property; specifies whether the window specified by whichWindow displays the window title in the window’s title bar. This property can be tested and set for windows other than the Stage.
The #toon modifier has the following properties: Note: For more detailed information about the following properties see the individual property entries. • style allows you to get or set the style applied to color transitions. The following are the possible values: #toon gives sharp transitions between available colors. #gradient gives smooth transitions between available colors. #blackAndWhite gives sharp transition between black and white.
top Syntax sprite(whichSprite).top the top of sprite whichSprite Description Sprite property; returns the top vertical coordinate of the bounding rectangle of the sprite specified by whichSprite as the number of pixels from the upper left corner of the Stage. When the movie plays back as an applet, this property’s value is relative to the upper left corner of the applet. This property can be tested and set.
Example This statement sets the topCap property of the model resource Tube to FALSE, meaning the top of this cylinder will be open: member("3D World").modelResource("Tube").topCap = FALSE topRadius Syntax modelResourceObjectReference.topRadius Description 3D command; when used with a model resource whose type is #cylinder, allows you to both get and set the topRadius property of the model resource, as a floating-point value. The topRadius property determines the radius of the top cap of the cylinder.
This property can be tested and set. Example This statement turns the trace property on: the trace = TRUE See also traceLogFile traceLoad Syntax the traceLoad Description Movie property; specifies the amount of information that is displayed about cast members as they load: • 0—Displays no information. • 1—Displays cast members’ names.
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").
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.
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.
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").
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; indicates which type of media is in the specified track of the specified cast member.
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.
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 bonesPlayer modifier.
If you want to modify the transform property of a bone within a model, then you must store a copy of the original transform of the bone, modify the stored copy using the above commands and properties, then reset the bone’s transform property so that it is equal to the modified transform. For example: t = member(“character”).model(“biped”).bonesPlayer.bone[38].\ transform.duplicate() t.translate(25,0,-3) member(“character”).model(“biped”).bonesPlayer.bone[38].
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.
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.
All shaders have access to the #standard shader properties; in addition to these standard shader properties shaders of the types #engraver, #newsprint, and #painter have properties unique to their type. For more information, see the newShader. Example The following statement causes the model Pluto to be rendered opaque. The setting of the blend property for the model’s shader will have no effect. member("scene").model("Pluto").shader.
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.
Description A 3D extruder model resource property, as well as a text cast member property. Using this property allows you to get or set the extrusion depth (the distance between the front and back faces) of a 3D text model resource Possible values are floating point numbers between 1.0 and 100.0. The default value is 50.0. It is recommended that you see extrudeToMember entry for more information about working with extruder model resources and text cast members.
• #age alters the color of the particle by linearly interpolating the color between colorRange.start and colorRange.end over the lifetime of the particle. This is the default setting for this property. Example In this example, ThermoSystem is a model resource of the type #particle. This 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").
For movies created in Director 5 and 6, the type member property returns #field for field cast members and #richText for text cast members. However, field cast members originally created in Director 4 return #text for the member type, providing backward compatibility for movies that were created in Director 4. This property can be tested but not set.
type (model resource) Syntax member(whichCastmember).modelResource(whichModelResource).type Description 3D model resource property; the resource type of the referenced model resource. This property’s possible values are: • #box indicates that this model resource newModelResource command. • #cylinder indicates that this model resource is a primitive cylinder resource created using the newModelResource command. • #extruder indicates that this model using the extrude3d command.
Examples The following statement displays the type property of the motion named Run. put member("scene").motion("Run").type -- #bonesPlayer The following statement displays the type property of the motion named DefaultMotion. put member("scene").motion("DefaultMotion").type -- #none See also bonesPlayer (modifier), keyframePlayer (modifier) type (shader) Syntax member(whichCastmember).shader(whichShader).type Description 3D shader property; the shader type of the referenced shader object.
type (texture) Syntax member(whichCastmember).shader(whichShader).type Description 3D texture property; the texture type of the referenced texture object. This property’s possible values are: • #fromCastMember indicates that this is texture was created from a supporting the image property using the newTexture command. • #fromImageObject indicates newTexture command.
union() Syntax rect(1).union(rect(2)) union (rect1, rect2) Description Function; returns the smallest rectangle that encloses the two rectangles rect1 and rect2. Example This statement returns the rectangle that encloses the specified rectangles: put union (rect (0, 0, 10, 10), rect (15, 15, 20, 20)) -- rect (0, 0, 20, 20) or put rect(0, 0, 10, 10).
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.
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" unregisterAllEvents Syntax member(whichMember).
Example When used in the following handler, the updateFrame command enters the changes that have been made to the current frame and moves to the next frame each time Lingo reaches the end of the repeat loop. The number of frames is determined by the argument numberOfFrames. on animBall numberOfFrames beginRecording horizontal = 0 vertical = 300 repeat with i = 1 to numberOfFrames go to frame i sprite(20).memberNum = member("Ball").number sprite(20).locH = horizontal sprite(20).locV = vertical sprite(20).
Example This statement instructs Director to save changes to the current movie whenever the movie branches to another movie: the updateMovieEnabled = TRUE updateStage Syntax updateStage Description Command; redraws the Stage immediately instead of only between frames. The updateStage command redraws sprites, performs transitions, plays sounds, sends a prepareFrame message (affecting movie and behavior scripts), and sends a stepFrame message (which affects actorList).
URLEncode Syntax URLEncode(proplist_or_string {, serverOSString} {, characterSet}) Description Function; returns the URL-encoded string for its first argument. Allows CGI parameters to be used in other commands. The same translation is done as for postNetText and getNetText() when they are given a property list.
useDiffuseWithTexture Syntax member(whichCastmember).shader(whichShader).useDiffuseWithTexture Description 3D standard shader property; allows you to get or set whether the diffuse color is used to modulate the texture (TRUE) or not (FALSE). When set to TRUE, this property works in conjunction with the blendFunction and blendConstant properties: when blendFunction is set to #blend, the diffuse color is weighed with the texture color to determine the final color.
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 useHypertextStyles is TRUE, all links are automatically colored blue with underlines, and the pointer (cursor) changes to a pointing finger when it is over a link.
userData Syntax member(whichCastmember).model(whichModel).userData member(whichCastmember).light(whichLight).userData member(whichCastmember).camera(whichCamera).userData member(whichCastmember).group(whichCamera).userData Description 3D property; returns the userData property list of a model, group, camera, or light.
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. If a user name has been set, the value of this property is the string "********".
value() Syntax value(stringExpression) Description Function; returns the value of a string. The string can be any expression that Lingo can understand. When value() is called, Lingo parses through the stringExpression provided and returns its logical value. Any Lingo expression that can be put in the Message window or set as the value of a variable can also be used with value(). These two Lingo statements are equivalent: put sprite(2).member.duration * 5 put value("sprite(2).member.
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 x, y, and z which are the specific distances from the reference point along the x-axis, y-axis, and zaxis, respectively.
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.
Example This statement displays the vertextList value for an arched line with two vertices: put member("Archie").vertexList -- [[#vertex: point(-66.0000, 37.0000), #handle1: point(-70.0000, -36.0000), \ #handle2: point(-62.0000, 110.0000)], [#vertex: point(66.0000, -5.0000), \ #handle1: point(121.0000, 56.0000), #handle2: point(11.0000, -66.0000)]] See also addVertex, count(), deleteVertex(), moveVertex(), moveVertexHandle(), originMode, vertex vertexList (mesh generator) Syntax member(whichCastmember).
Example This statement displays the #meshDeform modifier’s vertexList for the first mesh in the model named Triangle: put member("Shapes").model("Triangle").meshDeform.mesh[1].vertexList -- [vector(0,0,0), vector(20,0,0), vector(20, 20, 0)] See also face, vertices, mesh (property) vertices Syntax member(whichCastmember).modelResource(whichModelResource).\ face[faceIndex].
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 (FALSE or 0). Integer values other than 1 or 0 are treated as TRUE.
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. A Flash movie’s view point is set relative to its origin point.
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 originPoint, originH, and originV properties).
One significant difference between the viewScale and scale properties is that viewScale always scales from the center of the sprite’s bounding rectangle, whereas scale scales from a point determined by the Flash movie’s originMode property. This property can be tested and 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.
visible (sprite property) Syntax sprite(whichSprite).visible the visible of sprite whichSprite Description Sprite property; determines whether the sprite specified by whichSprite is visible (TRUE) or not (FALSE). This property affects all sprites in the channel, regardless of their position in the Score. Note: Setting the visible property of a sprite channel to FALSE makes the sprite invisible and prevents only the mouse-related events from being sent to that channel.
• #back specifies that only those polygons facing away from the camera are drawn. Use this setting when you want to draw the inside of a model, or for models which are not drawing correctly, possibly because they were imported from a file format that used a different handiness value when computing normals. • #both specifies that both sides of all polygons are drawn.Use this setting when you want to see the plane regardless of the viewing direction, and for models that are not drawing correctly.
Examples This statement sets the variable oldVoice to the property list describing the current text-tospeech voice: oldVoice = voiceGet() This statement displays the property list of the current text-to-speech voice: put voiceGet() -- [#name: "Mary", #age: "teen", #gender: "female", #index: 5] See also voiceInitialize(), voiceCount(), voiceSet(), voiceGet() voiceGetAll() Syntax voiceGetAll() Description Function; returns a list of the available voices installed on the computer.
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 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 voiceInitialize() Description Command; loads the computer’s text-to-speech engine.
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 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.
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 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; returns an integer indicating the position of the word that is currently being spoken within the entire string that
voidP() Syntax voidP(variableName) Description Function; determines whether the variable specified by variableName has any value. If the variable has no value or is VOID, this function returns TRUE. If the variable has a value other than VOID, this function returns FALSE. Example This statement checks whether the variable answer has an initial value: put voidP(answer) See also ilk(), VOID volume (cast member property) Syntax member(whichCastMember).
To see an example of volume (sound channel) used in a completed movie, see the Sound Control movie in the Learning/Lingo Examples folder inside the Director application folder. Example This statement sets the volume of sound channel 2 to 130, which is a medium sound level setting: sound(2).volume = 130 See also fadeIn(), fadeOut(), soundEnabled, soundLevel, fadeTo(), pan (sound property) volume (sprite property) Syntax sprite(whichSprite).
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 whichCastMember, imageObject or whichSprite. Field and button cast members are not affected.
widthVertices Syntax member(whichCastmember).modelResource(whichModelResource). widthVertices modelResourceObjectReference.widthVertices Description 3D property; allows you to get or set the number of vertices (as an integer) on the X axis of a model resource whose type is #box or #plane. This property must be greater than or equal to 2, and has a default value of 2. Example The following statement sets the widthVertices property of the model resource Tower to 10.
This statement moves the Navigation window to the front: moveToFront window "Navigation" or window("Navigation").moveToFront() See also close window, moveToBack, moveToFront, open window windowList Syntax the windowList Description System property; displays a list of references to all known movie windows.
windowType Syntax window whichWindow.
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.
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 getWorldTransform().position command.
worldTransform Syntax member(whichMember).model(whichModel).bonesPlayer.bone[index].\ worldTransform Description 3D bonesplayer property; allows you to get the world relative transform of a specific bone, as opposed to using the transform property which returns the bone’s parent relative transform. The worldTransform property can only be used with bonesplayer modified models. Example This statement stores a bone’s world relative transform in the variable finalTransform: finalTransform = member("3D").
wrapTransformList 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 ].
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. The next two lines show that the x-axis of ModCylinder is the vector ( 1.0000, 0.0000, 0.0000). This means that the x-axis of ModCylinder is aligned with the x-axis of the world.
xtraList 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. It is possible to have a list without a #name entry, such as when the Xtra exists only on one platform.
xtras See number of xtras y (vector property) Syntax member(whichCastmember).vector.y member(whichCastmember).vector[2] Description 3D property; allows you to get or set the y component of a vector. Example This statement shows the y component of a vector: vec = vector(20, 30, 40) put vec.y -- 30.0000 yAxis Syntax member(whichCastmember).transform.yAxis Description 3D transform property; allows you to get but not set the vector representing the transform’s canonical y-axis in transform space.
yon Syntax member(whichCastmember).camera(whichCamera).yon Description 3D property; allows you to get or set the distance from the camera defining where along the camera’s Z axis the view frustum is clipped. Objects at a distance greater than yon are not drawn. The default value for this property is 3.40282346638529e38. Example This statement sets the yon property of camera 1 to 50000: member("3d world").camera[1].yon = 50000 See also hither z (vector property) Syntax member(whichCastmember).vector.
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° around its y-axis. This rotates the axes of ModCylinder as well. The last two lines show that the z-axis of ModCylinder is now the vector ( 1.0000, 0.0000, 0.0000 ).
Example This handler moves sprite 3 to the coordinates stored in the variable centerPlace when the window that the movie is playing in is resized: on zoomWindow centerPlace = point(10, 10) sprite(3).
INDEX Symbols " (quotation mark) 522 " (string constant) 54 # (symbol definition operator) 43, 517 & (concatenation operator) 45 && (concatenation operator) 46 () (parentheses operator) 47 * (multiplication operator) 47 + (addition operator) 48 - (subtraction operator) 44 -- (comment delimiter) 45 / (division operator) 49 < (less than operator) 50 <= (less than or equal to operator) 50 <> (not equal operator) 50 = (equal sign operator) 51 > (greater than operator) 51 >= (greater than or equal to operator)
blend range, end and start 99 bonesPlayer modifier 32 borders of field cast members 104 of shape cast members 345 boxes for field cast members 362 Lingo for 38 brackets ([]) 52 branching case keyword 120 end case keyword 212 if...
Cast window, cast members selected in 583 casts activeCastLib system property 59 cast numbers 438 castLib keyword 121 castLibNum of member 121 file names of 232 last cast member in 442 names of 413 number of in movies 438 preload mode of 499 saving changes to 567 CGI query 268 channel numbers, sprite behaviors and 620 channels cast member assigned to first sound channel 255 cast member assigned to second sound channel 255 channelCount of member property 125 checking sound channels 607 closing sound channels
collisions detection, and Lingo 33 resolving 549 color depth colorDepth property 146 depth of member property 188 of bitmap cast members 188 of monitors 146 setting (Macintosh) 646 colors Score color assigned to sprites 573 setting background colors with cast members 83 setting foreground colors of field cast members 248 setting Stage color 622 Command key (Macintosh) 150 comment delimiter (--) 45 comparing values 120 comparison operators contains 153 equal sign operator (=) 51 greater than operator (>) 51
cylinders Lingo for 38 open and sealed 674 D date object 581 debugging with put command 515 with showGlobals command 602 with showLocals command 602 Delete key (Macintosh) 85 deleting all items in list 181 cast members 218 chunk expressions 181 contents of frame’s sprite 133 frames from movies 183 items in lists 181, 185 movies from memory 696 values from lists 185 windows 250 delimiters comment delimiter (--) 45 defining for items 325 digital video deleting frames from movies 183 duration of 205 format of
on activateWindow 59 on alertHook 215 on closeWindow 215 on cuePassed 215 on deactivateWindow 215 on endSprite 215 on enterFrame 221, 472 on exitFrame 221 on idle 297 on keyDown 668 on keyUp 332 on keyword 448 on mouseDown 391, 669 on mouseEnter 396 on mouseLeave 396 on mouseUp 402 on mouseUpOutSide 402 on mouseWithin 402 on moveWindow 449 on openWindow 449 on prepareFrame 502 on rightMouseUp 556 on stopMovie 641 on zoomWindow 448 result function 550 return keyword 552 tell command 650 timeOut 448 event mes
Finder, quitting from Director to (Macintosh) 522 finding empty cast members 238 filenames 270, 580 movies 270 Flash Asset Xtra, endTellTarget command for 652 Flash movies mixing sounds 613 setting properties of 592 setting variables in 597 flipped integer value 417 floating-point numbers 244, 245 fog, Lingo for 34 folders of current movie 409, 466 searchCurrentFolder function 580 fonts 246, 247 foreground colors, setting with cast members 248 forward slash (/) 49 frame properties frameLabel 251 framePalett
importing 310 inker colors of 149 modifier 34 inks ink of sprite property 312 trails effect 681 inserting frames 315 installing menus defined in field cast members 316 integers maxInteger property 364 random 524 Internet downloading cast members from 367 playing Shockwave movies from 283 preloading files from 200, 500 Internet files, MIME types and 421 interpreters for Lingo 558 intersecting sprites 619 items, separating 325 K keyboard, on timeOut event handler and 448 keyframes sprites and 689 trackNextKe
getOne command 270 getPos command 273 getProp command 274 getPropAt command 274 identifying items in 259, 260, 267, 270, 273, 274 ilk function 303 list operators ([]) 52 maximum value in 364 minimum value in 377 of movie windows 727 position of properties in property lists 238, 239 replacing property values from 589, 595 setaProp command 589 setAt command 590 setProp command 595 sorting 606 types of 303, 347 value of parameters in 459 windowList property 727 literal quotation mark (") 522 loading cast membe
menus defining custom menus 373 in current movie 443 installing menus defined in field cast members 316 name of menu property 414 mesh colors of 147 Lingo for 38 mesh deform modifier 36 Message window displaying expression results in 515 displaying global variables 602 writing display to log files 676 messages alert command and 66 custom event messages for sprites 585, 586 error 262, 264 event 448 idle time and 298 invoking handlers with 115 passing 463 sending to child’s ancestor 116 stage system property
finding 270 go loop command 281 going to frames 280 idle time and 297 inserting frames 315 last frame in 337 length of in time 410 movie names 406, 409, 466 number of casts in 438 number of menus in 443 on stopMovie event handler 641 pausing 154, 467, 471 playback rates 410 playing from a marker 282 playing with play command 477, 481 preloading 499 properties, Lingo for 37 responding to events 379 run mode of 563 saving 568, 698 Score associated with 572 Shockwave 225, 226, 283 stopping movie playback 180,
parent nodes, Lingo for 33 parent scripts ancestor property 71 me keyword 366 objects created by 446 parentheses operator () 47 parents 460 particle systems distribution 197 gravity 280 Lingo for 38 particles, Lingo for 38 Paste command, enabling 208 pasting Clipboard contents into cast members 464 pathname operator (@) 54 pathnames 54, 409, 466, 580 paths applicationPath property 76 browsers and 109 searched by Director 580 patterns, filling shape cast members with 236 pausing movies 154, 467, 471 pausing
rectangles changing dimensions of 312 coordinates of 532, 615 defining 530 inflate rect command 312 inside function 316 intersect function 319 offsetting 447 positioning and sizing 360 type of 303 union rect function 695 rects, identifying 347 redrawing Stage 699 reflectivity 534 refreshing web pages 114 registering 535 registration points 539 of bitmap cast members 539 of sprites 349, 351 updating 475 relative paths, pathname operator (@) 54 remainders of division 378 remapping palettes 457 rendering 495,
Shockwave movies names of external parameters 225 number of external parameters 225 opening 284 playing from Internet 283 values from external parameters 226 short time format 666 size chunkSize of member property 131 fixStageSize property 241 idleReadChunkSize property 300 lineSize of member property 345 of cast members 131, 605 of free blocks of memory 257 of monitors 189 of movies 408 of Stage 241 size of member property 605 sizing rectangles and points 360 slash sign (/) 49 smoothness 606 sorting lists
stop time of tracks 680 stretching 642 trails effect 681 visibility of 714 square brackets ([]) 52 Stage centering on monitor 124 fixStageSize property 241 position of on desktop 622, 623, 624 printing 507 redrawing 699 setting color of 622 size of after loading movies 241 sprite position on 348 updating 699 starting applications 448 character in selections 585 Score update sessions 86 starts comparison operator 626 statements, if...then...
T TAB character constant 648 Tab key 648 tabbing order, autoTab of member property 82 tempo assigned to frames 256 settings 256 tempo channels as puppets 512 text ASCII codes 128, 444 char...
updating frames 697 registration points 475 Score 86, 214, 698 Stage 699 URLs, Shockwave Audio cast members and 699 user data 703 V values, comparing 120 variables global variables 134, 278, 602 local variables 602 property variables 508 voidP property 723 vectors, Lingo for 42, 706 video deleting frames from movies 183 pausing movies 154 preloading movies 500 stopping movie playback 180, 286 Video for Windows software 710 VOID constant 722 W WAVE files 613 web pages, refreshing 114 width of cast members
Index