242
Chapter 12: Methods
// JavaScript syntax
function mouseUp() {
_sound.beep(1);
}
See also
Sound
beginRecording()
Usage
-- Lingo syntax
_movie.beginRecording()
// JavaScript syntax
_movie.beginRecording();
Description
Movie method; starts a Score generation session.
When you call
beginRecording()
, the playhead automatically advances one frame and begins
recording in that frame. To avoid this behavior and begin recording in the frame in which
beginRecording()
is called, place a statement such as
_movie.go(_movie.frame - 1)
between
the calls to
beginRecording()
and
endRecording()
.
Only one update session in a movie can be active at a time.
Every call to
beginRecording()
must be matched by a call to
endRecording()
, which ends the
Score generation session.
Parameters
None.
Example
When used in the following handler, the
beginRecording
keyword begins a Score generation
session that animates the cast member Ball by assigning the cast member to sprite channel 20 and
then moving the sprite horizontally and vertically over a series of frames. The number of frames is
determined by the argument
numberOfFrames
.
-- Lingo syntax
on animBall(numberOfFrames)
_movie.beginRecording()
horizontal = 0
vertical = 100
repeat with i = 1 to numberOfFrames
_movie.go(i)
sprite(20).member = member("Ball")
sprite(20).locH = horizontal
sprite(20).locV = vertical
sprite(20).foreColor = 255
horizontal = hori 3
vertical = ve 2
_movie.updateFrame()
end repeat
_movie.endRecording()
end animBall
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
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...