MovieClip gets deleted for no reason

Hi, I’ll cut to the chase, here’s my code:

 
function loadThumbs(){
 for (var i = 1; i <= totalImages; i++){
  this.createEmptyMovieClip("athumb"+i, this.getNextHighestDepth());
  
  var thumb = this["athumb"+i];
  thumb._x = 50;
  thumb._y = 50;
  trace (thumb);
  trace (thumb._x);
  trace (thumb._y);
}
}

this.createEmptyMovieClip("positionChecker", 5042);
this.positionChecker.onEnterFrame = function(){
 trace (this.athumb1._x);
 trace (this.athumb1._y);
}

The positionchecker clip was created to check whether the clip has been added onto the stage or not. The strangest thing happens - the trace shows that the clip is created, and shows the x and y value. It then says undefined continuously.

  • The clip is always on the stage, and always has the same instance name

  • This code is contained inside said movieclip

  • I’ve tried replacing the loop variable ‘totalImages’ with ‘1’ - no difference

  • I’ve tried changing the name of the created clip

  • I’ve tried changing the depth of the created clip, to “12300 + i”

  • I do not unload or remove any movieclips, and the main timeline is stopped

Regardless, the empty movie clip is deleted immediately after being created. Someone please help, this is driving me insane!