updateStage()
575
// JavaScript syntax
function animBall(numberOfFrames) {
_movie.beginRecording();
var horizontal = 0;
var vertical = 100;
for (var i = 1; i <= numberOfFrames; i++) {
_movie.go(1);
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();
}
_movie.endRecording();
}
See also
beginRecording()
,
endRecording()
,
Movie
,
scriptNum
,
tweened
updateStage()
Usage
-- Lingo syntax
_movie.updateStage()
// JavaScript syntax
_movie.updateStage();
Description
Movie method; redraws the Stage immediately instead of only between frames.
The
updateStage()
method redraws sprites, performs transitions, plays sounds, sends a
prepareFrame
message (affecting movie and behavior scripts), and sends a
stepFrame
message
(which affects
actorList
).
Parameters
None.
Example
This handler changes the sprite’s horizontal and vertical locations and redraws the Stage so that
the sprite appears in the new location without having to wait for the playhead to move:
-- Lingo syntax
on moveRight(whichSprite, howFar)
sprite(whichSprite).locH = sprite(whichSprite).locH + howFar
_movie.updateStage()
end moveRight
// JavaScript syntax
function moveRight(whichSprite, howFar) {
sprite(whichSprite).locH = sprite(whichSprite).locH + howFar;
_movie.updateStage();
}
See also
actorList
,
Movie
,
on prepareFrame
,
on stepFrame
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...