Hi All.
I'm making a flash quiz which will have a series of questions. Each question will have a button which will read the question out. As well as 4 buttons (probably MC's), that the user will click to answer. Each question is a different sound clip and a different set of answers.
Problem is, I need to do it dynamically so I can pick a random sound clip from the library, and 4 random buttons. One of which will be the correct answer. So far I have manged to work out how to create dynamic instances of an object and display it in a random location:
for(var i=0; i<5; i++)
{
var appleMovie:appleMc = new appleMc();
appleMovie.x = +Math.random()*50;
appleMovie.y = +Math.random()*50;
this.addChild(appleMovie);
}
I can grab random values from an array of movieClip names like:
var fruit = new Array("apple", "pear", "grape", "lemon");
var randomValue:Number = Math.random()*1;
fruit[randomValue];
But this doesn't seem to help when wanting different objects dynamically. Am I going about this the correct way? Should the answer buttons be movie clips that generate their own random graphic as the image? I'm a bit lost on this one. Any help would be really appreacited.