onClipEvent (load) { for (i = 0; i < _root.totalFotos; i++) { this.createEmptyMovieClip(["th" + i], i); this["th" + i].loadMovie("th" + i + ".jpg"); var pp = createEmptyMovieClip("preload" + i, i + 100); pp.id = i; pp.onEnterFrame = function() { if (this._parent["th" + this.id]._width > 0) { delete this.onEnterFrame; this.removeMovieClip(); } } if (i == 0) { this["th" + i]._x = 0; } else { anterior = i - 1; trace(anterior); // to see if it gets what you want. this["th" + i]._x = this["th" + anterior]._x + this["th" + anterior]._width; } } }