another stupid timer question...sorry
I know I know...I've looked at 30 posts on this and still can't get it to do what I want. Sorry for posting it again, but I've been beating myself over the head, and I have to get this done.
Now,
I have a MC on stage named Fred. Fred has 4 frames. I want to change to a random frame in fred every 5 seconds.
Fred has a stop() in his first frame.
Here's what I have placed on fred:
onClipEvent(load) {
fred.gotoAndStop(random(4)+1);
delay = 5000; // a 5 second delay
resetTime = getTimer() + delay;
}
onClipEvent(enterFrame) {
if (getTimer() > resetTime) {
gotoAndStop(random(4)+1);
}
}
When the movie starts fred waits 5 seconds then he just starts flippin through his 4 frames.
Anybody?
Thanks,
-Lemorris
tried #3 (setInterval) without success
Hi,
wondering if anyone has insights into the 3rd approach, with which I got a very different effect than with the other 2.
I've been trying to understand setInterval better so I was happy to see Jim was giving an example. I've read some of his posts on other stuff, & looked at KrazyDad - all great.
I'm not having any luck, though, with the setInterval example. I'm copying and pasting it to a mc containing 5 different frames - the same mc that works with the other approaches. With the setInterval approach, it races randomly through the frames for 5 seconds....
Wondering if anyone can explain how to make setInterval behave the same as the other 2. I'm imagining it will give me a better understanding of what's going on than even just seeing a working one.
cs