I have 3 movieClips on the stage. I want this to load images from urls that I have withdrawn from a php script that randomly selects from stored urls in the database. I want to load one of these into each movieclip. Here is the code that i have, but it doesn’t work. Could someone please tell me why?
(btw, this is on a frame of the movie)
loadText = new LoadVars();
loadText.load("generateQuiz.php?week="+_root.week);
loadText.onLoad = function() {
j = 1;
sortItOut();
loadInto = "left";
this[loadInto].loadMovie(this["set"+j][file]);
trace(loadInto);
trace(this["set"+j][file]);
j++;
loadInto = "middle";
this[loadInto].loadMovie(this["set"+j][file]);
j++;
loadInto = "right";
this[loadInto].loadMovie(this["set"+j][file]);
j++
};
stop();
function sortItOut() {
numOfQuestions = loadText.numOfQuestions;
for(i=1; i<=numOfQuestions; i++) {
url = this.loadText["image"+i];
path = "images/week"+_root.week+"/";
file = path+url;
question = this.loadText["question"+i];
ansA = this.loadText["ansA"+i];
ansB = this.loadText["ansB"+i];
ansC = this.loadText["ansC"+i];
correct = this.loadText["correctAns"+i];
this["set"+i] = [image, question, ansA, ansB, ansC, correct];
}
}
j = 1;