duplicateFrame()

Usage

-- Lingo syntax
_movie.duplicateFrame()

// JavaScript syntax
_movie.duplicateFrame();

Description

Movie method; duplicates the current frame and its content, inserts the duplicate frame after the current frame, and then makes the duplicate frame the current frame. This method can be used during Score generation only.

This method performs the same function as the insertFrame() method.

Parameters

None.

Example

When used in the following handler, the duplicateFrame command creates a series of frames that have cast member Ball in the external cast Toys assigned to sprite channel 20. The number of frames is determined by the argument numberOfFrames.

-- Lingo syntax
on animBall(numberOfFrames)
   _movie.beginRecording()
   sprite(20).member = member("Ball", "Toys")
   repeat with i = 0 to numberOfFrames
      _movie.duplicateFrame()
   end repeat
   _movie.endRecording()
end animBall

// JavaScript syntax
function animBall(numberOfFrames) {
   _movie.beginRecording();
   sprite(20).member = member("Ball", "Toys");
   for (var i = 0; i <= numberOfFrames; i++) {
      _movie.duplicateFrame();
   }
   _movie.endRecording();
}

See also

insertFrame(), Movie