Hi,
I am creating a web site that will use XML to load content - a sort of video gallery.
I plan to make scrolling movie clip for navigation containing instances of the single clip - “movie”, which contains thumbnail, title and link, and I plan to use duplicateMovieClip to create as many MCs in navigation as needed.
But I have the following problem:
I made a single MC - “movie” that takes the title, description and link from XML.
I take the lenght of the XML nodes and duplicate the movie clip through the following code, where the variable j is the required number of MCs:
dist = 100; //distance of the new MC
_global.k = 0;
for (i=0; i<=j-1; i++) {
// duplicating the movieclip
duplicateMovieClip (“movie”, “movie”+k, k);
// setting the y position of the duplicated movieclips
setProperty (“movie”+k, _y, dist*i);
// incrementing the value of k
k++;
}
}
Everything works OK, the MC is duplicated the right number of times and in the right position, but I cannot pass the required data - variable k to duplicated MC, which has the following code:
…
function loadXML(loaded) {
_root.naslov = this.firstChild.childNodes[k].childNodes[1].firstChild.nodeValue;
_root.opis = this.firstChild.childNodes[k].childNodes[2].firstChild.nodeValue;
…
Every of the movies get the same value of the k.
Is there a way to pass the exact value to each of the MCs?
Thanx in advance!