• Embed Doc
  • Readcast
  • Collections
  • 17
    CommentGo Back
Download
 
 
Tutorial on building aninteractive quiz in FlashActionscript 3
flashbynight.com 
 
 What you will learn:
 
how to build a quiz using Flash AS3
 
using randomization techniques
 
storing data in arrays
 
storing data in xml (optional)
Prerequisites:
 
working copy of Flash version 8 or above
 
working knowledge of how to use the Flash interface
* You can download the completed source filesfrom here: www.flashbynight.com/tutes/quiz.htmlMaking a quiz with randomized options in AS3
So here we go. We want to make a quiz in Flash AS3 where the options are randomized.We may also want the questions to come up in a random order. What’s more, we maywant to reuse our code for further quizzes. How can we do all this? The answers are righthere in this tutorial. Read on.Step 1People have a funny habit of making tiny little Flash movies. But we want our quiz to bebig and exciting. Open up Flash and modify the stage size to 600 x 800. This way, we geta nice big stage, but it will still display on laptop screens:
 
 Fine. Save the file under the name ‘quiz.fla’ and let’s move on.Step 2We need some sample questions for the purpose of the tutorial. We should have aboutfour, I think, so here they are:Question 1: Where is Seoul?Right Answer: South KoreaWrong Answer: JapanWrong Answer: North KoreaQuestion 2: Where is Bucharest?Right Answer: RomaniaWrong Answer: HungaryWrong Answer: Poland
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...

Hi Kropompong - The x position of the tick and cross are set manually (step 7), so you can simply reposition them on the screen. Alternatively, if you look at the last part of the code: ButtonAction2,3,4 where we set the y position: tick.y=shade1.y etc, you can set the x position: tick.x= XXX; where XXX is the position on the screen that you want.

Thank you mookstar, this tutorial really help me and it works fine! :) i have a question, when I click the answer, the cross or thick button show up but a lil bit far from the answer. how can I make sure the cross or tick button just beside the answer? thank you. :)

Hello hatersal. It should work. Did you get an error message?

Thank You so much for this tutorial! I do have a question though, how do I add more questions in the quiz? I just tried adding more questions and answers in the array part but it did not work.

...(cont)... then play around with it. If you need further help, contact me at fbnmail-at-flashbynight.com (replace -at- with @)

Hello Marwan. The good news is that you don't need programming knowledge to do what you want to do. You simply need to change the positions on the screen. You can basically copy and paste a background image....or did you mean a different image for each question because you would would need a line or two of code for that. You can download the files here: http://www.flashbynight.com/tutes/quiz/ ...

Thank you so much! I have been looking for a woring tutorial for ages. I really needed this for my project. Although, could you please help me with something else? I need to add a start screen and have a different background image for each. Also have the answers horizontally rather than vertically? This is really important ! I would edit it myself but i have 0 knowledge in AC3.{ marwan.mm@live.com

Hi Rajab, I saw your email and I'll pick up the conversation there.

You must be to leave a comment.
Submit
Characters: ...