I’m trying to use the tween effect applying in my code but I can’t make the loop working. It’s doesn’t loop back at all but only show me once the dissappear.
Does anyone know how to make that work??
Here’s my code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var lexml = new XML();
var chemin = “…/xml/”;
lexml.ignoreWhite = true;
lexml.onLoad = loaderXML;
lexml.load(chemin+“company.xml”);
function loaderXML(loaded) {
var racine = this.firstChild;
var nb_elements = racine.childNodes.length;
if (loaded) {
for(i=0;i<nb_elements;i++) {
var company_name = racine.childNodes*.attributes;
var item = _root.attachMovie("company", "item"+i, i);
var cote_gauche = _root["item"+(i-1)].nom_txt._x;
var profondeur_mc = _root["item"+(i-1)].nom_txt._width;
item.nom_txt.text = company_name.id;
item.nom_txt.autoSize = "left";
// Positionning
item.nom_txt._x = 0;
item.nom_txt._x = cote_gauche + profondeur_mc + 20;
item.nom_txt._y = 20;
var xPosT:Tween = new Tween(item, "_x", None.easeOut, Stage.width, -360, 3, true);
xPosT.onMotionFinished = function() {
this.continueTo();
};
}
} else {
text_area.text = "Can NOT load the images request. Please make sure you have right path...";
}
}