Forums: Flash:

 

duplicateMovieClip Question

first
 

elad duplicateMovieClip Question

Hello. Still coding away in AS2 and I have a question .

I've got an Array with some values in it

myArray = ["pie","cake","cookies",brownies"]

I have a movieclip on the stage i'd like to duplicate as many times as the total length of the array and place each value from the array in the coresponding movie clip.

I can't brain today, as I seem to have the dumbs and was hoping someone might be able to point me in the right direction.

Thanks much in advance

Nuff Said...
quote
 

elad


myArray = ["pie","cake","brownies","cookies"]

for(i=0; i<myArray.length;i++){
duplicateMovieClip(myclip,"new_"+i,i)
tempClip = this["new_"+i];
tempClip._y = tempClip._y+40;
tempClip.theText.text = myArray[i];
}


I've figured out the duplication and the population. What I can't figure out now is the positioning of the created clips. How do i get them not to stack on top of each other?

Nuff Said...
quote
 

JLM


tempClip._y = tempClip._y+40*i;


might be more relavent, but


tempClip._y = tempClip._y + offsetY + gapY*i;


might be a good way to structure

 
first
 

Forums: Flash: duplicateMovieClip Question

 
New Post
 
You must be logged in to post