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, Flash,
Fontographer, FreeHand, FreeHand Graphics Studio, Generator, Generator Developer’s Studio, Generator Dynamic Graphics Server,
Knowledge Objects, Knowledge Stream, Knowledge Track, Lingo, Live Effects, Macromedia, Macromedia M Logo & Design,
Macromedia Contribute, Macromedia Flash, Macromedia Xres, Macromind, Macromind Action, MAGIC, Mediamaker, Object
Authoring, Power Applets, Priority Access, Roundtrip HTML, Scriptlets, SoundEdit, ShockRave, Shockmachine, Shockwave, Shockwave
Remote, Shockwave Internet Studio, Showcase, Tools to Power Your Ideas, Universal Media, Virtuoso, Web Design 101, Whirlwind and
Xtra are trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally.
Other product names, logos, designs, titles, words or phrases mentioned within this publication may be trademarks, servicemarks, or
tradenames of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally.
This guide contains links to third-party Web sites that are not under the control of Macromedia, and Macromedia is not responsible for
the content on any linked site. If you access a third-party Web site mentioned in this guide, then you do so at your own risk. Macromedia
provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia endorses or accepts any
responsibility for the content on those third-party sites.
Apple Disclaimer
APPLE COMPUTER, INC. MAKES NO WARRANTIES, EITHER EXPRESS OR IMPLIED, REGARDING THE ENCLOSED
COMPUTER SOFTWARE PACKAGE, ITS MERCHANTABILITY OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
THE EXCLUSION OF IMPLIED WARRANTIES IS NOT PERMITTED BY SOME STATES. THE ABOVE EXCLUSION MAY
NOT APPLY TO YOU. THIS WARRANTY PROVIDES YOU WITH SPECIFIC LEGAL RIGHTS. THERE MAY BE OTHER
RIGHTS THAT YOU MAY HAVE WHICH VARY FROM STATE TO STATE.
Writing: Jay Armstrong, George Brown, Stephanie Gowin, and, Tim Statler
Editing: Rosana Francescato, Mary Ferguson, Mary Kraemer, and Noreen Maher
Project Management: Stuart Manning
Production: Chris Basmajian, Caroline Branch, John Francis, and Patrice O’Neill
Multimedia: Aaron Begley and Benjamin Salles
First Edition: December 2002
Macromedia, Inc.
600 Townsend St.
San Francisco, CA 94103
CHAPTER 1
Lingo by Feature
This chapter lists various Macromedia Director MX features and the corresponding Lingo
elements that you can use to implement those features.
Accessibility
These terms are useful for making movies accessible to the disabled:
Text-to-speech
voiceCount()voiceSet()
voiceGet()voiceSetPitch()
voiceGetPitch()voiceSetRate()
voiceGetRate()voiceSetVolume()
voiceGetVolume()voiceSpeak()
voiceInitialize()voiceState()
voicePause()voiceStop()
voiceResume()voiceWordPos()
Keyboard navigation
autoTabselection (cast property)
hilite (command)selectedText
keyboardFocusSpriteselEnd
selection (text cast member property)selStart
selection() (function)
3
Animated GIFs
These terms are useful for working with animated GIFs:
directToStagepause (movie playback)
frameRateplayBackMode
linkedresume sprite
moviePathrewind sprite
Animation
These terms are useful for creating animation with Lingo:
blendlocV
inkmember (sprite property)
locregPoint
locHtweened
Behaviors
The terms in this section are useful for authoring behaviors and using behaviors while the
movie plays.
Authoring behaviors
Use these terms to set up behaviors and the behavior’s Parameters dialog box:
ancestoron getBehaviorDescription
on runPropertyDialogon getPropertyDescriptionList
on getBehaviorTooltipproperty
on isOKToAttach
Sending messages to behaviors
Use these commands to send messages to behaviors attached to sprites:
callsendSprite
callAncestorsendAllSprites
Identifying behaviors
Use these terms to identify the behaviors attached to sprites:
currentSpriteNumscriptInstanceList
mespriteNum
Chapter 14
Bitmaps
The terms in this section are useful for working with bitmaps.
Bitmap properties
Use these terms to check and set bitmap properties:
alphaThresholdforeColor
backColorpalette
blendpicture (cast member property)
depthpictureP()
ditherrect (member)
trimWhiteSpace (property)imageCompression
imageQualitymovieImageCompression
movieImageQuality
Alpha channel
Use these terms to control alpha channel effects:
alphaThresholddither
depthuseAlpha
createMask()createMatte()
extractAlpha()setAlpha()
Image objects
Use these terms to create and control image objects:
copyPixels()fill()
crop() (image object command)image
draw()image()
duplicate() (image function)rect (image)
getPixel()setPixel()
Buttons
See Buttons and check boxes in the Interface Elements section.
Lingo by Feature5
Cast members
The terms in this section are useful for working with cast members.
Creating cast members
importFileInto and new() to create cast members.
Use
Authoring
duplicate member, erase member, and pasteClipBoardInto to work with cast members
Use
during authoring.
Graphic cast members
Use these terms to check and set the images assigned to graphic cast members:
centerpalette
crop (cast member property)picture (cast member property)
depthpictureP()
mediaregPoint
General cast member properties
Use these terms to check and set cast member properties:
fileName (cast member property)number (cast member property)
mediapreLoadMode
modifiedtype (cast member property)
name (cast member property)URL
Graphic cast member dimensions
height, rect (member), and width to check and set dimensions for graphic cast members.
Use
Casts
The terms in this section are useful for working with casts.
Loading casts
preLoadMode to check and set when Director preloads a cast.
Use
Cast properties
Use these terms to specify cast properties:
castLibnumber (cast property)
fileName (cast property)number (system property)
name (cast property)
Chapter 16
Cast management
Use these terms to manage casts:
activeCastLibnumber of members
duplicate memberpasteClipBoardInto
erase membersave castLib
findEmpty()selection (cast property)
move member
Computer and operating system
Use these terms to check and control the computer:
beepfreeBlock()
beepOnfreeBytes()
cpuHogTicksmaxInteger
emulateMultiButtonMousemultiSound
floatPrecisionromanLingo
Operating system control
Use
restart and shutDown to control the operating system.
Data types
These terms are useful for specifying data types:
# (symbol)string()
float()stringP()
floatP()symbol()
integer()symbolP()
integerP()VOID
objectP()voidP()
Digital video
These terms are useful for working with AVI and QuickTime digital video:
controllertrackNextSampleTime
digitalVideoTimeScaletrackPreviousKeyTime
digitalVideoTypetrackPreviousSampleTime
directToStagetrackStartTime (sprite property)
durationtrackStartTime (cast member property)
frameRatetrackStopTime (sprite property)
loop (cast member property)trackStopTime (cast member property)
movieRatetrackText
Lingo by Feature7
movieTimetrackType (cast member property)
pausedAtStart (Flash, digital video)trackType (sprite property)
quickTimeVersion()trackCount (cast member property)
timeScaletrackCount (sprite property)
trackEnabledvideo (QuickTime, AVI)
trackNextKeyTimevideoForWindowsPresent
QuickTime
Use these terms to work with QuickTime:
enableHotSpotnodeType
fieldOfViewnudge
getHotSpotRect()pan (QTVR property)
hotSpotExitCallbackptToHotSpotID()
hotSpotEnterCallbackquickTimeVersion()
invertMaskrotation
isVRMoviescale
loopBoundsswing()
maskstaticQuality
motionQualitytilt
mouseLeveltranslation
nodetriggerCallback
nodeEnterCallbackwarpMode
nodeExitCallback
RealMedia video
Use these terms to with RealMedia video:
audio (RealMedia)play
currentTime (RealMedia)realPlayerNativeAudio()
displayRealLogorealPlayerPromptToInstall()
duration (RealMedia)realPlayerVersion()
image (RealMedia)seek
lastErrorsoundChannel (RealMedia)
mediaStatusstate (RealMedia)
passwordstop (RealMedia)
pause (RealMedia)userName (RealMedia)
pausedAtStart (RealMedia)video (RealMedia)
percentBuffered
Chapter 18
Events
Use these event handlers for Lingo that runs when a specific event occurs:
activeCastLibon moveWindow
close windowon mouseWithin
on cuePassedopen window
on deactivateWindowon prepareFrame
on enterFrameon prepareMovie
on EvalScripton resizeWindow
on exitFrameon mouseUpOutside
on idleon rightMouseDown (event handler)
on keyDownon rightMouseUp (event handler)
on keyUpon startMovie
on mouseDown (event handler)on stepFrame
on mouseEnteron streamStatus
on mouseLeaveon timeOut
on mouseUp (event handler)on zoomWindow
on stopMovieon beginSprite
on endSpriteon hyperlinkClicked
Use the
pass and stopEvent commands to override the way that Director passes messages along
the message hierarchy.
External files
The terms in this section are useful for working with external files.
Path names and filenames
Use these terms to check and set path names and filenames:
@ (pathname)getNthFileNameInFolder()
applicationPathmoviePath
fileName (cast property)searchCurrentFolder
fileName (cast member property)URL
Obtaining external media
Use these terms to obtain external media:
downloadNetThingpreloadNetThing()
importFileInto
Lingo by Feature9
Managing external files
Use these terms to manage external files:
closeXlibshowXlib
opensound playFile
openXlib
Flash
These terms are useful for working with Flash cast members:
actionsEnabledoriginV
broadcastPropspathName (movie property)
bufferSizepausedAtStart (Flash, digital video)
buttonsEnabledpercentStreamed
bytesStreamedplay
callFrame()playBackMode
centerRegPointplaying
clearErrorposterFrame
clickModeprint()
defaultRectprintAsBitmap()
defaultRectModequality
directToStagerewind sprite
endTellTarget() See tellTarget()rotation
eventPassModescale
findLabel()scaleMode
fixedRateon sendXML
flashRectsetCallback()
flashToStage()settingsPanel()
frame() (function)setFlashProperty()
frame (sprite property)setVariable()
frameCountshowProps()
frameRatesound
frameReady()the soundMixMedia
getError()sourceFileName
getFlashProperty()stageToFlash()
getFrameLabel()state (Flash, SWA)
getVariable()static
goToFramestop (Flash)
Chapter 110
hitTest()stream
holdstreamMode
imageEnabledstreamSize
linkedtellTarget()
loop (keyword)URL
mouseOverButtonviewH
newObject()viewPoint
obeyScoreRotationviewScale
originHviewV
originModevolume (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.
Frame events
Use the
on enterFrame, on exitFrame, and on prepareFrame event handlers to contain Lingo
that runs at specific events within a frame.
Frame properties
Use these Lingo terms to check and set frame properties:
frameLabelframeTempo
framePaletteframeTransition
frameScriptlabel()
frameSound1labelList
frameSound2marker()
the markerList
Lingo by Feature11
Interface elements
The Lingo terms in this section are useful for working with interface elements.
Menus
Use these terms to create menus:
enabledname (menu item property)
installMenunumber (menu items)
menunumber (menus)
name (menu property)script
Buttons and check boxes
Use these terms to specify buttons and check boxes:
alertcheckBoxType
buttonStylecheckMark
buttonTypehilite (cast member property)
checkBoxAccess
Keys
The Lingo terms in this section are related to using the keyboard.
Identifying keys
Use these terms to identify keys:
charToNum()keyPressed()
commandDownmouseChar
controlDownnumToChar()
key()optionDown
keyCode()shiftDown
Keyboard interaction
keyPressed(), lastEvent(), and lastKey to detect what the user types at the keyboard.
Use
Keyboard events
Use these terms to set up handlers that respond to pressing keys:
on keyDownkeyDownScript
on keyUpkeyUpScript
flushInputEvents
Chapter 112
Lingo
The Lingo terms in this section are important language elements that you use to construct scripts.
Boolean values
Use these terms to test whether a condition exists:
• FALSE (0 is the numerical equivalent of FALSE).
• TRUE (1 is the numerical equivalent of TRUE).
• not
• or
Script control
Use these terms to control how a script executes:
abortpass
doresult
exitscriptsEnabled
haltscriptText
nothingstopEvent
Code structures
Use
if to create if..then statements.
case, end case, and otherwise in case statements.
Use
Use these terms for repeat loops:
end repeatrepeat with
exit repeatrepeat with...down to
next repeatrepeat with...in list
repeat while
Syntax elements
Use these terms as part of Lingo’s syntax:
# (symbol)member (keyword)
" (string)of
¬ (continuation)or
-- (comment)property
() (parentheses)sprite
castLibthe
endwindow
global
Lingo by Feature13
Lists
The terms in this section are useful for working with lists.
Creating lists
[ ] (list), duplicate() (list function), or list() to create a list.
Use
Adding list items
Use these terms to add items to a list:
[ ] (bracket access)addVertex
addappend
addVertex
Deleting list items
Use these terms to delete items from a list:
deleteAlldeleteOne
deleteAtdeleteProp
Retrieving values from a list
Use these terms to retrieve values from a list:
[ ] (bracket access)getOne()
deletePropgetPos()
deletePropgetProp()
getLast()getPropAt()
Getting information about lists
Use these terms to get information about lists:
count()max()
findPosmin
findPosNearparam()
ilk()paramCount()
listP()
Setting values in a list
Use these terms to set values in a list:
[ ] (bracket access)setAt
setaPropsetProp
Chapter 114
Media synchronization
Use these terms to synchronize animation and sound:
cuePointNameson cuePassed
cuePointTimesisPastCuePoint()
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.
Idle loading
Use these terms to control idle loading:
cancelIdleLoadidleLoadPeriod
finishIdleLoadidleLoadTag
idleHandlerPeriodidleReadChunkSize
idleLoadDone()netThrottleTicks
Preloading and querying media
Use these terms to load media into memory and check whether media are available:
frameReady()preloadNetThing()
loadedpreLoadMember
mediaReadypreLoadMovie
preLoad (command)preLoadRAM
preLoad (cast member property)purgePriority
preLoadBuffer memberunLoad
preLoadEventAbortunLoadMember
preLoadModeunloadMovie
Available memory
Use these terms to check how much memory is available:
freeBlock()movieFileFreeSize
freeBytes()movieFileSize
memorySize
Lingo by Feature15
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:
puttraceLoad
showXlibtraceLogFile
traceappMinimize
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 clicks
Use these terms to detect what the user does with the mouse:
clickOnmouseLine
doubleClickmouseLoc
emulateMultiButtonMousemouseMember
lastClick()mouseOverButton
lastEvent()on mouseUp (event handler)
lastRollmouseV
mouseCharmouseWord
on mouseDown (event handler)on rightMouseDown (event handler)
mouseHon rightMouseUp (event handler)
mouseItemrollOver()
mouseLevelstillDown
Chapter 116
Mouse events
Use these terms to set up handlers that respond to mouse events:
mouseDownScripton mouseUp (event handler)
mouseUpScripton mouseUpOutside
on mouseDown (event handler)on mouseWithin
on mouseEnteron rightMouseDown (event handler)
on mouseLeaveon rightMouseUp (event handler)
Cursor control
Use
cursor (command), cursor (sprite property), and cursorSize to control the
pointer (cursor).
Movies in a window
The terms in this section are useful for working with movies in a window.
Movie in a window events
Use these event handlers to contain Lingo that you want to run in response to events in a movie
in a window:
activeCastLibon openWindow
on closeWindowon resizeWindow
on moveWindowon zoomWindow
Opening and closing movies in a window
Use these terms for opening and closing windows:
close windowopen window
forgetwindowList
Window appearance
Use these terms to check and set the appearance of a movie’s window:
drawRectsourceRect
fileName (window property)tell
frontWindowtitle
modaltitleVisible
moveToBackvisible (window property)
moveToFrontwindowPresent()
name (window property)windowType
rect (window)appMinimize
Lingo by Feature17
Communication between movies
Use the
tell command to send messages between movies.
Movies
The terms in this section are useful for managing movies.
Stopping movies
Use these terms to stop or quit the movie or projector:
exitLockquit
haltrestart
pauseStateshutDown
Movie information
Use these terms to obtain information about the movie and the movie’s environment:
environmentmoviePath
lastFramenumber (system property)
movierunMode
movieFileFreeSizesafePlayer
movieFileSizeversion
movieNamemovieFileVersion
Source control
Use these terms to manage Director projects being worked on by more than one person:
commentscreationDate
modifiedBymodifiedDate
linkAs()seconds
Saving movies
saveMovie and updateMovieEnabled to save changes to a movie.
Use
Error checking
Use the
alertHook event to post alerts that describe errors in a projector.
Movie events
Use the
on prepareMovie, on startMovie, and on stopMovie event handlers for Lingo that
responds to movie events.
Chapter 118
Multiuser server
Director MX users should use Macromedia Flash Communication Server MX for
communication among Director movies and with application servers. For more information
about using Flash Communication Server MX, see Using Flash Communication Server MX in
Using Director.
Navigation
Use these terms to jump to different locations:
delaygoToFrame
gogotoNetMovie
go loopgotoNetPage
go nextplay
go previousplay done
Network Lingo
The terms in this section are useful for working with the network.
Downloading and streaming media
Use these terms to obtain or stream media from the network:
downloadNetThing (For projectors and
authoring only)
getNetText()postNetText
gotoNetMoviepreloadNetThing()
gotoNetPage
Checking availability
frameReady() and mediaReady to check whether specific media are
Use
completely downloaded.
Using network operations
Use these terms to check the progress of a network operation or get information regarding
network media:
getStreamStatus()netMIME()
getLatestNetIDnetTextResult()
netAborton streamStatus
netDone()proxyServer
netError()tellStreamStatus()
netPresentURLEncode
netLastModDate()
Lingo by Feature19
Working with the local computer
Use these terms to work with the user’s computer:
browserName()clearCache (For projectors and
cacheDocVerify() (For projectors and
authoring only)
cacheSize() (For projectors and
authoring only)
authoring only)
getPref()
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.macromedia.com/support/director/
internet.html.
Accessing EMBED and OBJECT tag parameters
externalParamCount(), externalParamName(), and externalParamValue() to access
Use
EMBED and OBJECT parameter tags:
Operators
The terms in this section are operators available in Lingo.
Math operators
Use these terms for math statements:
* (multiplication)<> (not equal)
/ (division)> (greater than)
+ (addition)>= (greater than or equal to)
- (minus)< (less than)
= (equals)<= (less than or equal to)
Comparison operators
and, not, and or to compare expressions.
Use
Palettes and color
Use these terms to check and set palettes for movies and for cast members:
color()paletteMapping
depthpuppetPalette
palettergb()
Chapter 120
Parent scripts
Use these terms to work with parent scripts and child objects:
actorListproperty
ancestoron stepFrame
new()handler()
handlers()rawNew()
Points and rectangles
These terms are useful for checking and setting points and rectangles.
inflatequad
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.
Projectors
These terms are useful for working with projectors:
alertHookplatform
environmentrunMode
editShortCutsEnabled
Puppets
Use these terms to control the puppet property of sprites and effects channels:
puppetpuppetTempo
puppetPalettepuppetTransition
puppetSoundupdateStage
puppetSprite
Random numbers
Use random() and randomSeed to generate random numbers.
Lingo by Feature21
Score
The following terms let you work with the Score.
Score properties
lastFrame, score, and scoreSelection to work with the movie’s Score.
Use
Score generation
Use these terms to create Score content from Lingo:
beginRecordingscoreSelection
clearFramescriptNum
deleteFramescriptType
duplicateFrametweened
endRecordingupdateFrame
insertFrameupdateLock
scoreColor
Shapes
Use these Lingo terms to work with shapes:
filledpattern
lineDirectionshapeType
lineSize
Shockwave audio
Use these terms to check, stream, and play Shockwave audio sounds:
bitRateplay member
bitsPerSamplepreLoadBuffer member
copyrightInfopreLoadTime
durationsampleRate
getError()soundChannel (SWA)
getErrorString()state (Flash, SWA)
numChannelsstop member
pause (movie playback)streamName
percentPlayedURL
percentStreamedvolume (cast member property)
Chapter 122
Sound
The terms in this section are useful for playing sounds.
Sound information
Use these terms to get information about a sound:
channelCountsoundEnabled
soundvolume (sprite property)
soundBusy()isBusy()
sampleCountstatus
Playing sound
Use these terms to control how sound plays:
puppetSoundsound fadeOut
sound closesound playFile
sound fadeInsound stop
breakLoop()elapsedTime
endTimefadeIn()
fadeOut()fadeTo()
getPlaylist()setPlaylist()
loopCountloopEndTime
loopStartTimeloopsRemaining
member (sound property)pan (sound property)
pause() (sound playback)playNext()
queue()rewind()
stop() (sound)play() (sound)
RealMedia sound
See Digital video.
Sprites
The Lingo terms in this section are for sprites.
Sprite events
Use the
on beginSprite and on endSprite event handlers to contain Lingo that you want to
run when a sprite begins or ends.
Assigning cast members to sprites
castLibNum, member (sprite property), or memberNum to specify a sprite’s cast member.
Use
Lingo by Feature23
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
constraintsprite...within
Sprites and Lingo
Use these terms to manage how Lingo controls sprites:
puppetSpritespriteNum
puppetsendSprite
scriptNumsendAllSprites
scriptInstanceList
Drawing sprites on the Stage
Use these terms to control how Director draws a sprite on the Stage:
blendskew
flipHtrails
flipVtweened
inkupdateStage
quadvisible (sprite property)
rotation
Sprite dimensions
Use these terms to check and set the size of a sprite’s bounding rectangle:
bottomright
heighttop
leftwidth
quadzoomBox
You can also manipulate a sprite’s bounding rectangle with Lingo for rectangles. See Points and
rectangles.
Sprite locations
Use the
Chapter 124
loc, locH, and locV sprite properties to check and set sprite locations.
Sprite color
Use these terms to check and set a sprite’s color:
backColorcolor (sprite and cast member property)
bgColorforeColor
Stage
These terms are useful for controlling the Stage and determining its size and location:
centerStagestageColor
fixStageSizestageLeft
picture (window property)stageRight
stagestageTop
stageBottomupdateStage
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.
Manipulating strings
Use these terms to manipulate strings:
& (concatenator)put...before
&& (concatenator)put...into
deletestring()
hilite (cast member property)stringP()
put...aftertext
Chunk expressions
Use these terms to identify chunks of text:
char...ofnumber (words)
chars()offset() (string function)
containsparagraph
EMPTYref
item...ofselection (text cast member property)
itemDelimiterselectedText
last()selEnd (fields only)
length()selStart (fields only)
Lingo by Feature25
line...ofstring()
number (characters)stringP()
number (items)value()
number (lines)word...of
Editable text
Use the
editable property to specify whether text is editable.
Shocked fonts
Use these terms to include Shocked fonts with downloaded text:
recordFontbitmapSizes
originalFontcharacterSet
Character formatting
Use these terms to format text:
backColorfontf
bgColorfontSize
charSpacingfontStyle
color()foreColor
dropShadow
Paragraph formatting
Use these terms to format paragraphs:
alignmentrightIndent
bottomSpacingtabCount
firstIndenttabs
fixedLineSpacetop (3D)
leftIndentwordWrap
margin
Text cast member properties
Use these terms to work with the entire text content of a text cast member:
antiAliaskerning
antiAliasThresholdkerningThreshold
autoTabpicture (cast member property)
HTMLRTF
Lingo that applies to chunk expressions is also available to the text within a text cast member.
Chapter 126
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:
borderlineHeight() (function)
boxTypelineHeight (cast member property)
lineCountpageHeight
Scrolling text
Use these terms to work with scrolling text:
linePosToLocV()scrollByLine
locToCharPos()scrollByPage
locVToLinePos()scrollTop
Constants
Use these terms to work with constants:
BACKSPACERETURN (constant)
EMPTYVOID
ENTER
Time
The terms in this section are useful for working with time.
Current date and time
Use these terms to determine the current date and time:
abbr, abbrev, abbreviatedshort
date() (system clock)systemDate
long
Lingo by Feature27
Measuring time
Use these terms to measure time in a movie:
framesToHMS()ticks
HMStoFrames()time()
millisecondstimer
startTimer
Timeouts
Use these terms to handle timeouts:
timeoutKeyDowntimeoutMouse
timeoutLapsedtimeoutPlay
timeoutLengthtimeoutScript
name (timeout property)period
persistenttarget
time()timeout()
timeoutHandlertimeoutList
Transitions
Use these terms to work with transitions:
changeAreapuppetTransition
chunkSizetransitionType
duration
Variables
The terms in this section are useful for creating and changing variables:
Creating variables
Use these terms to create variables:
= (equals)property
global
Testing and changing variables
Use these terms to check and change the values assigned to variables:
= (equals)put
clearGlobalsset...to, set...=
globalsshowGlobals
ilk()showLocals
Chapter 128
Vector shapes
Use these Lingo terms to work with vector shapes:
addVertexgradientType
antiAliasimageEnabled
backgroundColormoveVertex()
broadcastPropsmoveVertexHandle()
centerRegPointoriginH
closedoriginMode
defaultRectoriginPoint
defaultRectModeoriginV
deleteVertex()rotation
directToStagescale
endColorscaleMode
fillColorshowProps()
fillCyclesskew
fillDirectionstatic
fillModestrokeColor
fillOffsetstrokeWidth
fillScalevertexList
flashRectviewPoint
flipHviewScale
flipVviewV
curvenewCurve()
regPointVertex
XML parsing
The following Lingo is useful for XML parsing within Director.
attributeNameignoreWhiteSpace()
attributeValuemakeList()
child (XML)makeSubList()
count()name (XML property)
doneParsing()parseString()
getError() (XML)parseURL()
Lingo by Feature29
Xtra extensions
Use these terms to work with Xtra extensions:
movieXtraListxtra
name (system property)xtraList
number of xtrasxtras
Chapter 130
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.
animationEnabledpause() (3D)
autoblendplay() (3D)
blendTimeplaying (3D)
cloneMotionFromCastmemberplaylist
countplayNext() (3D)
currentLoopStateplayRate
currentTime (3D)positionReset
deleteMotionqueue() (3D)
lockTranslationremoveLast()
motionrotationReset
nametype (motion)
newMotion()
Anti-aliasing
Use these terms to work with anti-aliasing:
antiAliasingEnabledantiAliasingSupported
31
Backdrops and overlays
Use these terms to manipulate backdrops and overlays in 3D cast members:
addBackdropregPoint (3D)
addOverlayremoveBackdrop
blend (3D)removeOverlay
countrotation (backdrop and overlay)
insertBackdropscale (backdrop and overlay)
insertOverlaysource
loc (backdrop and overlay)
Bones player modifier
Use these terms to control the functionality of the Bones player modifier:
autoblendplay() (3D)
blendTimeplaying (3D)
bonesPlayer (modifier)playlist
countplayNext() (3D)
currentTime (3D)playRate
getBoneIDqueue() (3D)
currentLoopStateremoveLast()
getWorldTransform()rootLock
lockTranslationrotationReset
positionResettransform (property)
pause() (3D)
Cameras
Use these terms to work with cameras and camera properties:
addCameraorthoHeight
addToWorldpointAt
autoCameraPositionpointAtOrientation
boundingSphereposition (transform)
cameraprojection
cameraCount()projectionAngle
cameraPositionrect (camera)
cameraRotationremoveFromWorld
clonerootNode
cloneDeeprotate
Chapter 232
countscale (transform)
deleteCameratransform (property)
fieldOfView (3D)translate
hitheruserData
isInWorld()worldPosition
nameyon
newCamera
Child and parent nodes
Use these terms to control parent-child relationships between models:
addChildcount
childparent
Collision detection
These terms are useful for detecting and responding to collisions between models:
collision (modifier)pointOfContact
collisionDataregisterForEvent()
collisionNormalregisterScript()
enabled (collision)resolve
immovableresolveA
window("Tool Panel").modal = FALSEresolveB
modelAsetCollisionCallback()
modelB
Creating and removing objects
Use these terms to create and remove objects:
add (3D texture)deleteShader
addBackdropdeleteTexture
addModifierduplicate
addOverlayinsertBackdrop
addToWorldinsertOverlay
cameranewLight
childnewMesh
clonenewModel
cloneDeepnewModelResource
cloneModelFromCastmembernewMotion()
3D Lingo by Feature33
cloneMotionFromCastmembernewShader
deleteCameranewTexture
deleteGroupremoveModifier
deleteLightremoveBackdrop
deleteModelremoveFromWorld
deleteModelResourceremoveOverlay
deleteMotion
Fog
Use these terms to work with fog:
color (fog)far (fog)
decayModefog
enabled (fog)near (fog)
Groups
Use these terms to work with groups:
addChildnewGroup
addToWorldpointAt
boundingSpherepointAtOrientation
childposition (transform)
cloneremoveFromWorld
cloneDeeprotate
countscale (transform)
deleteGrouptransform (property)
grouptranslate
isInWorld()userData
nameworldPosition
Inker modifier
Use these terms to control the functionality of the Inker modifier:
boundarylineColor
creaseAnglelineOffset
creasessilhouettes
inker (modifier)useLineOffset
Chapter 234
Keyframe player modifier
Use these terms to control the functionality of the Keyframe player modifier:
autoblendplaying (3D)
blendFactorplaylist
blendTimeplayNext() (3D)
countplayRate
currentLoopStatepositionReset
currentTime (3D)queue() (3D)
keyframePlayer (modifier)removeLast()
lockTranslationrootLock
pause() (3D)rotationReset
play() (3D)update
Level of detail modifier
Use these terms to control the functionality of the level of detail (LOD) modifier:
autolevel
biaslod (modifier)
Lights
Use these terms to work with lights and light properties:
addToWorldpointAt
ambientColorpointAtOrientation
attenuationposition (transform)
boundingSphereremoveFromWorld
color (light)rotate
countscale (transform)
clonespecular (light)
cloneDeepspotAngle
deleteLightspotDecay
directionalColortransform (property)
directionalPresettranslate
isInWorld()type (light)
lightuserData
nameworldPosition
newLight
3D Lingo by Feature35
Mesh deform modifier
Use these terms to control the functionality of the mesh deform modifier:
add (3D texture)normalList
facetextureCoordinateList
mesh (property)textureLayer
meshDeform (modifier)vertexList (mesh deform)
neighbor
Miscellaneous
clearAtRenderresetWorld
clearValuerevertToWorldDefaults
directToStagesendEvent
loadFile()setCollisionCallback()
registerForEvent()unregisterAllEvents
registerScript()revertToWorldDefaults
Model resources
Use these terms to work with 3D model resources:
countnewModelResource
deleteModelResourceresolution
modelResourceresource
nametype (model resource)
Models
Use these terms to work with 3D models:
addToWorldposition (transform)
boundingSphereremoveFromWorld
clonerenderStyle
cloneDeepresource
cloneModelFromCastmemberrotate
countscale (transform)
deleteModelshadowPercentage
isInWorld()shaderList
modeltransform (property)
modifiertranslate
Chapter 236
nameuserData
newModelvisibility
pointAtworldPosition
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.
addModifiermodifiers
countremoveModifier
modifier
Movie and system properties
Use these terms to determine the 3D capabilities of the playback computer:
active3dRenderergetRendererServices()
colorBufferDepthpreferred3DRenderer
depthBufferDepthrenderer
getHardwareInfo()rendererDeviceList
Nodes
Use these terms to manage nodes. A node is any object that exists in the world, including lights,
cameras, models, and groups.
addToWorldisInWorld()
clonename
cloneDeepremoveFromWorld
countuserData
Particle systems
See Primitives.
Picking
See Selecting models.
3D Lingo by Feature37
Primitives
The following sections list the terms used to work with each type of primitive.
Use the primitives property to determine which types of primitives are supported by the
current 3D renderer.
Boxes
Use these terms to control properties of 3D boxes:
backlength (3D)
bottom (3D)lengthVertices
frontright (3D)
height (3D)top (3D)
heightVerticeswidth (3D)
left (3D)widthVertices
Cylinders
Use these terms to control properties of 3D cylinders:
bottomCapresolution
bottomRadiusstate (3D)
endAngletopCap
height (3D)topRadius
numSegments
Meshes
Use these terms to control properties of 3D meshes:
build()normalList
colorListshadowPercentage
counttextureCoordinateList
facetextureCoordinates
generateNormals()vertexList (mesh deform)
newMesh
Particle systems
Use these terms to control properties of 3D particle systems:
angleminSpeed
blendRangewindow("Tool Panel").modal = FALSE
colorRangenumParticles
directionpath
Chapter 238
distributionpathStrength
dragregion
gravitysizeRange (contains end and start)
lifetimetexture
loop (emitter)tweenMode
maxSpeedwind
Planes
Use these terms to control properties of 3D planes:
length (3D)width (3D)
lengthVerticeswidthVertices
Spheres
Use these terms to control properties of 3D spheres:
endAngleresolution
radiusstate (3D)
Selecting models
Use these terms to enable individual models in a 3D cast member to be selected and respond to
mouse clicks. This is also known as picking.
modelsUnderLocspriteSpaceToWorldSpace
modelsUnderRayworldSpaceToSpriteSpace
modelUnderLoc
Shaders
Use these terms to work with shaders:
ambientrenderStyle
blend (3D)shadowPercentage
blendConstantshaderList
blendConstantListshadowPercentage
blendFunctionshadowStrength
blendFunctionListsilhouettes
blendSourcespecular (shader)
blendSourceListspecularColor
countspecularLightMap
deleteShaderstyle
diffusetextureMode
3D Lingo by Feature39
diffuseColortextureModeList
diffuseLightMaptextureRepeat
emissivetextureRepeatList
flattextureTransform
glossMaptextureTransformList
nametransparent
newShadertype (shader)
renderStyleuseDiffuseWithTexture
regionwrapTransformList
reflectivity
Engraver shader
Use these terms to work with the Engraver shader:
densityrotation (engraver shader)
brightness
Newsprint shader
Use these terms to work with the Newsprint shader:
densitybrightness
Painter shader
Use these terms to work with the Painter shader:
colorStepsshadowPercentage
highlightPercentageshadowStrength
highlightStrengthstyle
Sprites (3D)
rect (camera)registerForEvent()
Use these terms to control properties of 3D sprites:
Streaming
Use these terms to control the streaming of 3D cast members:
bytesStreamed (3D)state (3D)
preLoad (3D)streamSize (3D)
Chapter 240
Subdivision surfaces modifier
Use these terms to control the functionality of the subdivision surfaces (SDS) modifier:
depth (3D)sds (modifier)
enabled (sds)subdivision
errortension
Text (3D)
Use these terms to control the appearance of 3D text:
autoCameraPositiondisplayMode
bevelDepthextrude3D
bevelTypesmoothness
displayFacetunnelDepth
Textures
Use these terms to work with textures:
compressednewTexture
countquality (3D)
deleteTexturerenderFormat
height (3D)texture
membertextureRenderFormat
nametextureType
nearFilteringtype (texture)
Toon modifier
Use these terms to control the functionality of the Toon modifier:
boundarylineOffset
colorStepsshadowPercentage
creaseAngleshadowStrength
creasessilhouettes
highlightPercentagestyle
highlightStrengthtoon (modifier)
lineColoruseLineOffset
3D Lingo by Feature41
Transforms
Use these terms to work with transforms:
duplicatepreRotate
getWorldTransform()preScale()
identity()preTranslate()
interpolate()rotate
interpolateTo()rotation (transform)
inverse()scale (transform)
invert()transform (property)
multiply()translate
pointAtworldPosition
pointAtOrientationxAxis
position (transform)yAxis
preMultiplyzAxis
Vector math
Use these terms to perform vector math operations:
angleBetweengetNormalized
axisAnglemagnitude
crossnormalize
crossProduct()randomVector
distanceTo()vector()
dot()x (vector property)
dotProduct()y (vector property)
duplicatez (vector property)
Chapter 242
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.
# (symbol)
Syntax
#symbolName
Description
Symbol operator; defines a symbol, a self-contained unit that can be used to represent a condition
or flag. The value
number of alphabetical or numerical characters.
A symbol can do the following:
symbolName begins with an alphabetical character and may be followed by any
• Assign a value to a variable.
• Compare strings, integers, rectangles, and points.
• Pass a parameter to a handler or method.
• Return a value from a handler or method.
A symbol takes up less space than a string and can be manipulated, but unlike a string it does not
consist of individual characters. You can convert a symbol to a string for display purposes by using
the
string function.
The following are some important points about symbol syntax:
• Symbols are not case-sensitive.
• Symbols can’t start with a number.
• Spaces may not be used, but you can use underscore characters to simulate them.
• Symbols use the 128 ASCII characters, and letters with diacritical or accent marks are treated
as their base letter.
• Periods may not be used in symbols.
43
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:
Operator; used to test or set properties of objects, or to issue a command or execute a function of
the object. The object may be a cast member, a sprite, a property list, a child object of a parent
script, or a behavior.
Examples
This statement displays the current member contained by the sprite in channel 10:
put sprite(10).member
To use the alternate syntax and call a function, you can use this form:
myColorObject = color(#rgb, 124, 22, 233)
put myColorObject.ilk()
-- #color
- (minus)
Syntax
(Negation): -expression
Description
Math operator; reverses the sign of the value of expression.
This is an arithmetic operator with a precedence level of 5.
Syntax
(Subtraction): expression1 - expression2
Description
Math operator; performs an arithmetic subtraction on two numerical expressions, subtracting
expression2 from expression1. When both expressions are integers, the difference is an
integer. When either or both expressions are floating-point numbers, the difference is a
floating-point number.
This is an arithmetic operator with a precedence level of 3.
Chapter 344
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.
-- (comment)
Syntax
-- comment
Description
Comment delimiter; indicates the beginning of a script comment. On any line, anything that
appears between the comment delimiter (double hyphen) and the end-of-line return character is
interpreted as a comment rather than a Lingo statement.
The Director player for Java accepts Lingo that uses this delimiter, but comments do not appear
in the final Java code.
Example
This handler uses a double hyphen to make the second, fourth, and sixth lines comments:
on resetColors
-- This handler resets the sprite’s colors.
sprite(1).forecolor = 35
-- bright red
sprite(1).backcolor = 36
-- light blue
end
& (concatenator)
Syntax
expression1 & expression2
Description
String operator; performs a string concatenation of two expressions. If either expression1 or
expression2 is a number, it is first converted to a string. The resulting expression is a string.
This is a string operator with a precedence level of 2.
Be aware that Lingo allows you to use some commands and functions that take only one argument
without parentheses surrounding the argument. When an argument phrase includes an operator,
Lingo interprets only the first argument as part of the function, which may confuse Lingo.
Lingo Dictionary45
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"
("theMovie")
. Avoid this problem by placing parentheses around the entire phrase that includes
as (open window the applicationPath) &
an operator, as follows:
open window (the applicationPath & "theMovie")
The parentheses clear up Lingo’s confusion by changing the precedence by which Lingo deals with
the operator, causing Lingo to treat the two parts of the argument as one complete argument.
Examples
This statement concatenates the strings “abra” and “cadabra” and displays the resulting string in
the Message window:
put "abra" & "cadabra"
The result is the string “abracadabra”.
This statement concatenates the strings “$” and the content of the
price variable and then
assigns the concatenated string to the Price field cast member:
member("Price").text = "$" & price
&& (concatenator)
Syntax
expression1 && expression2
Description
String operator; concatenates two expressions, inserting a space character between the original
string expressions. If either
string. The resulting expression is a string.
This is a string operator with a precedence level of 2.
Examples
This statement concatenates the strings “abra” and “cadabra” and inserts a space between the two:
put "abra" && "cadabra"
The result is the string “abra cadabra”.
This statement concatenates the strings “Today is” and today’s date in the long format and inserts
a space between the two:
expression1 or expression2 is a number, it is first converted to a
put "Today is" && the long date
If today’s date is Tuesday, July 30, 2000, the result is the string “Today is Tuesday, July 30, 2000”.
Chapter 346
() (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.
Be aware that Lingo allows you to use some commands and functions that take only one argument
without parentheses surrounding the argument. When an argument phrase includes an operator,
Lingo interprets only the first argument as part of the function, which may confuse Lingo.
For example, the
open. If you use the
open window command allows one argument that specifies which window to
& 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"
("theMovie")
. Avoid this problem by placing parentheses around the entire phrase that includes
as (open window the applicationPath) &
an operator, as follows:
open window (the applicationPath & "theMovie")
Example
These statements use the grouping operator to change the order in which operations occur (the
result appears below each statement):
put (2 + 3) * (4 + 5)
-- 45
put 2 + (3 * (4 + 5))
-- 29
put 2 + 3 * 4 + 5
-- 19
* (multiplication)
Syntax
expression1 * expression2
Description
Math operator; performs an arithmetic multiplication on two numerical expressions. If both
expressions are integers, the product is an integer. If either or both expressions are floating-point
numbers, the product is a floating-point number.
This is an arithmetic operator with a precedence level of 4.
Examples
This statement multiplies the integers 2 and 3 and displays the result in the Message window:
put 2 * 3
The result is 6, which is an integer.
Lingo Dictionary47
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.
This is an arithmetic operator with a precedence level of 4.
Examples
This statement adds the integers 2 and 3 and then displays the result, 5, an integer, in the
Message window:
put 2 + 3
This statement adds the floating-point numbers 2.5 and 3.25 and displays the result, 5.7500, a
floating-point number, in the Message window:
put 2.5 + 3.25
+ (addition) (3D)
Syntax
vector1 + vector2
vector + scalar
Description
3D vector operator; adds the components of two vectors, or adds the scalar value to each
component of the vector and returns a new vector.
vector1 + vector2 adds the components of vector1 to the corresponding to components of
vector2 and returns a new vector.
vector + scalar adds the scalar value to each of the components of the vector and returns a
new vector.
- (subtraction)
Syntax
vector1 - vector2
vector - scalar
Description
3D vector operator; subtracts the components of vector2 from the corresponding components
of
vector1, or subtracts the scalar value from each of the components and returns a new vector.
Chapter 348
vector1 - vector2 subtracts the values of vector2 from the corresponding components in
vector1 and returns a new vector.
vector - scaler subtracts the value of the scalar from each of the components in the vector and
3D vector operator; multiplies the components of vector1 by the corresponding components in
vector2, and returns the dot product, or multiplies each of the components the vector by the
scalar value and returns a new vector.
vector1 * vector2 returns the dot product of the two vectors, which is not a new vector. This
operation is the same as vector1.dotproduct.vector2.
vector
* scalar multiplies each of the components in the vector by the scalar value and returns
a new vector.
transform * vector multiplies the transform by the vector and returns a new vector. The new
vector is the result of applying the positional and rotational changes defined by transform to the
vector. Note that vector * transform is not supported.
See also
dotProduct()
/ (division)
Syntax
expression1 / expression2
Description
Math operator; performs an arithmetic division on two numerical expressions, dividing
expression1 by expression2. If both expressions are integers, the quotient is an integer. If
either or both expressions are floating-point numbers, the quotient is a floating-point number.
This is an arithmetic operator with a precedence level of 4.
Examples
This statement divides the integer 22 by 7 and then displays the result in the Message window:
put 22 / 7
The result is 3. Because both numbers in the division are integers, Lingo rounds the answer down
to the nearest integer.
This statement divides the floating-point number 22.0 by 7.0 and then displays the result in the
Message window:
put 22.0 / 7.0
The result is 3.1429, which is a floating-point number.
Lingo Dictionary49
/ (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. Be aware
that comparisons performed on rects or points are handled as if the terms were lists, with each
element of the first list compared to the corresponding element of the second list.
This is a comparison operator with a precedence level of 1.
<= (less than or equal to)
Syntax
expression1 <= expression2
Description
Comparison operator; compares two expressions and determines whether expression1 is less than
or equal to expression2 (TRUE), or whether expression1 is greater than expression2 (FALSE).
This operator can compare strings, integers, floating-point numbers, rects, and points. Be aware
that comparisons performed on rects or points are handled as if the terms were lists, with each
element of the first list compared to the corresponding element of the second list.
This is a comparison operator with a precedence level of 1.
<> (not equal)
Syntax
expression1 <> expression2
Description
Comparison operator; compares two expressions, symbols, or operators and determines whether
expression1 is not equal to expression2 (TRUE), or whether expression1 is equal to
expression2 (FALSE).
This operator can compare strings, integers, floating-point numbers, rects, and points. Be aware
that comparisons performed on rects or points are handled as if the terms were lists, with each
element of the first list compared to the corresponding element of the second list.
This is a comparison operator with a precedence level of 1.
Chapter 350
= (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.
This is a comparison operator with a precedence level of 1.
> (greater than)
Syntax
expression1 > expression2
Description
Comparison operator; compares two expressions and determines whether expression1 is greater
than
expression2 (TRUE), or whether expression1 is less than or equal to expression2 (FALSE).
This operator can compare strings, integers, floating-point numbers, rects, and points. Be aware
that comparisons performed on rects or points are handled as if the terms were lists, with each
element of the first list compared to the corresponding element of the second list.
This is a comparison operator with a precedence level of 1.
>= (greater than or equal to)
Syntax
expression1 >= expression2
Description
Comparison operator; compares two expressions and determines whether expression1 is greater
than or equal to
This operator can compare strings, integers, floating-point numbers, rects, and points. Be aware
that comparisons performed on rectangles or points are handled as if the terms were lists, with
each element of the first list compared to the corresponding element of the second list.
This is a comparison operator with a precedence level of 1.
expression2 (TRUE), or whether expression1 is less than expression2 (FALSE).
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, ...]
Description
List operator; specifies that the entries within the brackets are one of four types of lists:
• Unsorted linear lists
• Sorted linear lists
• Unsorted property lists
• Sorted property lists
Each entry in a linear list is a single value that has no other property associated with it. Each entry
in a property list consists of a property and a value. The property appears before the value and is
separated from the value by a colon. You cannot store a property in a linear list. When using
strings as entries in a list, enclose the string in quotation marks.
For example, [6, 3, 8] is a linear list. The numbers have no properties associated with them.
However, [#gears:6, #balls:3, #ramps:8] is a property list. Each number has a property—in this
case, a type of machinery—associated with it. This property list could be useful for tracking the
number of each type of machinery currently on the Stage in a mechanical simulation. Properties
can appear more than once in a property list.
Lists can be sorted in alphanumeric order. A sorted linear list is ordered by the values in the list. A
sorted property list is ordered by the properties in the list. You sort a list by using the appropriate
command for a linear list or property list.
• In linear lists, symbols and strings are case sensitive.
• In property lists, symbols aren’t case sensitive, but strings are case sensitive.
A linear list or property list can contain no values at all. An empty list consists of two square
brackets ([ ]). To create or clear a linear list, set the list to
the list to [:].
[ ]. To create or clear a property list, set
You can modify, test, or read items in a list.
Chapter 352
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.
You can initialize a list in the
on prepareMovie handler or write the list as a field cast member,
assign the list to a variable, and then handle the list by handling the variable.
Not all PC keyboards have square brackets. If square brackets aren’t available, use the
list
function to create a linear list.
For a property list, create the list pieces as a string before converting them into a useful list.
myListString = numToChar(91) & ":" & numToChar(93)
put myListString
-- "[:]"
myList = myListString.value
put myList
-- [:]
put myList.listP
-- 1
myList[#name] = "Brynn"
put myList
-- [#name: "Brynn"]
Examples
This statement defines a list by making the machinery variable equal to the list:
set machinery = [#gears:6, #balls:3, #ramps:8]
This handler sorts the list aList and then displays the result in the Message window:
on sortList aList
alist.sort()
put aList
end sortList
If the movie issues the statement sortList machinery, where machinery is the list in the
preceding example, the result is [#balls:3, #gears:6, #ramps:8].
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").loaded
See also
QUOTE
¬ (continuation)
Description
The ¬ symbol is obsolete. Use the \ character instead. See \ (continuation). It is recommended
that you replace this symbol with the
\ symbol in your older scripts.
\ (continuation)
Syntax
first part of a statement on this line \
second part of the statement \
third part of the statement
Description
Continuation symbol; when used as the last character in a line, indicates that the statement
continues on the next line. Lingo then interprets the lines as one continuous statement.
Example
This statement uses the \ character to wrap the statement onto two lines:
set the memberNum of sprite mySprite \
to member "This is a long cast name."
@ (pathname)
Syntax
@pathReference
Description
Pathname operator; defines the path to the current movie’s folder and is valid on both Windows
and Macintosh computers.
Chapter 354
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.
You can build on this pathname to specify folders that are one or more levels above or below the
current movie’s folder. Keep in mind that the @ portion represents the current movie’s location,
not necessarily the location of the projector.
• Add an additional pathname separator immediately after the @ symbol to specify a folder one
level up in the hierarchy.
• Add folder names and filenames (separated by /, \, or :) after the current folder name to
specify subfolders and files within folders.
You can use relative pathnames in Lingo to indicate the location of a linked file in a folder
different than the movie’s folder.
Examples
These are equivalent expressions that specify the subfolder bigFolder, which is in the current
movie’s folder:
@/bigFolder
@:bigFolder
@\bigFolder
These are equivalent expressions that specify the file linkedFile, in the subfolder bigFolder, which
is in the current movie’s folder:
This expression specifies the file linkedFile, which is located one level up from the current
movie’s folder:
@//linkedFile
This expression specifies the file linkedFile, which is located two levels up from the current
movie’s folder:
@:::linkedFile
These are equivalent expressions that specify the file linkedFile, which is in the folder otherFolder.
The otherFolder folder is in the folder one level up from the current movie’s folder.
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
which returns to the handler from which the current handler was called.
abort command does not quit Director.
The
Example
This statement instructs Lingo to exit the handler and any handler that called it when the amount
of free memory is less than 50K:
if the freeBytes < 50*1024 then abort
See also
exit, halt, quit
exit keyword,
abs()
Syntax
abs (numericExpression)
Description
Math function; calculates the absolute value of a numerical expression. If numericExpression is
an integer, its absolute value is also an integer. If
its absolute value is also a floating-point number.
abs function has several uses. It can simplify the tracking of mouse and sprite movement by
The
converting coordinate differences (which can be either positive or negative numbers) into
distances (which are always positive numbers). The
mathematical functions, such as
Example
sqrt and log.
This statement determines whether the absolute value of the difference between the current
mouse position and the value of the variable
to use a negative number for distance). If it is, the foreground color of sprite 6 is changed.
if (the mouseV - startV).abs > 30 then sprite(6).forecolor = 95
numericExpression is a floating-point number,
abs function is also useful for handling
startV is greater than 30 (since you wouldn’t want
Chapter 356
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.
Dot syntax:
on ToggleActions whichSprite
sprite (whichSprite).actionsEnabled = not sprite
(whichSprite).actionsEnabled
end
Verbo se syntax:
on ToggleActions whichSprite
set the actionsEnabled of sprite whichSprite = not the actionsEnabled of
sprite whichSprite
end
activateApplication
Syntax
on activateApplication
Description
Built-in handler; runs when the projector is brought to the foreground. This handler is useful
when a projector runs in a window and the user can send it to the background to work with other
applications. When the projector is brought back to the foreground, this handler runs. Any
MIAWs running in the projector can also make use of this handler.
During authoring, this handler is called only if Animate in Background is turned on in
General Preferences.
On Windows, this handler is not called if the projector is merely minimized and no other
application is brought to the foreground.
Example
This handler plays a sound each time the user brings the projector back to the foreground:
deactivateApplication, activeCastLib, on deactivateWindow
Lingo Dictionary57
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
Example
on activateWindow handler.
This handler plays the sound Hurray when the window that the movie is playing in becomes active:
on activateWindow
puppetSound 2, "Hurray"
end
See also
activeWindow, close window, on deactivateWindow, frontWindow, on moveWindow, open
active3dRenderer
Syntax
the active3dRenderer
Description
3D Lingo movie property; indicates the renderer currently in use by the movie for drawing 3D
sprites. This property is equivalent to the
The possible values of the
#directX5_2, and #software. The values #openGL, #directX7_0, and #directX5_2, which are
active3DRenderer property are #openGL, #directX7_0,
video card drivers, will lead to much faster performance than #software, a software renderer used
when none of the first three options are available.
getRendererServices().renderer property.
active3dRenderer property can be tested, but not set. Use
The
getRendererServices().renderer to set this property.
Examples
These examples show the two ways to determine which renderer is currently in use.
Movie property; indicates which movie window is currently active. For the main movie,
activeWindow is the Stage. For a movie in a window, activeWindow is the movie in the window.
Example
This example places the word Active in the title bar of the clicked window and places the word
Inactive in the title bar of all other open windows:
on activateWindow
set clickedWindow = (the windowlist).getPos(the activeWindow)
set windowCount = (the windowlist).count
repeat with x = 1 to windowCount
if x = clickedWindow then
(the activeWindow).title = "Active"
else
(the windowlist[x]).title = "Inactive"
end if
end repeat
end
See also
activeCastLib, windowList
actorList
Syntax
the actorList
Lingo Dictionary59
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
Director doesn’t clear the contents of
the actorList, set actorList to [ ], which is an empty list.
actorList when branching to another movie, which can
cause unpredictable behavior in the new movie. To prevent child objects in the current movie
from being carried over to the new movie, insert the statement
on prepareMovie handler of the new movie.
Unlike previous versions of Director,
Examples
actorList is now supported in the Director player for Java.
set the actorList = [ ] in the
This statement adds a child object created from the parent script Moving Ball. All three values are
parameters that the script requires.
add the actorList, new(script "MovingBall", 1, 200,200)
This statement displays the contents of actorList in the Message window:
put the actorList
This statement clears objects from actorList.
the actorList = [ ]
See also
new()
add
Syntax
linearList.add(value)
add linearList, value
Description
List command; for linear lists only, adds the value specified by value to the linear list specified by
linearList. For a sorted list, the value is placed in its proper order. For an unsorted list, the
value is added to the end of the list.
This command returns an error when used on a property list.
Note: Don’t confuse the add command with the + operator used for addition or the & operator used to
concatenate strings.
Examples
These statements add the value 2 to the list named bids. The resulting list is [3, 4, 1, 2].
bids = [3, 4, 1]
bids.add(2)
This statement adds 2 to the sorted linear list [1, 4, 5]. The new item remains in alphanumeric
order because the list is sorted.
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:
3D camera command; adds a backdrop to the end of the camera’s list of backdrops. The
backdrop is displayed in the 3D sprite at
locWithinSprite parameter is a 2D loc measured from the upper left corner of the sprite.
locWithinSprite with the indicated rotation. The
Lingo Dictionary61
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.
3D command; adds the camera whichCamera, at the given index position, to the list of cameras
for the sprite. If index is greater than the value of cameraCount(), the camera is added to the
end of the list. The view from each camera is displayed on top of the view from cameras with
lower
index positions. You can set the rect property of each camera to display multiple views
within the sprite.
Example
This statement inserts the camera named FlightCam at the fifth index position of the list of
cameras of sprite 12:
3D command; adds the node whichChildNode to the list of children of the node
whichParentNode, and removes it from the list of children of its former parent. Either node
argument can be a model, group, camera, or light. An equivalent operation would be to set the
parent property of whichChildNode to whichParentNode.
The optional
#preserveParent. When the child is added with #preserveParent specified, the parent-relative
transform of the child remains unchanged and the child jumps to that transform in the space of its
new parent. The child’s world transform is recalculated. When the child is added with
#preserveWorld specified, the world transform of the child remains unchanged and the child does
not jump to its transform in the space of its new parent. Its parent-relative transform is recalculated.
#preserveWorld parameter has two possible values: #preserveWorld or
Chapter 362
Examples
This statement adds the model named Tire to the list of children of the model named Car.
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 parameter is a 2D loc measured from the upper left corner of the sprite.
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 an overlay at the point
(220, 220) within sprite 5. The texture has a rotation of 0 degrees. The last line of the statement
applies the same texture as an overlay for camera 1 of the cast member named Scene at the point
(20, 20). The texture has a rotation of 45 degrees.
list.addProp(property, value)
addProp list, property, value
Description
Property list command; for property lists only, adds the property specified by property and its
value specified by value to the property list specified by list. For an unsorted list, the value is
added to the end of the list. For a sorted list, the value is placed in its proper order.
If the property already exists in the list, Lingo creates a duplicate property. You can avoid
duplicate properties by using the
This command returns an error when used with a linear list.
Examples
This statement adds the property named kayne and its assigned value 3 to the property list
named
bids, which contains [#gee: 4, #ohasi: 1]. Because the list is sorted, the new entry is
placed in alphabetical order:
bids.addProp(#kayne, 3)
The result is the list [#gee: 4, #kayne: 3, #ohasi: 1].
This statement adds the entry
#kayne: 3, #ohasi: 1]. Because the list already contains the property
duplicate property:
setaProp command to change the new entry’s property.
kayne: 7 to the list named bids, which now contains [#gee: 4,
kayne, Lingo creates a
bids.addProp(#kayne, 7)
The result is the list [#gee: 4, #kayne: 3, #kayne: 7, #ohasi: 1].
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. Use the
3D world without deleting it. Use the
camera, or light has been added or removed from the world.
Example
This statement adds the model named gbCyl to the 3D world of the cast member named Scene.
member("Scene").model("gbCyl").addToWorld()
See also
isInWorld(), removeFromWorld
removeFromWorld command to take a model, group, camera, or light out of the
isInWorld() command to test whether a model, group,
Vector shape command; adds a new vertex to a vector shape cast member in the position specified.
The horizontal and vertical positions are relative to the origin of the vertex shape cast member.
When using the final two optional parameters, you can specify the location of the control handles
for the vertex. The control handle location is offset relative to the vertex, so if no location is
specified, it will be located at 0 horizontal offset and 0 vertical offset.
Example
This line adds a vertex point in the vector shape Archie between the two existing vertex points, at
the position 25 horizontal and 15 vertical:
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
string function to convert the variable to a string.
Examples
The following statement produces an alert stating that there is no CD-ROM drive connected:
alert "There is no CD-ROM drive connected."
This statement produces an alert stating that a file was not found:
alert "The file" && QUOTE & filename & QUOTE && "was not found."
See also
string(), alertHook
alertHook
Syntax
the alertHook
Description
System property; specifies a parent script that contains the on alertHook handler. Use
alertHook to control the display of alerts about file errors or Lingo script errors. When an error
occurs and a parent script is assigned to
alertHook, Director runs the on alertHook handler in
the parent script.
Although it is possible to place
on alertHook handlers in movie scripts, it is strongly
recommended that you place an on alertHook handler in a behavior or parent script to avoid
unintentionally calling the handler from a wide variety of locations and creating confusion about
where the error occurred.
Because the
handler for Lingo that isn’t involved in handling an error. For example, the
handler is a bad location for a
on alertHook handler is passed an instance argument, two string arguments that describe
The
on alertHook handler runs when an error occurs, avoid using the on alertHook
on alertHook
go to movie statement.
the error, and an optional argument specifying an additional event that invokes the handler.
Chapter 366
The fourth argument can have 1 of these 4 values:
• #alert - causes the handler to be triggered by the alert command.
• #movie - causes the handler to be triggered by a file not found error while perforoming a go to
movie
command.
• #script - causes the handler to be triggered by 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 alertHook handler can ignore the error or report it in
another way.
Example
The following statement specifies that the parent script Alert is the script that determines whether
to display alerts when an error occurs. If an error occurs, Lingo assigns the error and message
strings to the field cast member Output and returns the value 1.
on prepareMovie
the alertHook = script "Alert"
end
-- parent script "Alert"
on alertHook me, err, msg
member("Output").text = err && msg
return 1
end
See also
safePlayer
alignment
Syntax
member(whichCastMember).alignment
the alignment of member whichCastMember
Description
Cast member property; determines the alignment used to display characters within the specified
cast member. This property appears only to field and text cast members containing characters, if
only a space.
For field cast members, the value of the property is a string consisting of one of the following: left,
center, or right.
For text cast members, the value of the property is a symbol consisting of one of the following:
#left, #center, #right, or #full.
The parameter
whichCastMember can be either a cast name or a cast number.
This property can be tested and set. For text cast members, the property can be set on a perparagraph basis.
Examples
This statement sets the variable named characterAlign to the current alignment setting for the
field cast member Rokujo Speaks:
TRUE one or the other volume control is active, and is disabled when the property is
TRUE, and can be tested and set.
Lingo Dictionary69
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
member(whichMember).alphaThreshold
the alphaThreshold of member whichMember
Description
Bitmap cast member property; governs how the bitmap’s alpha channel affects hit detection. This
property is a value from 0 to 255, that exactly matches alpha values in the alpha channel for a 32bit bitmap image.
For a given
map at that point is equal to or greater than the threshold. Setting the
alphaThreshold setting, Director detects a mouse click if the pixel value of the alpha
alphaThreshold to 0
makes all pixels opaque to hit detection regardless of the contents of the alpha channel.
3D #standard shader property; indicates how much of each color component of the ambient
light in the cast member is reflected by the shader.
For example, if the color of the ambient light is
ambient property of the shader is rgb(255, 0, 0), the shader will reflect all of the red
component of the light that the shader’s colors can reflect. However, it will reflect none of the
blue and green components of the light, regardless of the colors of the shader. In this case, if there
are no other lights in the scene, the blue and green colors of the shader will reflect no light, and
will appear black.
rgb(255, 255, 255) and the value of the
The default value of this property is
Chapter 370
rgb(63,63,63).
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.
ambientColor, newLight, type (light), diffuse, specular (shader)
ambientColor
Syntax
member(whichCastmember).ambientColor
Description
3D cast member property; indicates the RGB color of the default ambient light of the
cast member.
The default value for this property is rgb(0, 0, 0). This adds no light to the scene.
Example
This statement sets the ambientColor property of the cast member named Room to rgb(255, 0,
0). The default ambient light of the cast member will be red. This property can also be set in the
Property inspector.
member("Room").ambientColor = rgb(255, 0, 0)
See also
directionalColor, directionalPreset, ambient
ancestor
Syntax
property {optionalProperties} ancestor
Description
Object property; allows child objects and behaviors to use handlers that are not contained within
the parent script or behavior.
The
ancestor property is typically used with two or more parent scripts. You can use this
property when you want child objects and behaviors to share certain behaviors that are inherited
from an ancestor, while differing in other behaviors that are inherited from the parents.
For child objects, the
parent script. Sending a message to a child object that does not have a defined handler forwards
that message to the script defined by the
If a behavior has an ancestor, the ancestor receives mouse events such as
mouseWithin.
ancestor property is usually assigned in the on new handler within the
ancestor property.
mouseDown and
ancestor property lets you change behaviors and properties for a large group of objects with
The
a single command.
Lingo Dictionary71
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 thevariableName of scriptName to access property variables that are not
contained within the current object. This statement allows the variable
child object to access the property variable
set myLegCount to the legCount of me
Example
legCount within the ancestor script:
myLegCount within the
Each of the following scripts is a cast member. The ancestor script Animal and the parent scripts
Dog and Man interact with one another to define objects.
The first script, Dog, sets the property variable
Animal script, and sets the
property breed, ancestor
on new me
set breed = "Mutt"
set the ancestor of me to new(script "Animal")
set the legCount of me to 4
return me
end
legCount variable that is stored in the ancestor script to 4:
breed to Mutt, sets the ancestor of Dog to the
The second script, Man, sets the property variable race to Caucasian, sets the ancestor of Man
to the Animal script, and sets the
property race, ancestor
on new me
set race to "Caucasian"
set the ancestor of me to new(script "Animal")
set the legCount of me to 2
return me
end
See also
new(), me, property
legCount variable that is stored in the ancestor script to 2:
and
Syntax
logicalExpression1 and logicalExpression2
Description
Logical operator; determines whether both logicalExpression1 and logicalExpression2 are
TRUE (1), or whether either or both expressions are FALSE (0).
The precedence level of this logical operator is 4.
Examples
This statement determines whether both logical expressions are TRUE and displays the result in the
Message window:
put 1 < 2 and 2 < 3
Chapter 372
The result is 1, which is the numerical equivalent of TRUE.
The first logical expression in the following statement is
FALSE. Because both logical expressions are not TRUE, the logical operator displays the result 0,
3D emitter property; describes the area into which the particles of a particle system are emitted. A
particle system is a model resource whose type is
The primary direction of particle emission is the vector set by the emitter’s direction property.
However, the direction of emission of a given particle will deviate from that vector by a random
angle between 0 and the value of the emitter’s
The effective range of this property is 0.0 to 180.0. The default value is 180.0.
#particle.
angle property.
Example
This statement sets the angle of emission of the model resource named mrFount to 1, which
causes the emitted particles to form a thin line.
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
Example
TRUE.
This statement disables animation for the cast member named Scene.
Cast member property; controls whether a text, Vector shape, or Flash cast member is rendered
using anti-aliasing to produce high-quality rendering, but possibly slower playback of the movie.
antiAlias property is TRUE by default.
The
For vector shapes,
is the equivalent of
antiAlias property may also be used as a sprite property only for Vector shape sprites.
The
This property can be tested and set.
Example
This behavior checks the color depth of the computer on which the movie is playing. If the color
depth is set to 8 bits or less (256 colors), the script sets the
TRUE is the equivalent of the #high quality setting for a Flash asset, and FALSE
#low.
antiAlias property of the sprite to FALSE.
property spriteNum
on beginsprite me
if the colorDepth <= 8 then
sprite(spriteNum).antiAlias = FALSE
end if
end
See also
antiAliasThreshold, quality
antiAliasingEnabled
Syntax
sprite(whichSprite).antiAliasingEnabled
Type
3D sprite property.
Chapter 374
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
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, indicating that anti-aliasing is off. If the
FALSE. The value of this property is not saved
when the movie is saved.
Anti-aliased sprites use more processor power and memory than sprites that are not anti-aliased.
Temporarily turning off anti-aliasing can improve the performance of animations and user
interaction.
Example
This Lingo checks whether the currently running 3D renderer for sprite 2 supports anti-aliasing
with the
turns on anti-aliasing for the sprite with the
antiAliasingSupported property. If anti-aliasing is supported, the second statement
antiAliasingEnabled property.
sprite(2).antiAliasingEnabled = TRUE
antiAliasingSupported
Syntax
sprite(whichSprite).antiAliasingSupported
Type
3D sprite property.
Description
This property indicates whether anti-aliasing is supported by the current 3D renderer. This
property can be tested but not set. This property returns either
Example
TRUE or FALSE.
This Lingo checks whether the currently running 3D renderer for sprite 3 supports anti-aliasing.
If anti-aliasing is supported, the second statement turns on anti-aliasing for the sprite with the
antiAliasingEnabled property.
if sprite(3).antiAliasingSupported = TRUE then
sprite(3).antiAliasingEnabled = TRUE
end if
See Also
antiAliasingEnabled, renderer, rendererDeviceList
Lingo Dictionary75
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.append(value)
append list, value
Description
List command; for linear lists only, adds the specified value to the end of a linear list. This differs
from the
add command, which adds a value to a sorted list according to the list’s order.
This command returns a script error when used with a property list.
Example
This statement adds the value 2 at the end of the sorted list named bids, which contains [1, 3, 4],
even though this placement does not match the list’s sorted order:
set bids = [1, 3, 4]
bids.append(2)
The resulting value of bids is [1, 3, 4, 2].
See also
add (3D texture), sort
applicationPath
Syntax
the applicationPath
Description
System property; determines the path or location of the folder containing the running copy of the
Director application during authoring, or the folder containing the projector during run time.
The property value is a string.
If you use
expression in parentheses so that Lingo parses the expression as one phrase.
the applicationPath followed by & and a path to a subfolder, enclose the entire
The Director player for Java doesn’t support this property, nor does Shockwave.
This property can be tested but not set.
Chapter 376
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.
On the Macintosh,
may be re-opened from the Macintosh application menu.
This is useful for projectors and MIAWs that play back without a title bar.
See also
windowType
appMinimize causes a projector to be hidden. Once hidden, the projector
atan()
Syntax
(number).atan
atan (number)
Description
Math function; calculates the arctangent, which is the angle whose tangent is a specified number.
The result is a value in radians between pi/2 and +pi/2.
Examples
This statement displays the arctangent of 1:
(1).atan
The result, to four decimal places, is 0.7854, or approximately pi/4.
Note that most trigonometric functions use radians, so you may want to convert from degrees
to radians.
This handler lets you convert between degrees and radians:
on DegreesToRads degreeValue
return degreeValue * PI/180
end
The handler displays the conversion of 30 degrees to radians in the Message window:
RealMedia sprite or cast member property; allows you to play (TRUE) or mute (FALSE) the audio
in the RealMedia stream. The default setting for this property is
than 1 or 0 are treated as TRUE (1). Setting this property has no effect if the
realPlayerNativeAudio() function is set to TRUE.
If the audio property is set to FALSE when a RealMedia cast member starts playing, a sound
channel is still allocated, which allows you to toggle the sound on and off during playback.
There may be some latency involved in setting this property, which means there may be a slight
delay before the sound toggles on or off.
Examples
The following examples show that the audio properties for sprite 2 and the cast member Real is
set to
TRUE, which means that the audio portion of the RealMedia stream will be played.
put sprite(2).audio
-- 1
put member("Real").audio
-- 1
TRUE (1). Integer values other
Lingo Dictionary79
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.
3D lod modifier property; allows the modifier to manage the reduction of detail in the model as
the distance between the model and the camera changes.
The setting of the modifier’s
detail from the model when the
bias property determines how aggressively the modifier removes
auto property is set to TRUE.
The modifier updates its level property as it adjusts the model’s level of detail. Setting the level
property has no effect unless the
#lod modifier can only be added to models created outside of Director in 3D modeling
The
programs. The value of the
#fromFile. The modifier cannot be added to primitives created within Director.
Example
auto property is set to FALSE.
type property of the model resources used by these models is
This statement sets the auto property of the lod modifier of the model named Spaceship to TRUE.
The modifier will automatically set the model’s level of detail.
3D keyframePlayer and bonesPlayer modifier property; indicates whether the modifier creates
a linear transition to the currently playing motion from the motion that preceded it
(FALSE). If autoBlend is TRUE, the length of the transition is set by the blendTime property
not
of the modifier. If
of the modifier and
autoBlend is FALSE, the transition is controlled by the blendFactor property
blendTime is ignored.
Motion blending is completely disabled when
The default value of this property is
Chapter 380
(TRUE) or
blendTime is set to 0 and autoBlend is set to TRUE.
TRUE.
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.
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). This is useful when changing the text,
font, fontsize, and other properties of the cast member.
This property is not valid with other types of 3D cast members.
Example
This statement sets the autoCameraPosition property of the cast member named Headline to
FALSE. When the cast member is displayed in 3D mode, the camera will not be positioned
automatically.
member("Headline").autoCameraPosition = FALSE
See also
displayMode
autoMask
Syntax
member(whichCursorCastMember).autoMask
the autoMask of member whichCastMember
Description
Cast member property; specifies whether the white pixels in the animated color cursor cast
member
TRUE, default), or opaque (FALSE).
(
Example
In this script, when the custom animated cursor stored in cast member 5 enters the sprite, the
automask is turned on so that the background of the sprite will show through the white pixels.
When the cursor leaves the sprite, the automask is turned off.
Using dot syntax, the script is written as:
on mouseEnter
end
whichCursorCastMember are transparent, allowing the background to show through
member 5.autoMask = TRUE
on mouseLeave
member 5.autoMask = FALSE
end
Lingo Dictionary81
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 (
This property is always TRUE in an applet created with the Save as Java feature of Director.
Example
This statement causes the cast member Comments to automatically advance the insertion point
to the next editable field or text sprite after the user presses Tab.
FALSE). Tabbing order depends on sprite number order, not position on the Stage.
bottom (3D), front, top (3D), left (3D), right (3D)
backColor
Syntax
member(whichCastMember).backColor = colorNumber
set the backColor of member whichCastMember to colorNumber
sprite(whichSprite).backColor
the backColor of sprite whichSprite
Description
Cast member and sprite property; sets the background color of the specified cast member or sprite
according to the color value assigned.
• For cast members: it affects field or button cast member displays.
• For sprites: setting the backColor of a sprite is the same as choosing the background color
from the tool palette when the sprite is selected on the Stage. For the value that Lingo sets to
last beyond the current sprite, the sprite must be a puppet. The background color applies only
to 1-bit bitmap and shape cast members.
The
backColor value ranges from 0 to 255 for 8-bit color and from 0 to 15 for 4-bit color. The
numbers correspond to the index number of the background color in the current palette. (A
color’s index number appears in the color palette’s lower left corner when you click the color.)
You should not apply this property to bitmap cast members deeper than 1-bit, as the results are
difficult to predict.
For a movie that plays back as an applet created with the Save as Java feature of Director, specify
colors for
HTML document.
For example, the hexadecimal value for pure red, FF0000, is equivalent to 16711680 in decimal
numbers. This statement specifies pure red as a cast member’s background color:
set the backColor of member = 16711680
This property can be tested and set.
Note: It is recommended that the newer bgColor property be used instead of the backColor property.
backColor using the decimal equivalent of the 24-bit hexadecimal values used in an
Lingo Dictionary83
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
Verbo se Lingo synt ax :
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:
3D camera property; a 2D image that is rendered on the camera’s projection plane. All models in
the camera’s view appear in front of the backdrop.
Backdrops have the following properties:
Note: These properties can also be used to get, set, and manipulate overlays. See the individual property entries for
detailed information.
loc (backdrop and overlay) indicates the 2D location of the backdrop, as measured from the upper
left corner of the sprite.
source indicates the texture used by the backdrop.
scale (backdrop and overlay) is the number by which the height and width of the texture are
multiplied to determine the dimensions of the backdrop.
rotation (backdrop and overlay) is the amount by which the backdrop is rotated about its regPoint.
Chapter 384
regPoint (3D)
blend (3D) indicates the opacity of the backdrop.
count indicates the number of items in the camera’s list of backdrops.
indicates the registration point of the backdrop.
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.
insertBackdrop creates a backdrop from a texture and adds it to the camera’s list of backdrops at a
specific index position.
removeBackdrop deletes the backdrop.
See also
overlay
backgroundColor
Syntax
member(whichVectorMember).backgroundColor
the backgroundColor of member whichVectorMember
Description
Vector shape cast member property; sets the background color of the specified cast member or
sprite to the RGB color value assigned.
Constant; represents the Backspace key. This key is labeled Backspace in Windows and Delete on
the Macintosh.
Example
This on keyDown handler checks whether the Backspace key was pressed and, if it was, calls the
handler
on keyDown
end keyDown
clearEntry:
if the key = BACKSPACE then clearEntry
stopEvent
Lingo Dictionary85
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
This statement causes two beeps if the Answer field is empty:
if field "Answer" = EMPTY then beep 2
beepOn
Syntax
the beepOn
Description
Movie property; determines whether the computer automatically beeps when the user clicks on
anything except an active sprite (
TRUE), or not (FALSE, default).
Scripts that set
beepOn should be placed in frame or movie scripts.
This property can be tested and set.
Examples
This statement sets beepOn to TRUE:
the beepOn = TRUE
This statement sets beepOn to the opposite of its current setting:
the beepOn = not the beepOn
before
See
put...before
beginRecording
Syntax
beginRecording
Description
Keyword; starts a Score generation session. Only one update session in a movie can be active at a time.
beginRecording keyword must be matched by an endRecording keyword that ends the
Every
Score generation session.
Chapter 386
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
on animBall numberOfFrames
beginRecording
horizontal = 0
vertical = 100
repeat with i = 1 to numberOfFrames
go to frame i
sprite(20).member = member "Ball"
sprite(20).locH = horizontal
sprite(20).locV = vertical
sprite(20).type = 1
sprite(20).foreColor = 255
horizontal = horizontal + 3
vertical = vertical + 2
updateFrame
end repeat
endRecording
end
See also
endRecording, updateFrame, scriptNum, tweened
numberOfFrames.
on beginSprite
Syntax
on beginSprite
statement(s)
end
Description
System message and event handler; contains statements that run when the playhead moves to a
frame that contains a sprite that was not previously encountered. Like
generated only one time, even if the playhead loops on a frame, since the trigger is a sprite not
previously encountered by the playhead. The event is generated before
Director creates instances of any behavior scripts attached to the sprite when the beginSprite
message is sent.
The object reference
me is passed to this event if it is used in a behavior. The message is sent to
behaviors and frame scripts.
If a sprite begins in the first frame that plays in the movie, the
prepareMovie message but before the prepareFrame and startMovie messages.
the
Note: Be aware that some sprite properties, such as the rect sprite property, may not be accessible in a
beginSprite handler. This is because the property needs to be calculated, which is not done until the sprite is drawn.
beginSprite message is sent after
The go, play, and updateStage commands are disabled in an on beginSprite handler.
endSprite, this event is
prepareFrame.
Lingo Dictionary87
Example
This handler plays the sound cast member Stevie Wonder when the sprite begins:
3D text property; indicates the degree of beveling on the 3D text.
For text cast members, this property has no effect unless the member’s displayMode property is
#mode3D and its bevelType property is set to #miter or #round.
set to
For extruded text in a 3D cast member, this property has no effect unless the model resource’s
bevelType property is set to #miter or #round.
The range of this property is 0.0 to 10.0, and the default setting is 10.0.
Example
In this example, the cast member named Logo is a text cast member. This statement sets the
bevelDepth of logo to 5.5. When logo is displayed in 3D mode, if its bevelType property is set
to
#miter or #round, the edges of its letters will exhibit dramatic beveling.
member("Logo").bevelDepth = 5.5
In this example, the model resource of the model named Slogan is extruded text. This statement
sets the
#miter or #round, the edges of its letters will exhibit dramatic beveling.
member("scene").model("Slogan").resource.bevelDepth = 5
See also
bevelType, extrude3D, displayMode
bevelDepth of Slogan’s model resource to 5. If the bevelType property of Slogan is set to
3D text property; indicates the style of beveling applied to the 3D text.
For text cast members, this is a member property. For extruded text in a 3D cast member, this is a
model resource property.
Chapter 388
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
sprite(whichSpriteNumber).bgColor
the bgColor of sprite whichSpriteNumber
the bgColor of the stage
(the stage).bgColor
member(which3dMember).bgcolor
Description
Sprite property, system property, and 3D cast member property; determines the background color
of the sprite specified by whichSprite, the color of the Stage, or the background color of the 3D
cast member. Setting the
from the Tools window when the sprite is selected on the Stage. Setting the
bgColor sprite property is equivalent to choosing the background color
bgColor property for
the Stage is equivalent to setting the color in the Movie Properties dialog box.
The sprite property has the equivalent functionality of the
backColor sprite property, but the
color value returned is a color object of whatever type has been set for that sprite.
This property can be tested and set.
Example
This example sets the color of the Stage to an RGB value.
Dot syntax:
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
The range for this property is from 0.0 (removes all polygons) to +100.0 (removes no polygons).
The default setting is 100.0.
The
#lod modifier can only be added to models created outside of Director in 3D modeling
programs. The value of the
#fromFile. The modifier cannot be added to primitives created within Director.
Example
This statement sets the bias property of the lod modifier of the model named Spaceship to 10. If
lod modifier’s auto property is set to TRUE, the modifier will very aggressively lower the level
the
of detail of Spaceship as it moves away from the camera.
type property of the model resources used by these models is
bitAnd()
Syntax
bitAnd(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 both numbers 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.
IntegerBinary number (abbreviated)
600110
700111
Result
600110
Example
This statement compares the binary versions of the integers 6 and 7 and returns the result as an
integer:
put bitAnd(6, 7)
-- 6
See also
bitNot(), bitOr(), bitXor()
Chapter 390
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).bitNot
bitNot(integer)
Description
Function; converts the specified integer to a 32-bit binary number and reverses the value of each
binary digit, replacing 1’s with 0’s and 0’s with 1’s. The result is the new binary number, which
Lingo displays as a base 10 integer.
IntegerBinary number
100000000000000000000000000000001
Result
-211111111111111111111111111111110
Example
This statement inverts the binary representation of the integer 1 and returns a new number.
put (1).bitNot
-- -2
See also
bitAnd(), bitOr(), bitXor()
Lingo Dictionary91
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.
IntegerBinary number (abbreviated)
50101
60110
Result
70111
Example
This statement compares the 32-bit binary versions of 5 and 6 and returns the result as an integer:
put bitOr(5, 6)
-- 7
See also
bitNot(), bitAnd(), bitXor()
bitRate
Syntax
member(whichCastMember).bitRate
the bitRate of member whichCastMember
Description
Shockwave Audio (SWA) cast member property; returns the bit rate, in kilobits per second
(Kbps), of the specified SWA cast member that has been preloaded from the server.
The
bitRate member property returns 0 until streaming begins.
Example
This behavior outputs the bit rate of an SWA cast member when the sprite is first encountered.
Dot syntax:
property spriteNum
on beginSprite me
memName = sprite(spriteNum).member.name
put "The bitRate of member"&&memName&&"is"&&member(memName).bitRate
end
Chapter 392
Verbo se 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). This property is available only after the SWA
sound begins playing or after the file has been preloaded using the
This property can be tested but not set.
Example
This statement assigns the original bit rate of the file used in SWA streaming cast member Paul
Robeson to the field cast member How Deep.
preLoadBuffer command.
Dot syntax:
put member "Paul Robeson".bitsPerSample into member "How Deep"
Verbo se syntax:
put the bitsPerSample of member "Paul Robeson" into member "How Deep"
bitXor()
Syntax
bitXor(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 the given numbers’ digits do not match, and
0’s in the positions where the digits are the same. The result is the new binary number, which
Lingo displays as a base 10 integer.
IntegerBinary number (abbreviated)
50101
60110
Result
30011
Lingo Dictionary93
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.
The Director player for Java supports the
blend sprite property for bitmap sprites only.
For best results, use the blend ink with images that have a color depth greater than 8-bit.
Examples
The following statement sets the blend value of sprite 3 to 40 percent.
Dot syntax:
sprite(3).blend = 40
Verbo se syntax:
set the blend of sprite 3 to 40
This statement displays the blend value of sprite 3 in the Message window:
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. Each index
position in the blend constant list controls blending for the texture at the corresponding index
position in the texture list. You can set all index positions of the list to the same value at one time
by not specifying the optional
position at a time.
blendConstantList property works only when the blendSource property of the
The
corresponding texture layer is set to #constant.
The range of this property is 0 to 100; the default is 50.
Example
In this example, the shader list of the model named MysteryBox contains six shaders. This
statement shows the
blendConstant property of each of the textures used by the second shader.
This property is affected by the settings of the
blendSource, and blendSourceList properties.
index parameter. Use the index parameter to set the list one index
blendFunction, blendFunctionList,
put member("Level2").model("MysteryBox").shaderList[2].\
3D keyframePlayer and bonesPlayer modifier property; indicates the amount by which a
motion is combined with the motion that preceded it.
The range of this property is 0 to 100, and the default value is 0.
Chapter 396
BlendFactor is used only when the autoblend property of the modifier is set to FALSE. If the
value of the
blendFactor property is 100, the current motion will have none of the
characteristics of the motion that preceded it. If the value of blendFactor is 0, the current
motion will have all of the characteristics of the motion that preceded it and none of its own. If
the value of
blendFactor is 50, the current motion will be a synthesis equally composed of its
own characteristics and those of the motion that preceded it. The value blendFactor can be
varied over time to create transitions unlike the linear transition created when the modifier’s
autoblend property is set to TRUE.
Example
This statement sets the blendFactor property of model Alien3 to 50. If the modifier’s
autoblend property is FALSE, each motion in the playlist of the keyframePlayer for Alien3 will
be an even mixture of itself and the motion that preceded it.
3D #standard shader property; a linear list that indicates the manner in which each texture layer
blends with the texture layer below it.
The shader’s texture list and blend function list both have eight index positions. Each index
position in the blend function list controls blending for the texture at the corresponding index
position in the texture list. You can set all index positions of the list to the same value at one time
by not specifying the optional
index parameter. Use the index parameter to set the list one index
position at a time.
Each index position of the blend function list can have one of the following values:
#multiply multiplies the RGB values of the texture layer by the RGB values of the texture layer
below it.
#add adds the RGB values of the texture layer to the RGB values of the texture layer below it, and
then clamps to 255.
#replace causes the texture to cover the texture layer below it. No blending occurs.
#blend causes blending to be controlled by the value of the blendSource property, which allows
alpha blending.
The default value of this property is
Example
#multiply.
In this example, the shaderList property of the model named MysteryBox contains six shaders. This
statement shows that the value of the fourth index position of the
the second shader is set to
model will be controlled by the settings of the
blendConstantList, diffuse, diffuseColor, and useDiffuseWithTexture properties.
#blend. Blending of the fourth texture layer of the second shader of the
blendSource, blendSourceList, blendConstant,
blendFunctionList property of
put member("Level2").model("MysteryBox").shaderList[2].\
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.
3D property; when used with a model resource whose type is #particle, allows you to get or set
the start and end of the model resource’s blend range.
The opacity of particles in the system is interpolated linearly between
blendRange.end over the lifetime of each particle.
This property’s value must be greater than or equal to 0.0 and less than or equal to 100.0. The
default value for this property is 100.0.
blendRange.start and
Example
This statement sets the blendRange properties of model resource ThermoSystem, which is of the
type #particle.
The first line sets the start value to 100, and the second line sets the end value to 0. The effect of
this statement is that the particles of ThermoSystem are fully opaque when they first appear, and
then gradually fade to transparent during their lifetime.
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.
If the shader’s
useDiffuseWithTexture property is set to TRUE, the texture blends with the color
set by the shader’s diffuse property. If useDiffuseWithTexture is FALSE, white is used for
blending.
Each of the other texture layers blends with the texture layer below it. Use the
blendSourceList
property to control blending in those texture layers.
blendSource property works only when the shader’s blendFunction property is set to
The
#blend.
The possible values of this property are as follows:
#alpha causes the alpha information in the texture to determine the blend ratio of each pixel of
the texture with the color being used for blending (see above).
#constant causes the value of the shader’s blendConstant property to be used as the blend ratio
for all the pixels of the texture.
The default value of this property is
Example
#constant.
In this example, the shader list of the model named MysteryBox contains six shaders. This
statement sets the
#constant. This enables the settings of the blendConstant and blendConstantList properties.
member("Level2").model("MysteryBox").shaderList[2].\
blendSource = #constant
blendSource property of the first texture used by the second shader to