I'm re-doing one of my older Authorware projects in Flash for my portfolio. What I need is to make a quiz that will pull xnumber of questions from a pool of xnumber questions at random (with no repeating the same question).
I've browsed the net and searched multiple forums and not found a tutorial or .fla to look at. I've checked Flashkit and a few other small personal sites. Anyone happen to have a link on hand or able to walk me through the basics of what I need to do?
Shouldn't be too hard.
Just enter the questions in an array like this:
questions = new Array ("what is love?", "what is the meaning of life?", "What is your favourite color?");
Then when you want to display them use a textfield (named for example 'qdisp'). Use a second array (beenasked)
to keep track of what questions have been asked.
function newQuestion(){
randomnumber=random(questions.legnth-1);
while( beenasked[randomnumber]==1 ){
randomnumber=random(questions.legnth-1);
}
You'll have to throw up a little if-statement just to check that all questions haven't been asked (which would create an open loop crashing the application).
Bookmarks