I have some code which is set to move an mc after a delay of 3 seconds. Problem I am having is when used like this, it of course keeps going because I am not telling it to stop:
function move(){
clearInterval(moveInterval);
_root.bottom.onEnterFrame = function() {
_root.bottom._y += 5;
}
}
moveinterval =setInterval(move,3000);
So, I try using delete onEnterFrame once the clip reaches a y position of 636, but rather than having the smooth transition to this point, it simply jumps to it.
function move(){
clearInterval(moveInterval);
_root.bottom.onEnterFrame = function() {
_root.bottom._y += 5;
if (_root.bottom._y = 636) {
delete this.onEnterFrame;
}
}
}
moveinterval =setInterval(move,3000);
So I see that this is obviously killing the movement of the mc
(_root.bottom._y += 5;)
But I am not sure how else to approach keeping the movement going but stopping it once _y = 636;
I tried this to, with the same result:
function move(){
clearInterval(moveInterval);
_root.bottom.onEnterFrame = function() {
_root.bottom._y += 5;
if (_root.bottom._y = 636) {
_root.bottom.stop();
}
}
}
moveinterval =setInterval(move,3000);
I have looked through forums, have not found any answers or even a hint as to how I would handle this.