Reset getTimer function?

hi there!, here’s the deal…\r\rI have an empty movie clip that tells another movie clip on the stage to move based on a variable that’s based on the getTimer results something like:\r\r onClipEvent (enterFrame) {\r&nbsp &nbsp &nbsp &nbsp targetx = 0;\r_root.slide.gotoAndPlay(“move”);\r\rstart = getTimer();\rif (start>4000) {\r&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp targetx = -468;\r_root.slide1.gotoAndPlay(“move”);\r}\r\rNow, what I want to do is to reset the value of getTimer so my movie will loop, does anybody know how to do that?, or maybe an easier solution?\r\rTanks to anybody with help

 onClipEvent (load) {\r\r  start = getTimer () ;\r\r}\r\ronClipEvent (enterFrame) {\r\r  now = getTimer () - start ;\r\r  if (now>4000) {\r\r    start = getTimer () ;\r\r    //do stuff\r\r  }\r\r}

Does this help ?\r\rpom 0]

WOW!! that was quick… I’ll give it a shot see if it works… \r\rthanks so much, although I’ve been with AS for a year, I still feel like a newbie\r\rpaco

I tried with the solution you posted, but I can’t ,make it work… if \r\ronClipEvent (load) {\r start = getTimer () ;\r}\ronClipEvent (enterFrame) {\r now = getTimer () - start ;\r if (now>4000) {\r start = getTimer () ;\r //do stuff\r }\r}\r\ram I really re-setting the timer?, I mean, what I do with this is give a value of 0 to the variable “now”, maybe I don´t get it… plus, how do I make the loop so getTimer will start counting again?\r\rthanks\r\rPaco

Well, if you do

 onClipEvent (load) {\r\r   start = getTimer () ;\r\r}\r\ronClipEvent (enterFrame) {\r\r   now = getTimer () - start ;\r\r   if (now>4000) {\r\r      start = getTimer () ;\r\r      trace (i++) ;\r\r   }\r\r}

you reset the timer in the way that it will increment and display i every 4 seconds.\r\rYou see, to reset the timer, you have to have some kind of reference point : it’s the start variable. When the clip loads, this is the origin. Then on each frame, you check the time. But the elapsed time is the difference between the present time and the origin of times. And when a condition is fulfilled (here : time>4000) then the origin becomes the current time.\r\rStill unclear ?\r\rpom 0]

AHHHH!.. now I got it, thanks so much for the clarification, that was really helpful\r\rpaco