Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Eae Galera, estou com um problema em um banner rotativo, ele sozinho vai mudando numa boa, porém quando clico nos botões referentes a cada banner ele não está limpando o setInterval();
Segue código
function trocaJob(){
trabalhos.barraText._alpha = 0;
trabalhos.titulo_txt.text = "";
trabalhos.desc_txt.text = "";
job += 1;
if(job == 4){
job = 1;
}
trabalhos.jobHome.loadMovie(home.firstChild.childNodes[0].childNodes[job - 1].attributes.imagem);
var fade:Tween = new Tween(trabalhos.transicao, "_alpha", Regular.easeOut, 100, 0, 1, true);
var animaD:Tween = new Tween(trabalhos, "_y", Regular.easeOut, trabalhos._y, trabalhos._y, 0.2, true);
animaD.onMotionfinished = function(){
var animaA:Tween = new Tween(trabalhos.barraText, "_alpha", Regular.easeOut, 0, 80, 0.5, true);
var animaB:Tween = new Tween(trabalhos.barraText, "_y", Regular.easeOut, 53.6, 69.6, 0.3, true);
}
var animaC:Tween = new Tween(trabalhos, "_x", Regular.easeOut, tranbalhos._x, trabalhos._x, 0.6, true);
animaC.onMotionfinished = function(){
trabalhos.titulo_txt.text = home.firstChild.childNodes[0].childNodes[job - 1].attributes.titulo;
trabalhos.desc_txt.text = home.firstChild.childNodes[0].childNodes[job - 1].attributes.desc;
}
travaBtn("marcaJob" + job);
}
trabalhos.marcaJob1.onRelease = function(){
clearInterval(intervalo)
job = 0;
intervalo = setInterval(trocaJob, 5000);
}
trabalhos.marcaJob2.onRelease = function(){
job = 1;
clearInterval(intervalo);
intervalo = setInterval(trocaJob, 5000);
}
trabalhos.marcaJob3.onRelease = function(){
job = 2;
clearInterval(intervalo);
intervalo = setInterval(trocaJob, 5000);
}
Valeu!
Carregando comentários...