Bonjour,

Je cherche à loader des images dans un clip.
J'ai trouvé cette solution qui convient bien à l'usage dont j'ai besoin.

stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("slideshow.xml");

myShowXML.onLoad = function() {

_root.myWidth = myShowXML.firstChild.attributes.width;
_root.myHeight = myShowXML.firstChild.attributes.height;
_root.mySpeed = myShowXML.firstChild.attributes.speed;

_root.myImages = myShowXML.firstChild.childNodes;
_root.myImagesNo = myImages.length;
};

function createContainer() {
_root.createEmptyMovieClip("myContainer_mc",_root.getNextHighestDepth());

myContainer_mc.lineStyle(0x000000,0);
myContainer_mc.lineTo(_root.myWidth,0);
myContainer_mc.lineTo(_root.myWidth,_root.myHeight);
myContainer_mc.lineTo(0,_root.myHeight);
myContainer_mc.lineTo(0,0);

myContainer_mc._x = (Stage.width-myContainer_mc._width)/2;
myContainer_mc._y = (Stage.height-myContainer_mc._height)/2;

}
myShowXML.onLoad = function() {

_root.myWidth = myShowXML.firstChild.attributes.width;
_root.myHeight = myShowXML.firstChild.attributes.height;
_root.mySpeed = myShowXML.firstChild.attributes.speed;

_root.myImages = myShowXML.firstChild.childNodes;
_root.myImagesNo = myImages.length;

createContainer();
callImages();

};

function callImages() {

_root.myMCL = new MovieClipLoader();
_root.myPreloader = new Object();
_root.myMCL.addListener(_root.myPreloader);

_root.myClips_array = [];


_root.myPreloader.onLoadComplete = function(target) {

_root.myClips_array.push(target);
target._alpha = 0;
if (_root.myClips_array.length == _root.myImagesNo) {

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.target_mc++;

if (_root.target_mc>=_root.myImagesNo) {
_root.target_mc = 0;
}

next_mc = _root.myClips_array[_root.target_mc];
new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);

}
Le script est placé sur une frame de de ma scène("image"), j'ai un menu qui me balade entre les différentes images de ma scène contenant des clips.

Mon problème est que dés que je reviens sur cette frame "image", les images font des sauts de cabri, la lecture est irrégulière.
Et plus je reviens sur cette frame, plus c'est irregulier!!!

Je me dis qu'il faut annuler la ligne contenant myShowXML.load("slideshow.xml"); car il doit cotinuer de se lire mais je n'ai aucune idée de comment faire.

Est ce que quelqu'un a une idée pour m'aider?

Merci de votre aide