# Problem with enterframe and syntaxis

**URL:** <https://forum.kirupa.com/t/problem-with-enterframe-and-syntaxis/53755>\
**Category:** Uncategorized\
**Created:** [June 7, 2004, 5:59pm UTC](https://forum.kirupa.com/t/problem-with-enterframe-and-syntaxis/53755 "2004-06-07T17:59:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliman](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@juliman](https://forum.kirupa.com/u/juliman)\
**Post date:** [June 7, 2004, 5:59pm UTC](https://forum.kirupa.com/t/problem-with-enterframe-and-syntaxis/53755/1 "2004-06-07T17:59:57Z")

</div>

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 :

```auto

//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
