Skip to main content
Participant
June 17, 2014
Question

Multiple choice quiz for AS3 in Adobe Flash Professional

  • June 17, 2014
  • 2 replies
  • 4240 views

I am trying to create a multiple choice quiz using Flash Professional CC but am having trouble putting everything together.

I was planning on using actionscript 3.0 as the script
language and using an array class to provide the questions and multiple choice
answers to the stage through dynamic text boxes. I am also wanting to randomize
the order that the questions are asked in, as well as randomize the “A”, “B”, “C”,
and “D” answers to each question. One twist to the complexity of this quiz is
that I’ve actually scanned in these questions and answers using a scanner and
was thinking it would be easier to crop out the actual images of the questions
and answers so instead of having to embed that information in the code, I could
instead just have the Questions, “A,B,C,D” answers reference those picture
files.

In addition, after each question is
presented, the user can click on the A,B,C, or d answers which then will have a
picture overlay signifying if the user got the question right or wrong, and
after a second or two of delay, continue on to the next question. Lastly, I was
wanting there to be a score at the top that would show the users score in real
time.

I hope someone can help me get this thing going. It would be greatly appreciated!

This topic has been closed for replies.

2 replies

Participant
June 25, 2014

Ok, I've simplified my question a little bit. I am now trying to make a term and definition quiz where I have the term displayed in the t dynamic textbox and the definition displayed in the d dynamic textbox. I have each term and it's definition stored in variable arrays which are labeled T1 - T10 and each time the submit button is hit, I'm trying to figure out how to clear both dynamic textboxes and show a different array that would be randomly selected. This is what I have so far.

stop();


var T1: Array = ["Interest Unities", "Definition"];
var T2: Array = ["Possession Unities", "Definition"];
var T3: Array = ["Appurtenance", "Definition"];
var T4: Array = ["Chattel Real", "Definition"];
var T5: Array = ["Community Property", "Definition"];
var T6: Array = ["Concurrent", "Definition"];
var T7: Array = ["Courtesy", "Definition"];
var T8: Array = ["Defeasible", "Definition"];
var T9: Array = ["Determinable", "Definition"];
var T10: Array = ["Conditional", "Definition"];

;

submit.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);

function fl_MouseClickHandler(event: MouseEvent): void {

function fl_GenerateRandomNumber(limit:Number):Number
{
var randomNumber:Number = Math.floor(Math.random()*(limit+1));
return randomNumber;
}

d.text = (T1[0]);
t.text = (T1[1]);
}

.....any advice??

Participant
June 27, 2014

I'm not sure if I understand your question exactly. Are you able to get the text to show up in the text boxes, and then it isn't changing, or what is going on?

I think that you would have to make a new dynamic class using the keyword "dynamic". To dynamically create a new instance of this class, you would have to use the keyword "new".

ex) InstanceName.ClassName = new ClassName();

Not sure if this helped. Sorry if it didn't. I'm new to the form, and relatively new to ActionScript too. I'd love to see how this project of yours turns out though.

Ned Murphy
Legend
June 18, 2014

You need to start developing this to match the plan you have.  If you are expecting someone to do that for you then you might have to consider paying for that level of help.  If you can get something started and then show the code that you are having a problem with you will be more likely to get help for free.

For starters, if you have an issue with randomizing things you might want to skip the added cimplication of randomizing everything and just get things to load up properly.  YOu can add in the randomization later.  When you do get to the randomization you will ewant to look into using the Math.random() method.