488
Chapter 12: Methods
Parameters
None.
Example
This statement tells the computer to exit to the Windows desktop or Macintosh Finder when the
user presses Q in Windows or Q on the Macintosh:
-- Lingo syntax
if (_key.key = "q" and _key.commandDown) then
_player.quit()
end if
// JavaScript syntax
if (_key.key == "q" && _key.commandDown) {
_player.quit();
}
See also
Player
ramNeeded()
Usage
-- Lingo syntax
_movie.ramNeeded(
intFromFrame
,
intToFrame
)
// JavaScript syntax
_movie.ramNeeded(
intFromFrame
,
intToFrame
);
Description
Movie method; determines the memory needed, in bytes, to display a range of frames. For
example, you can test the size of frames containing 32-bit artwork: if
ramNeeded()
is larger than
freeBytes()
, then go to frames containing 8-bit artwork and divide by 1024 to convert bytes to
kilobytes (K).
Parameters
intFromFrame
Required. An integer that specifies the number of the first frame in the range.
intToFrame
Required. An integer that specifies the number of the last frame in the range.
Example
This statement sets the variable
frameSize
to the number of bytes needed to display frames 100
to 125 of the movie:
-- Lingo syntax
frameSize = _movie.ramNeeded(100, 125)
// JavaScript syntax
var frameSize = _movie.ramNeeded(100, 125);
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...