Stopping and starting with a button?

I have a simple tween that runs over 50 frames, there is no stop action so it loops, just what I want.

I have placed an invisible button over the tweened animation, now here’s my question:

Whe i click on the invisible button the animation stops and when I click on it again, it restarts

So that’s it really, can this be done? I know how to stop the animation by putting a stop in the action script, so I am looking for some actionscript that works on an alternative click method if I am making myself clear? Example:

First click stops it, second click starts it, third click stops it fourth click starts it - this goes on forever.

Thank you.

The easiest way i can think of is:

[AS]
decision = 0
on (release) {
if (decision == 0) {
_root.stop();
decision = 1
}
if (decision == 1) {
_root.play();
decision = 0
}
}
[/AS]

very sloppy but it should work (never tested) :slight_smile:

Thanks for that. I’ll try it.