Tween fade animation with buttons
Hi, can anyone help me!
I have four movie clips with instance names of "purple_ob", "green_ob", "orange_ob" and "blue_ob"
and four buttons "purple_but", "green_but", "orange_but" and "blue_but"
I want to have the movie clips automatically fade from one to another continually with a 5 second pause inbetween, but then if the user clicks one of the four buttons it will fade the relevant movieclip in. Then if nothing else is pressed the fading will carry on working through the four images in a loop.
So far I have the movie clips fading on a button press but how do I implement the automatic fading from one MC to another?
I've added the code below into the first frame of my scene
//My actionscript 2.0 code
import mx.transitions.Tween;
import mx.transitions.easing;
purple_but.onPress = function() {
purple_ob.alpha = 0;
purple_ob._x = 0;
purple_ob._y = 0;
var alphaTween:Tween = new Tween(currentPage, "_alpha", Strong.easeIn, 100, 0, 15, false);
var alphaTween2:Tween = new Tween(purple_ob, "_alpha", Strong.easeIn, 0, 100, 15, false);
var currentPage:String = purple_ob;
purple_ob.swapDepths(thedepth += 1);
};
green_but.onPress = function() {
green_ob.alpha = 0;
green_ob._x = 0;
green_ob._y = 0;
var alphaTween:Tween = new Tween(currentPage, "_alpha", Strong.easeIn, 100, 0, 15, false);
var alphaTween2:Tween = new Tween(green_ob, "_alpha", Strong.easeIn, 0, 100, 15, false);
var currentPage:String = green_ob;
green_ob.swapDepths(thedepth += 1);
};
orange_but.onPress = function() {
orange_ob.alpha = 0;
orange_ob._x = 0;
orange_ob._y = 0;
var alphaTween:Tween = new Tween(currentPage, "_alpha", Strong.easeIn, 100, 0, 15, false);
var alphaTween2:Tween = new Tween(orange_ob, "_alpha", Strong.easeIn, 0, 100, 15, false);
var currentPage:String = orange_ob;
orange_ob.swapDepths(thedepth += 1);
};
blue_but.onPress = function() {
blue_ob.alpha = 0;
blue_ob._x = 0;
blue_ob._y = 0;
var alphaTween:Tween = new Tween(currentPage, "_alpha", Strong.easeIn, 100, 0, 15, false);
var alphaTween2:Tween = new Tween(blue_ob, "_alpha", Strong.easeIn, 0, 100, 15, false);
var currentPage:String = blue_ob;
blue_ob.swapDepths(thedepth += 1);
}