Hi, I have 3 frames and I need to switch between them after 5 seconds. My AS2.0 code for every frame is:
function myTimee (){
gotoAndStop(2);
}
setInterval(myTimee,5000);
of course, function name and frame in gotoAndStop changes every time. The weird thing is that it works for the very first time, but then it is going crazy.
1.2.3.
2. // here it goes to frame 2 instead of 1
3.1.2.3.1.2.3.1.2.3.
2. // this is weird too
3.1.2.3.1.
Thank you
cant open your fla.
you need to clearIntervals otherwise you will have more and more intervals running at the same time and consequently giving you odd behaviour.
cant open your fla.
you need to clearIntervals otherwise you will have more and more intervals running at the same time and consequently giving you odd behaviour.
thank you, gorlummeeguvnor. That .fla is CS5 version, I uploaded CS4 version. Hope that helps. Anyway, I know that i have to somehow end that interval, but I dont know if I'm doing it right. This is my code in each frame..
var myInterval = setInterval(myHello2, 2000);
function myHello2 (){
gotoAndStop(2);
}
setInterval(myHello2,5000);
a pleasure - sorry about the guff though. as a point of interest setInterval will never be like a swiss watch - it is not a great timer in terms of accuracy.
a pleasure - sorry about the guff though. as a point of interest setInterval will never be like a swiss watch - it is not a great timer in terms of accuracy.
I think chinese watch for 3 bucks will be enough for me Thanks again. You already solved 50% of my problems, if you have few minutes, here is the second one:
I have few buttons with simple animation where it disappears(alpha=0) and appears and I need to fix two things. When cursor is still over that button, I need to play animation only once. This I have done (I dont know if it was the best way, but it somehow works. And the second, if that button is down (animation is playing) and I roll out and then roll on again, the animation start from the beginning and it looks bad.