User Guide

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 = horizontal + 3;
vertical = vertical + 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