1 Reply Latest reply on Apr 17, 2007 1:25 PM by Newsgroup_User

    timer countdown from 5 mins

    midnight_cg Level 1
      Does anyone know how to create a timer that counts down from 5 minutes? I have been able to create one that counts down from 60 seconds, however when u go below 10 seconds it doesn't have a value such as 09 it only displays 9. I also can't get the timer to restart after every minute has passed. Here is a sample of my code which i have placed in a frame script:-
      global gvGameTimeSeconds, gvGameTimeMinutes
      on enterFrame
      the floatprecision = 2
      gvGameTimeMinutes = 5
      gvGameTimeSeconds = 00
      on exitFrame me
      the floatprecision = 2
      gvGameTimeMinutes = 4
      gvGameTimeSeconds = 59-(the timer/59)
      put gvGameTimeSeconds into field "seconds"
      if 59-(the timer/59) > 0 then
      go to the frame
      go to the frame+1
      end if
      if gvGameTimeSeconds = 00 then
      gvGameTimeMinutes = gvGameTimeMinutes -1
      put gvGameTimeMinutes into field "minutes"
      end if
      Any help would be much appreciated. If you need more information do not hesitate to contact.
      Many Thanks,