828
Chapter 14: Properties
Example
This statement checks whether 45 seconds have passed since the mouse was last moved and, if so,
sends the playhead to the marker Attract Loop:
-- Lingo syntax
if (_player.lastRoll > (45 * 60)) then
_movie.go("Attract Loop")
end if
// JavaScript syntax
if (_player.lastRoll > (45 * 60)) {
_movie.go("Attract Loop");
}
See also
lastClick
,
lastEvent
,
lastKey
,
Player
left
Usage
-- Lingo syntax
spriteObjRef
.left
// JavaScript syntax
spriteObjRef
.left;
Description
Sprite property; identifies the left horizontal coordinate of the bounding rectangle of a sprite.
Read/write.
Sprite coordinates are measured in pixels, starting with (0,0) at the upper left corner of the Stage.
Example
The following statement determines whether the sprite’s left edge is to the left of the Stage’s left
edge. If the sprite’s left edge is to the Stage’s left edge, the script runs the handler
offLeftEdge
:
-- Lingo syntax
if (sprite(3).left < 0) then
offLeftEdge()
end if
// JavaScript syntax
if (sprite(3).left < 0) {
offLeftEdge();
}
This statement measures the left horizontal coordinate of the sprite numbered (i + 1) and assigns
the value to the variable named
vLowest
:
-- Lingo syntax
vLowest = sprite(i + 1).left
// JavaScript syntax
var vLowest = sprite(i + 1).left
See also
bottom
,
height
,
locH
,
locV
,
right
,
Sprite
,
top
,
width
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...