Olá pessoal!
Eu estou com duas dúvidas que não estou conseguindo resolver no script abaixo.
O script lê o xml e vai rodando a imagem e o texto,
1º Eu precisava que ele parasse de passar quando chegar no último item do xml... como faço isso?
2º Como faço para rodar 3 itens do xml, parar carregar um swf externo através do loadmovie e depois que terminar de rodar o swf externo ele voltar a mostrar o restante dos itens do xml?
Galera muito obrigado por qualquer tipo de ajuda!
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("tv_metra.xml");
myShowXML.onLoad = function() {
_root.mySpeed = myShowXML.firstChild.attributes.speed;
_root.myImages = myShowXML.firstChild.childNodes;
_root.myImagesNo = myImages.length;
callImages();
};
function callImages() {
_root.myMCL = new MovieClipLoader();
_root.myPreloader = new Object();
_root.myMCL.addListener(_root.myPreloader);
_root.myClips_array = [];
_root.myPreloader.onLoadProgress = function(target) {
_root.descricao.myText_txt.text = "Carregando.. "+_root.myClips_array.length+"/"+_root.myImagesNo+" Completado";
};
_root.myPreloader.onLoadComplete = function(target) {
_root.myClips_array.push(target);
target._alpha = 0;
if (_root.myClips_array.length == _root.myImagesNo) {
_root.target_mc = -1;
moveSlide();
myShowInt = setInterval(moveSlide, (_root.mySpeed*1000)+1000);
}
};
for (i=0; i<_root.myImagesNo; i++) {
temp_url = _root.myImages[i].attributes.url;
temp_mc = myContainer_mc.createEmptyMovieClip(i, myContainer_mc.getNextHighestDepth());
_root.myMCL.loadClip(temp_url,temp_mc);
}
}
function moveSlide() {
current_mc = _root.myClips_array[_root.target_mc];
new Tween(current_mc, "_alpha", Strong.easeOut, 100, 0, 1, true);
_root.logo.play();
_root.base.play();
_root.target_mc++;
if (_root.target_mc>=_root.myImagesNo) {
_root.target_mc = 0;
_root.logo.gotoAndStop(0);
_root.base.gotoAndStop(0);
}
_root.descricao.myText_txt.text = _root.myImages[target_mc].attributes.desc;
next_mc = _root.myClips_array[_root.target_mc];
new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
}

Parar Leitura Do Xml
Started By Luis Vagner, 24/05/2011, 09:26
Nenhuma resposta neste tópico
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)