Scripted Transitions

I want to use 5 buttons. and a content mc !

When page loads mc1 also loads containing some tweens.

When I click a button mc1 plays backwards,
When finished playing backwards the mc associated with the button clicked loads In the same content mc as
mc1 was loaded before, also with tweens.

If another button is clicked mc2 plays backwards. And the
new mc loads associated with the button clicked, also in the same content mc.

And so on…

Do you get the idea.

How would I set up something like this ?

/Erik

If you are using timeline tweens, you just have to make each swf so that the first half of the timeline plays forwards, then reverse the tweens in the second half of the timeline so it looks backwards.

Actionscript can’t really talk to the timeline except for frame labels and frame numbers.

Perhaps you could try a generic action on the last frame of each movie clip. Your main timeline buttons assign the specific values so that the generic action becomes specific and loads the new movie.

Have a look at this to get some ideas:
http://www.kirupa.com/developer/mx/preloader_transition.htm

Here’s a thread that can help you: http://www.kirupaforum.com/forums/showthread.php?s=&threadid=39101

Nice code Voets ! Impressive stuff !

This one should be in Best of…

Just one question, since Im a bad coder !

Is there a way to take advantage of the
Prevframe command. Lets say I dont want to make
a outro animation in the swf’s. I just want to use a intro
animation and play it backwards for outro ?

/Erik

You could use a prototype to make the movieclip play backwards using onEnterFrame and prevFrame(), and also have it check when the movieclip is at it’s first frame. If so, you then delete the onEnterFrame handler and call the same action as there normally is at the end of the outro animation:


MovieClip.prototype.playBackwards = function(){
this.onEnterFrame = function(){
this.prevFrame();
if(this._currentframe == 1){
delete this.onEnterFrame;
_root.container.loadMovie(_root.currMovie+."swf");
}
}
}

And then this code on the buttons:


on (release) {
        if (_root.currMovie == undefined) {
                _root.currMovie = "work";
                _parent.container.loadMovie("work.swf");
        } else if (_root.currMovie != "work") {
                if (_parent.container._currentframe == _parent.container.midframe) {
                        _root.currMovie = "work";
                        _parent.container.playBackwards();
                }
        }
}

This is done real quick out of my head though, so it might need some tweaking.

Thanks for you quick reply !!

I will try this as soon I’m on a faster computer with Flash !!