If the entire movie is to be played back and forth... place
this code on Frame 1:
onEnterFrame = function () {
dir ? prevFrame() : nextFrame();
_currentframe == 1 || _currentframe == _totalframes ? dir ^=
1 : null;
};
Basically, this code is run continuously. In the beginning
dir is undefined, and in a conditional, that is basically false, so
it goes to nextFrame(). This keeps happening until _currentframe is
equal to _totalframes. When this happens, dir = dir^1. The nice
thing about ^, is that: undefined^1=1, 0^1=1, 1^1=0. So, when dir
is equal to undefined or 0, when the frame reaches the _totalframes
limit, it will automatically switch to 1, telling the movie to play
backwards as seen in the first condition. And then, when it reaches
frame 1, dir becomes 0. This repeats on and on and on....