Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : Wont repeat


MiniMurderdoll
5/9/2004 6:09:11 PM
Hi, i have this, you press a button to make auto = 1 :

function delayAction() {
clearInterval(intervalID);
if (distance != 0) {
distance = distance-1;
}
}
if (auto == 1) {
if (estop != 1) {
if (floor != 1) {
} else if (distance<=320) {
distance = distance+1;
}
}
}
if (distance == 320) {
auto = 2;
}
if (auto == 2) {
if (distance != 0) {
intervalID = setInterval(delayAction, 10000);
}
if (distance == 0) {
auto = 0;
}
}


It workes fine, but when it finishes and makes auto = 0, you cant then press
the button to make auto = 1, it doesnt respond and start over again
mandingo
5/9/2004 11:19:19 PM
Hi,

What other condition have you on the buttonPress? Are you only allowing the
press if auto != 1?

I doubt that that is your problem, it is most likely not meeting all your
other conditions ...

A quick read of your code would indicate that it will take a long time for
your distance to return back to 0 in order to turn your auto back to 0

hope that helps,
MiniMurderdoll
5/10/2004 2:54:59 PM
I can send you the .fla file if you give me an email address, i dont want to link it on here as i dont want it disclosed to the public yet.

AddThis Social Bookmark Button