PDA

View Full Version : Arrays and attachMovie



sub0
January 13th, 2003, 10:32 AM
hey,
I have 6 movie clips in my library each with their own identifiers(linkage) because I want to attach them dynamically on the stage. no problem for this..
but what about if I want to put them in an array first and then attach them on a host movie clip on the stage one after the other from left to right..so I would have 6 MC's in line on the _root...

thanks, sub

pom
January 13th, 2003, 10:43 AM
what's the question?

sub0
January 13th, 2003, 10:52 AM
the question is:

how do I attach 6 different MC's to an array which would put the attached(attachMovie()) MC's in a host on the _root stage, one after the other, from left to right....

thanks

sbeener
January 13th, 2003, 12:50 PM
movieArray = ['mov1","mov2","mov3", ... "mov10"];

function addMovies(movieArray){
var i,m,pm
for(i in movieArray){
pm = m;
m = _root.attachMovie(movieArray[i],movieArray[i]+"_mov",i);
m._x = pm._x + pm._width;
}
}

addMovies(movieArray);

the spacing relies on the movies' registration points being on the lefmost edge.