# getTimer?

**URL:** <https://forum.kirupa.com/t/gettimer/138462>\
**Category:** Uncategorized\
**Created:** [February 22, 2005, 9:45pm UTC](https://forum.kirupa.com/t/gettimer/138462 "2005-02-22T21:45:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GFresh](https://avatars.discourse-cdn.com/v4/letter/g/d6d6ee/32.png) [@GFresh](https://forum.kirupa.com/u/GFresh)\
**Post date:** [February 22, 2005, 9:45pm UTC](https://forum.kirupa.com/t/gettimer/138462/1 "2005-02-22T21:45:57Z")

</div>

I’m doing a Flash piece for my class. The interface is an elevator keypad and each floor is a different Photoshop pic with music playing (also each floor = different scene).

It’s going to be an installation piece in a gallery so my teacher wants it to reset back to the elevator keypad (scene 1) in case anyone leaves it on, say Floor 2, for x amount of time.

He said I should program a movie clip timer on each floor so after like 4 minutes it will just go back to the elevator scene (scene 1). How do I do that? I looked up a getTimer tutorial online, but it just has something that duplicated a movie clip until it reaches 20 of them then stops. I just need it to stay on scene 2 for 4 minutes then start back at scene 1.

Oh yeah, here’s the code that duplicates the clip until it reaches 20.

**Movie Clips:** “Engine” (no instance name) ; “Face” (instance name “clip”)

**"Engine" Actions:**  
onClipEvent (enterFrame) {  
if (\_root.delay) {  
if (Math.floor(getTimer()/1000) == \_root.lastTime+1) {  
\_root.delay = false;  
}  
} else if (Math.floor(getTimer()/1000) == \_root.lastTime+\_root.wait) {  
\_root.lastTime = Math.floor(getTimer()/1000);  
\_root.delay = true;  
// custom actions begin  
\_root.count = \_root.count+1;  
if (\_root.count \<= 20) {  
duplicateMovieClip("\_root.clip", “clip”+\_root.count, \_root.count);  
\_root[“clip”+\_root.count].\_x = random(350)+50;  
\_root[“clip”+\_root.count].\_y = random(350)+50;  
}  
// custom actions end  
}  
}

**Frame 1 Actions:**  
\_root.wait = 2;

Thanks in advance.
