# Time limit

**URL:** https://forum.kirupa.com/t/time-limit/5719
**Category:** Uncategorized
**Created:** [September 20, 2002, 4:33am UTC](https://forum.kirupa.com/t/time-limit/5719 "2002-09-20T04:33:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![the\_kza](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@the\_kza](https://forum.kirupa.com/u/the_kza)
#### Post date: [September 20, 2002, 4:33am UTC](https://forum.kirupa.com/t/time-limit/5719/1 "2002-09-20T04:33:41Z")

</div>

I’m trying to make a game with a time limit of around 60 seconds and have tried of couple ideas but have been unsuccessful in getting anything to work. What I tried was putting this code on a button:

on (release) {  
gotoAndPlay (2);  
\_root.time1.getTime();  
}

Then, on the next frame:

onClipEvent (enterFrame) {  
\_root.time2.getTime();  
\_root.time3 = \_root.time2 - \_root.time1;  
if (\_root.time3 \> 6000) {  
gotoAndStop(3);  
}}

I’m sure that this is just absolutely wrong because I checked what the variables return and that’s absolutely nothing…Can anyone give me any suggestions? Thanks for any help

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 20, 2002, 7:28am UTC](https://forum.kirupa.com/t/time-limit/5719/2 "2002-09-20T07:28:00Z")

</div>

1. not getTime(), but getTimeR(); !!
2. no path to be used with it, it’s a general property of the movie, all you need is variable=getTimer();
3. the exact code you want is on p.466 of the Moock book; as in every other post, isay: Folks, go get that book!!  
(want me to post the code?)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 20, 2002, 9:22pm UTC](https://forum.kirupa.com/t/time-limit/5719/3 "2002-09-20T21:22:25Z")

</div>

Thanks for telling me about that function! Once I had that, I got it up and running in a couple minutes, so you don’t have to post the code. I’m also probably going to get that book. After you mentioned it, I looked it up on [amazon.com](http://amazon.com) and everyone who got it likes it…so I figured, why not?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [December 23, 2003, 4:25pm UTC](https://forum.kirupa.com/t/time-limit/5719/4 "2003-12-23T16:25:40Z")

</div>

Hi Eyezberg,

hope u still reading this. can u post the code to set the time limit?
