-- calculate time remaining
on exitFrame me
  -- 100 is total frames
  put timeRemaining(the frame, 100)
end

// movie script
on timeRemaining currentFrame, totalFrames
  framesPerSecond = 60/10.0
  -- 60/10.0 is 10 frames per second
  totalTime = framesPerSecond * totalFrames
  elapsedTime = framesPerSecond * currentFrame

  -- float value of remainingTime
  -- remainingTime = (totalTime - elapsedTime)/60

  -- integer value of remaining time
  remainingTime = integer((totalTime - elapsedTime)/60)
  return remainingTime
end

Ramesh CT
http://www.geocities.com/ramesh_ct/

-----Original Message-----
From: Steven Sacks <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, November 08, 2000 1:31 PM
Subject: <lingo-l> Please help - time computation based on frame


|Hello. I need some math help.
|
|I need to compute remaining time based on
|a total frame count compared to the current frame.
|It's a 10fps movie.  
|
|Here's the elapsed time script.
|
|on computeTime
|  tmp = integer(the frame/10)
|  tsec = integer(tmp-(60*(integer(tmp/60))))
|  min = integer(tmp/60) 
|  if (tsec < 10) then
|    sec = "0" & tsec
|  else
|    sec = tsec
|  end if
|end
|
|So, how do I take this script and make it
|so that it shows remaining time, using a
|variable for totalFrames?  I'm quite tired
|and can't figure it out.
|
|Thanks in advance,
|Steven Sacks
|[EMAIL PROTECTED]
|
|[To remove yourself from this list, or to change to digest mode, go to
|http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
|email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
|Lingo-L is for learning and helping with programming Lingo.  Thanks!]


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to