Playing timeline backwards + reroute by flags

Have placed this dilemma on the forum before & got some good tips. But I’m not there yet. Here’s the deal: I want to jump from one frame on the timeline to another via a 3rd frame, and each time I play an animation in between, either forward or backwards.

First part is really straightforward:

You enter frame 1 & stop. There you click a button to go to frame 56. From frame 56 starts an animation which stops at frame 71.

When in frame 1 you can also click a 2nd button. Then you jump to frame 86, where also an animation starts which stops at frame 101. Easy.

But… Now we get to the hard part.

I want to be able to click button one in frame 1, jump to frame 56, run animation, end in frame 71. Then, in 71 I want to click on a button which then reverses the animation from 71 to 55 and when it arrives at 55 a piece of script will make the playhead jump immediately to 86, run through the animation, and end in frame 101. I want to be able to do exactly the same thing when you pressed button 2 in frame 1. Which would be:

frame 1, click button - jump to frame 86 - animation - end in frame 101 - press button - animation reverses from 101 back to 85 - when arrives at 85 jumps immediatley to frame 56 - plays animation - ends in frame 71.

From there on I want to be able to make the same jump from 71 to 101 and back, or from 101 to 71 to 101 etc. All via the routes as described above.

I got a piece of script to play a piece of timeline in reverse without having to copy & reverse the actual frames. I also got a tip on how to work with flags (set to true or false) to get the reroute to work (Thanks to glosrfc!). It all works, but when I make the jump from frame 1 to 71 and all the way to 101, in frame 101 the button to go back to 71 doesn’t react at all. Same when I go from 1 to 101 to 71. The trick only works 1 time. So I can go through the reverse and reroute sequence only once.

The scripting I got:

frame 1:


stop();

Ebtn.onPress = function () {
gotoAndPlay(56);
}


Fbtn.onPress = function () {
gotoAndPlay(86);
}

frame 71:

stop();

if (flag5 == false) {
 delete this.Movement;
}

function Movement() {
if (_root.startframe > _root.endframe){
prevFrame();
}

FbtnREV.onPress = function () {
_root.startframe=70;
_root.endframe=55;
gotoAndPlay(_root.startframe)
}

delete this.Movement;
}

this.onEnterFrame= Movement;

flag5 = true;

frame 55:


onEnterFrame= function(){
        stop();
}

this.onEnterFrame= Movement;

if (flag5 == true) {
 gotoAndPlay (86);
}

flag5 = false

frame 101:

stop();

if (flag5 == false) {
 delete this.Movement;
}

function Movement() {
if (_root.startframe > _root.endframe){
prevFrame();
}

EbtnREV.onPress = function () {
_root.startframe=99;
_root.endframe=85;
gotoAndPlay(_root.startframe)
}

delete this.Movement;
}

this.onEnterFrame= Movement;

flag5 = true;

frame 85:

onEnterFrame= function(){
        stop();
}

this.onEnterFrame= Movement;

if (flag5 == true) {
 gotoAndPlay (56);
}

flag5 = false

I’m pretty sure I will have lost most of you by now, but I’m still hoping someone can help me out, because this is costing me years of my life. There’s probably pieces of script in conflict or something. Anyway, hats off for having read all this, hope you can help me out. Contact me directly at solifugid@hotmail.com if you need any more info.