hi
i am loading external jpg into a movie clip and i would like to get a preloader for each image. the images load right but the preloader is not working, it seems i can’t target things in the “enterframe” the same way than in the “for” loop :
//duplicate 24 movies
for (i=1; i<=23; ++i) {
duplicateMovieClip("jmf", "jmf"+i, i);
//stack the duplicated movieclips
this["jmf"+i]._x += (jmf._width*(i-1));
// loading images in clips
this["jmf"+i].image.loadMovie("images/jmf/jmf"+i+".jpg");
trace(["jmf"+i]);
trace(typeof (this["jmf"+i].image));
trace(this["jmf"+i].image); //GIVES ME JMF1.IMAGE, JMF2.IMAGE ETC
trace("stats : "+typeof (this["jmf"+i].stats));
trace(this["jmf"+i].stats.total.text);
this.jmf.removeMovieClip();
//where it's getting weird:
this.onEnterFrame = function() {
this["jmf"+i].stats.total.text = this["jmf"+i].image.getBytesTotal()+" ko";
trace(typeof (this["jmf"+i].stats.total.text));//GIVES ME "UNDEFINED" AS A RESULT
trace(["jmf"+i].image);//GIVES ME "UNDEFINED" AS A RESULT
trace(this["jmf"+i].image.getBytesTotal()+" ko");//GIVES ME "UNDEFINED" AS A RESULT
this["jmf"+i].stats.charge.text = this["jmf"+i].image.getBytesLoaded()+" ko";
trace(this["jmf"+i].stats.charge.text);//GIVES ME "UNDEFINED" AS A RESULT
this["jmf"+i]stats.bar._xscale = Math.floor((this["jmf"+i].image.getBytesLoaded()/this["jmf"+i].image.getBytesTotal())*100);
this["jmf"+i].stats.pourcent.text = Math.floor((this["jmf"+i].image.getBytesLoaded()/this["jmf"+i].image.getBytesTotal())*100)+" %";
if (this["jmf"+i].stats.pourcent.text == "100 %") {
trace(this["jmf"+i].stats.pourcent.text);//NEVER REACHES THE 100%
this["jmf"+i].charge.gotoandstop("off");
this["jmf"+i].stats._visible = false;
this.onEnterFrame = null;
}
};
}
could someone help?
thanx for your answers