Whats an easier way to write this code?
button_btn.onRelease = function() {
this.onEnterFrame = function() {
if (_root._currentframe == 1) {
play();
} else {
this.onRelease = function() {
this.onEnterFrame = function() {
if (_root._currentframe == 25) {
play();
}
}
}
}
}
}
Basically Ive got a tween on the root timeline and it moves down between frames 1 to 25 and then back up from frame 25 to 50 and starts all over again.
Also how can I include all that code as a single function so I can just call it rather than writing the entire code again?
Thanks all