Hi there,
I’m making a scripted animation in Flash CS4, basically it’s made of various mc’s that have alpha tweens assigned.
The thing is I’m trying to make a FadeIn variable and then wait for “x” seconds then call a fadeOut variable…
the thing is I can’t find code for resting between variables so the closer I got was using set interval but that makes it hard to code.
here is my code
// IMPORTAR CLASSES
import mx.transitions.Tween;
import mx.transitions.easing.*;
// ESCONDER MCLIPS NO INICIO
justica_mc._alpha = 0;
mario_mc._alpha = 0;
sombra_mc._alpha = 0;
autor_mc._alpha = 0;
tag_mc._alpha = 0;
// FUNÇÕES
function justicaAlpha() {
var fadeIn:Tween = new Tween(justica_mc, "_alpha", Regular.easeIn, 0, 100, 1, true);
}
function delayJustica () {
clearInterval(delay1);
var fadeOut:Tween = new Tween(justica_mc, "_alpha", Regular.easeOut, 100, 0, 1, true);
trace( "fadeOut justica" )
fadeOut.onMotionFinished = function() {
unBlur();
}
}
function unBlur() {
var fadeOut:Tween = new Tween(blur_mc, "_alpha", Regular.easeOut, 100, 0, 1, true);
trace ("unBlur")
fadeOut.onMotionFinished = function() {
marioAlpha();
}
}
function marioAlpha() {
var fadeIn:Tween = new Tween(mario_mc, "_alpha", Regular.easeIn, 0, 100, 1, true);
trace ("marioAlpha")
}
function delayMario() {
clearInterval(delay2);
var fadeOut:Tween = new Tween(mario_mc, "_alpha", Regular.easeOut, 100, 0, 1, true);
trace( "fadeOut mario" )
fadeOut.onMotionFinished = function() {
sombraAlpha();
}
}
// ANIMAÇÃO
justicaAlpha();
delay1 = setInterval(delayJustica, 2000);
delay2 = setInterval(delayMario, 5500);
also I would like this animation to repeat itself after it concludes (looping the code?)
I’m a bit noob at AS animation so bear with me, please