Ela puxa imagens de fora (que estão na mesma pasta) e tem um Timer de 5 segundos para cada foto. Além disso coloquei um Tween com efeito de Regular.easeOut.
Até aí tudo bem, carrega numa boa. O problema é que enquanto carrega a foto o Timer continua rolando, tentei criar uma condicional mas não rolou. Alguém me ajuda?
CÓDIGO
//Classe
import fl.transitions.*
import fl.transitions.easing.*
//Variáveis
var fotosRequest:URLRequest = new URLRequest()
var fotosLoader:Loader = new Loader()
var carrega = new Loader()
var completa:int = 100
var contador:int = 0
var tamanho:uint = 3
var conteiner:MovieClip = new MovieClip()
var temporizador:Timer = new Timer (5)
//Eventos
carrega.contentLoaderInfo.addEventListener(Event.COMPLETE,completouext)
carrega.contentLoaderInfo.addEventListener(Event.OPEN, iniciouext)
temporizador.addEventListener(TimerEvent.TIMER, repete)
//Funções
function iniciouext(e){
llorcarrega_mc.visible = true
}
function completouext(e){
llorcarrega_mc.visible=false
//***************************************************************
//Tentei criar aqui a condição, mas não rolou!
if (carrega < completa) {
temporizador.stop()
}
else { temporizador.start()
}
}
function repete (e:TimerEvent) {
temporizador.delay = 5000
fotosRequest.url = "eventos" + contador + ".jpg"
fotosLoader.load (fotosRequest)
contador ++
if ( contador == tamanho) {
contador = 0
}
TransitionManager.start( alvo_mc, {type:Fade, duration:1, easing:Regular.easeIn})
}
// Inicialização
this.addChild (alvo_mc)
alvo_mc.addChild(fotosLoader)
temporizador.start()
import fl.transitions.*
import fl.transitions.easing.*
//Variáveis
var fotosRequest:URLRequest = new URLRequest()
var fotosLoader:Loader = new Loader()
var carrega = new Loader()
var completa:int = 100
var contador:int = 0
var tamanho:uint = 3
var conteiner:MovieClip = new MovieClip()
var temporizador:Timer = new Timer (5)
//Eventos
carrega.contentLoaderInfo.addEventListener(Event.COMPLETE,completouext)
carrega.contentLoaderInfo.addEventListener(Event.OPEN, iniciouext)
temporizador.addEventListener(TimerEvent.TIMER, repete)
//Funções
function iniciouext(e){
llorcarrega_mc.visible = true
}
function completouext(e){
llorcarrega_mc.visible=false
//***************************************************************
//Tentei criar aqui a condição, mas não rolou!
if (carrega < completa) {
temporizador.stop()
}
else { temporizador.start()
}
}
function repete (e:TimerEvent) {
temporizador.delay = 5000
fotosRequest.url = "eventos" + contador + ".jpg"
fotosLoader.load (fotosRequest)
contador ++
if ( contador == tamanho) {
contador = 0
}
TransitionManager.start( alvo_mc, {type:Fade, duration:1, easing:Regular.easeIn})
}
// Inicialização
this.addChild (alvo_mc)
alvo_mc.addChild(fotosLoader)
temporizador.start()
Se quiserem fazer download do arquivo segue o link http://www.filipetrabbold.com.br/testes/ga...imer/teste2.zip
vlw! abss

Help














