Weird duplicateMovie Problem

need someone else to look at this – i am going crazy trying to debug it.

Here is the code followed by the trace output. It doesnt set the properties of the duplicated movie correctly–and does not show the duplicated movies…i dont know why aargh!!

Thanks

Code:


menu = this.firstChild.childNodes;
			numberOfGalleries = menu.length;
			var size = 30;
			var j=0;
			while (j<numberOfGalleries) {
				trace("j= "+j);
				galleryName = menu[j].attributes.name;
				trace("galleryName = "+galleryName);
				
				duplicateMovieClip(galleryButton, "galleryButton"+j,j+10);								
			
				this["galleryButton"+j]._y = size;
				trace("_y Property = "+this["galleryButton"+j]._y);
				
				// hardcoded duplicated movie name
				trace("_y Property = "+galleryButton0._y);
				
				this["galleryButton"+j]._x= -372.0;
				trace("_x Property = "+this["galleryButton"+j]._x);
				
				this["galleryButton"+j].galleryName = galleryName;
				
				// hardcoded movieClip Name
				trace("MovieClip.galleryName = " + galleryButton0.galleryName);
				
				
				butArray.push("galleryButton"+j);
				size = size-30;
				 j++;
			}



Trace:

j= 0
galleryName = Bowling
_y Property =
_y Property = -334.45
_x Property =
MovieClip.galleryName =
j= 1
galleryName = Bowling2
_y Property =
_y Property = -334.45
_x Property =
MovieClip.galleryName =

Thanks!