I have a problem with setInterval. I have a button; when you press the button three movie clips fade in and slide across screen. When I set the script so the mc’s move without button input, everything is fine. But when I try to set it up with an onRelease handler, BLOOIE!
Here’s the AS as it stands:
timer1 = setInterval(c1, 1000);
timer2 = setInterval(c2, 1600);
timer3 = setInterval(c3, 2200);
_root.namesTogether.caseOne._alpha = 0;
_root.namesTogether.caseTwo._alpha = 0;
_root.namesTogether.caseThree._alpha = 0;
function c1() {
_root.namesTogether.caseOne._x += 50;
if (_root.namesTogether.caseOne._x >= 200) {
_root.namesTogether.caseOne._x = 200;
}
_root.namesTogether.caseOne._alpha += 30;
if (_root.namesTogether.caseOne._alpha >= 100) {
_root.namesTogether.caseOne._alpha = 100;
}
clearInterval(timer1);
};
function c2() {
_root.namesTogether.caseTwo._x += 50;
if (_root.namesTogether.caseTwo._x >= 200) {
_root.namesTogether.caseTwo._x = 200;
}
_root.namesTogether.caseTwo._alpha += 30;
if (_root.namesTogether.caseTwo._alpha >= 100) {
_root.namesTogether.caseTwo._alpha = 100;
}
clearInterval(timer2);
};
function c3() {
_root.namesTogether.caseThree._x += 50;
if (_root.namesTogether.caseThree._x >= 200) {
_root.namesTogether.caseThree._x = 200;
}
_root.namesTogether.caseThree._alpha += 30;
if (_root.namesTogether.caseThree._alpha >= 100) {
_root.namesTogether.caseThree._alpha = 100;
}
clearInterval(timer3);
};
_root.onlyBtn.onRelease = function (){
_root.onEnterFrame = function(){
c1();
c2();
c3();
}
}
If anyone has any insight, I’d be very grateful for help!! I’ve attached my fla, for what it’s worth.
thanks again!