Detailed instructions for use are in the User's Guide.
[. . . ] Lingo Dictionary
Macromedia Director MX
Trademarks Afterburner, AppletAce, Attain, Attain Enterprise Learning System, Attain Essentials, Attain Objects for Dreamweaver, Authorware, Authorware Attain, Authorware Interactive Studio, Authorware Star, Authorware Synergy, Backstage, Backstage Designer, Backstage Desktop Studio, Backstage Enterprise Studio, Backstage Internet Studio, Contribute, Design in Motion, Director, Director Multimedia Studio, Doc Around the Clock, Dreamweaver, Dreamweaver Attain, Drumbeat, Drumbeat 2000, Extreme 3D, Fireworks, 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. [. . . ] Lingo stops searching when it reaches the first location that has an on mouseDown handler, unless the handler includes the pass command to explicitly pass the mouseDown message on to the next location.
mouseDownScript
To have the same response throughout the movie when pressing the mouse button, set or put a mouseDown handler in a Movie script.
The on mouseDown event handler is a good place to put Lingo that flashes images, triggers sound effects, or makes sprites move when the user presses the mouse button. Where you place an on
mouseDown
handler can affect when it runs.
To apply the handler to a specific sprite, put it in a sprite script. To apply the handler to a cast member in general, put it in a cast member script. To apply the handler throughout the entire movie, put it in a movie script.
You can override an on mouseDown handler by placing an alternative on mouseDown handler in a location that Lingo checks before it gets to the handler you want to override. For example, you can override an on mouseDown handler assigned to a cast member by placing an on mouseDown handler in a sprite script. If used in a behavior, this event is passed the sprite script or frame script reference me.
391
Examples
This handler checks whether the user clicks anywhere on the Stage and sends the playhead to another frame if a click occurs:
on mouseDown if the clickOn = 0 then go to frame "AddSum" end
This handler, assigned to a sprite script, plays a sound when the sprite is clicked:
on mouseDown puppetSound "Crickets" end
See also
clickOn, mouseDownScript, mouseUpScript
the mouseDown (system property)
Syntax
the mouseDown
Description
System property; indicates whether the mouse button is currently being pressed (TRUE) or not (FALSE). The Director player for Java doesn't update the mouseDown property when Lingo is in a repeat loop. If you try to test mouseDown inside a repeat loop in an applet, the applet hangs.
Example
This handler causes the movie to beep until the user clicks the mouse:
on enterFrame repeat while the mouseDown = FALSE beep end repeat end
This statement instructs Lingo to exit the repeat loop or handler it is in when the user clicks the mouse:
if the mouseDown then exit
See also
mouseH, the mouseUp (system property), mouseV, on mouseDown (event handler), on mouseUp
(event handler)
mouseDownScript
Syntax
the mouseDownScript
Description
System property; specifies the Lingo that is executed when the mouse button is pressed. The Lingo is written as a string, surrounded by quotation marks and can be a simple statement or a calling script for a handler. The default value is EMPTY, which means that the mouseDownScript property has no Lingo assigned to it.
392
When the mouse button is pressed and the mouseDownScript property is defined, Lingo executes the instructions specified for the mouseDownScript property first. No other on mouseDown handlers are executed, unless the instructions include the pass command so that the mouseDown message can be passed to other objects in the movie. Setting the mouseDownScript property performs the same function as the when command in earlier versions of Director.
set the mouseDownScript to empty. keyDown then
To turn off the instructions you've specified for the mouseDownScript property, use the statement This property can be tested and set.
Example
In this statement, when the user clicks the mouse button, the playhead always branches to the next marker in the movie:
the mouseDownScript = "go next"
In this statement, when the user clicks anywhere on the Stage, the computer beeps:
the mouseDownScript = "if the clickOn = 0 then beep"
The following statement sets mouseDownScript to the custom handler myCustomHandler. A Lingo custom handler must be enclosed in quotation marks when used with the mouseDownScript property.
the mouseDownScript = "myCustomHandler"
See also
stopEvent, mouseUpScript, on mouseDown (event handler), on mouseUp (event handler)
on mouseEnter
Syntax
on mouseEnter statement(s) end
Description
System message and event handler; contains statements that run when the mouse pointer first contacts the active area of the sprite. If the sprite is a bitmap cast member with matte ink applied, the active area is the portion of the image that is displayed; otherwise, the active area is the sprite's bounding rectangle. If used in a behavior, this event is passed the sprite script or frame script reference me.
393
Example
This example is a simple button behavior that switches the bitmap of the button when the mouse rolls over and then off the button:
property spriteNum on mouseEnter me -- Determine current cast member and switch to next in cast currentMember = sprite(spritenum). member. number sprite(spritenum). member = currentMember + 1 end on mouseLeave me -- Determine current cast member and switch to previous in cast currentMember = sprite(spritenum). member. number sprite(spritenum). member = currentMember - 1 end
See also
on mouseLeave, on mouseWithin
mouseH
Syntax
the mouseH mouseH()
Description
System property and function; indicates the horizontal position of the mouse pointer. The value of mouseH is the number of pixels the cursor is positioned from the left edge of the Stage. The mouseH function is useful for moving sprites to the horizontal position of the mouse pointer and checking whether the pointer is within a region of the Stage. Using the mouseH and mouseV functions together, you can determine the cursor's exact location. The Director player for Java doesn't update the mouseH function when Lingo is in a repeat loop. This function can be tested but not set.
Examples
This handler moves sprite 10 to the mouse pointer location and updates the Stage when the user clicks the mouse button:
on mouseDown sprite(10). locH = the mouseH sprite(10). locV = the mouseV updateStage end
This statement tests whether the pointer is more than 10 pixels to the right or left of a starting point and, if it is, sets the variable Far to TRUE:
if abs(mouseH() - startH) > 10 then draggedEnough = TRUE
See also
locH, locV, mouseV, mouseLoc
394
mouseItem
Syntax
the mouseItem
Description
System property; contains the number of the item under the pointer when the function is called and the pointer is over a field sprite. (An item is any sequence of characters delimited by the current delimiter as set by the itemDelimiter property. ) Counting starts at the beginning of the field. [. . . ] This means that the x-axis of ModCylinder now is aligned with the negative z-axis of the world.
member("Engine"). model("ModCylinder"). transform. identity() put member("Engine"). model("ModCylinder"). transform. xAxis -- vector( 1. 0000, 0. 0000, 0. 0000 ) member("Engine"). model("ModCylinder"). rotate(0, 90, 0) put member("Engine"). model("ModCylinder"). transform. xAxis -- vector( 0. 0000, 0. 0000, -1. 0000 )
xtra
Syntax
xtra whichXtra
Description
Function; returns an instance of the scripting Xtra specified by whichXtra. To see an example of xtra used in a completed movie, see the Read and Write Text movie in the Learning/Lingo Examples folder inside the Director application folder.
Example
This statement uses the new() function to create a new instance of the Multiuser Xtra and assigns it to the variable tool:
tool = new(xtra "Multiuser")
See also
new()
733
xtraList
Syntax
the xtraList
Description
System property; displays a linear property list of all available Xtra extensions and their file versions. This property is useful when the functionality of a movie depends on a certain version of an Xtra. There are two possible properties that can appear in XtraList:
#name #version Specifies the filename of the Xtra on the current platform. [. . . ]