View Single Post
  #1 (permalink)  
Old Jan 1st, 2006, 07:24
yardgnome yardgnome is offline
New Member
Join Date: Dec 2005
Location: Hamura City, Japan
Age: 28
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
loading multiple images with loadMovie

I was wondering if it was possible to use loadMovie method with the instance name as a var. For example I have the following function.
Code: Select all
function loadAllImages() {
 trace("Loading images...");
 for (j=0; j <= totalImages; j++) {
  imageInstance[j] = "pictures"+j+"_mc";
  alaska_mc.createEmptyMovieClip(imageInstance[j], alaska_mc.getNextHighestDepth());
  alaska_mc.imageInstance[j].loadMovie(images[j].path);
  trace("alaska_mc." + imageInstance[j] + " loaded.");
  moveXY();
 }
When I try to load an image this way, it won't work. During debugging I can see that the function is creating the empty clips.... (alaska_mc.pictures0_mc, alaska_mc.pictures1_mc, etc) but the loadClip method won't load the image because I have a variable (imageInstance[j]) instead of an actual name. The function works if I put the actual instance name there (i.e. alaska_mc.pictures0_mc). instead of the var holding the name of the instance(alaska_mc.imageInstance[j]).... Am I missing something? Thanks in advance.
Reply With Quote