EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 302

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
302 Chapter 12: Methods
Example
When used in the following handler, the endRecording keyword ends the Score
generation session:
-- 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 = horizontal + 3
vertical = vertical + 2
_movie.updateFrame()
end repeat
_movie.endRecording()
end animBall
// 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(), Movie, updateFrame()
erase()
Usage
-- Lingo syntax
memberObjRef.erase()
// JavaScript syntax
memberObjRef.erase();
Description
Member method; deletes a specified cast member and leaves its slot in the Cast window empty.
For best results, use this method during authoring and not in projectors. Using this method in
projectors may cause memory problems.