Transition Between 2 Movie Clips with Tween Class
This is just Basic Flash ActionScripting with 2.0 Using TweenClass Between 2 movieClips. In this example I used 2 images which converted to were movie clip, which I will make first Movie Clip to appear first by transitioning from alpha 0 to 100 then transisioning back from 100 to 0 and then calling Movie Clip 2 to do the same transition then loop back to Movie Clip 1 to repeat the transition.
First Have your first movie clip then convert it - name it anything you want.
The important part is assigning the instance name of the movie clip, this is the ActionScript name going to identify. For this example I name firt movie clip as movP1 and second movie clipt as movP2.
so put this as2 script inside a frame (where the movies are also visible)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import mx.transitions.Tween; import mx.transitions.easing.*; movP1._alpha = 0; movP2._alpha = 0; firstTween(); function firstTween(){ var Tween1:Tween = new Tween(movP1, "_alpha", Strong.easeOut, 0, 100, 5, true); setTimeout(doNextTween, 5000); } function doNextTween(){ var Tween2:Tween = new Tween(movP1, "_alpha", Strong.easeOut, 100, 0, 5, true); var Tween3:Tween = new Tween(movP2, "_alpha", Strong.easeOut, 0, 100, 5, true); setTimeout(loopBack, 5000); } function loopBack(){ var Tween4:Tween = new Tween(movP2, "_alpha", Strong.easeOut, 100, 0, 5, true); setTimeout(firstTween, 100); } |
setTimeout(doNextTween, 5000);
Demo:
Flash required
Or Just
Download The Source File.
Tags: ActionScript 2.0, Basic Flash, Tween Class