FrameTempo

From Director Online Wiki
Jump to: navigation, search

the frameTempo is a theoretical value. In practice, the Director Player will normally play back a movie at a rate slower than the frameTempo.

To determine the instantaneous tempo of a movie at any time t, you will need to use a behavior such this:

property pLastMilliseconds
property pFrameTempo


on beginSprite
  pLastMilliseconds = the milliseconds
end


on enterFrame
  tMilliseconds = the milliseconds
  tTimeElapsed = tMilliseconds - pLastMilliseconds
  pFrameTempo = 1000.0 / tTimeElapsed
  pLastMilliseconds = tMilliseconds
end


on getFrameTempo
  return pFrameTempo
end