I am trying to create a quiz and would like to have a list of questions in a text file that I could access and progress through as the user gets each question right e.g. q1=what is hardware, q2=what is software, etc. I've set up a dynamic text box with the variable name 'display' to hold the current question. How do I write the text file and then access the questions? Is this to do with loadVars?
As a more comlicated version I wonder if it would be possible to rank the questions for hardness e.g. 1-3 for the user to select?
Can anyone help please?
Thanks
Richard
Last edited by richard101; 04-14-2005 at 11:43 PM.
concept:
you load all questions in a single variable ansd split it into an array, this way you can easily access one q after thew other counting up th index on every right answer and display it to the dyn textfield.
I wonder if it would be possible to rank the questions for hardness e.g. 1-3 for the user to select?
yes. have as much arrays as you have hardness levels and a button to set the hardnes level into a variable (like hardness="easy").
in your question reset, have an if statement checking the value of hardness....
furthermore, there has to be a loop checking if the variables loaded.
and last i build in a checker on the button to detect the end of the list and
begin in the first position again.
check the attached fla for details, it's all working fine.
I'm actually trying to solve this for a student of mine - she wants to create a snakes & ladders game, where progression depends on answering questions correctly. The degree of difficulty of the question (as mentioned earlier) would add an extra dimension to it. As you said if she creates a couple more variables and then uses an IF statement, it should do the trick.
This thing about it taking time to load the text file - I suppose the best thing might be to load it into a Movie Clip right at the beginning - I've also been reading something about the LoadVars object ... this seems to offer possibilities!