17 Replies Latest reply on Aug 18, 2010 3:31 PM by Ned Murphy

    Help me create a flash quiz please!



      I need to make a drop/drag/target quiz AND/OR text box asap where they enter info and be told if its correct or not.


      Can anyone help me?


      I am having problems understanding what I need to do - Ive tried a few tutorials but find them too complicated.


      Am using CS4 (AS3).



        • 1. Re: Help me create a flash quiz please!
          Ned Murphy Adobe Community Professional & MVP

          Your problem is too general.  Unless you have something to show that you are trying to get working that you can describe and show code for, you are not likely to get someone here to help.  What are the chances that someone else can provide you with directions if you cannot follow directions already provided by some number of others who tried already by creating tutorials?

          • 2. Re: Help me create a flash quiz please!
            Toto Kent

            Agreed. Maybe if you could be more specific on your desired output, then we can help you better.

            • 3. Re: Help me create a flash quiz please!
              larousse1979 Level 1

              Well for the drag and drop,

              something like:

              They drag an image (have created the images myself) over a word and it comes up correct or incorrect.

              I dont know any code - complete novice.

              Would like this for 5/6 images/words.


              The word entry is for verbs.

              For example:

              In the text box below, type the first person present tense of "to go".

              They type in "I go" and maybe submit a button to see if they are wrong or right.



              • 4. Re: Help me create a flash quiz please!

                I will look for information or training tutorial on how to create an interactive presentation where a video is interrupted by a series of questions and answers. I have a need for a similar project but as far as matching pictures to words, I hope someone else can help you with this, this is more advanced than my requirement.

                • 5. Re: Help me create a flash quiz please!
                  larousse1979 Level 1

                  Any help, please let me know asap. Need to get done tonight if possible.


                  • 6. Re: Help me create a flash quiz please!

                    For the text boxes, you can create an input text box.  Then give it an  instance name in the properties (each input field will need a different  instance name, so keep this in mind when naming them). Then set up a dynamic text field and give it an instance name, leave it blank, because this is where the correct/incorrect message will appear.  When that is  done, make your submit button.  Give the submit button an instance name.  Now go into the actions tab and set up the code as follows:


                    on (release) {

                    if (input_instance_name=="correct answer"){







                    replace any of the generic instance names with what the instance names of your text fields are.  Replace "correct answer" with what the answer to the question is, but keep it in quotes.

                    Not exactly positive about the coding part, pretty sure that SHOULD do the trick though.  The basic logic and setup is what you want to aim for when organizing it though.  As for the drag/drop, look up first how to make a drag/drop system.  There are a lot of threads on this forum about it, and I'm sure there's quite a few tutorials out there.

                    • 7. Re: Help me create a flash quiz please!
                      larousse1979 Level 1

                      Thanks for the reply and the help but the code will not work!

                      I tried it several times.

                      Is it because I am using AS3 (CS4?).


                      It only something simple I want - about 4 or 5 questions. If anyone can help me urgently, please I would really appreciated it.

                      • 8. Re: Help me create a flash quiz please!
                        FloCis2 Level 1

                        Thank you mldb88 for the information - This should help!

                        • 9. Re: Help me create a flash quiz please!
                          mldb88 Level 2

                          I'm more accustomed to AS2, so that might be why the code isn't working,

                          probably blending the two a bit, sorry bout that >.<'

                          What kind of errors are you getting with the code?

                          • 10. Re: Help me create a flash quiz please!
                            larousse1979 Level 1

                            Am getting too many errors to report...but thanks for your help. I understand the logic, just cant get it working...


                            Can anyone help please!!???


                            Entering words quiz or target drag and drop.


                            Its nothing big - for example, Ive images of a cat, a dog and a mouse. I want the user to be able to drag the name of the animal on or under the image and then an answer saying "They are correct!" or "thats incorrect".




                            enter a word into a text box and they are told if its right or wrong...


                            Any help appreciated - am very stuck.


                            I got some drag and drop code already that works and can move and drop the items but not target them:


                            cat.buttonMode = true;

                            cat.addEventListener(MouseEvent.MOUSE_DOWN , catDrag);
                            function catDrag(event:MouseEvent):void{


                            cat.addEventListener(MouseEvent.MOUSE_UP , catStopDrag);
                            function catStopDrag(event:MouseEvent):void{



                            • 11. Re: Help me create a flash quiz please!
                              Ned Murphy Adobe Community Professional & MVP

                              The code offered to you was AS2 and will not work in an AS3 file.


                              For the code you have, it will work for dragging an object though it is implementing a very bad practice that some actionscript programmers fall into... nesting named functions within other functions. It is unecessary and can result in problems.


                              In order to determine if an object is dropped on another object, you can use the hitTestObject method.  I am providing a link to a file that I made for you that demonstrates a drag and drop that indicates whether you get it right or not.


                              It also includes an example that assesses whether a user is entering the correct answer in a textfield... it uses an Event.CHANGE event listener to trigger a function that checks what a user enters as they enter it to see if they are getting the right answer as they go.




                              The challenge to you is to first come to understand how it is all working, and in succeeding there, modify it to suit your needs... I believe everything you might need to use is involved in the examples in some way... you just need to realize how to adjust them.


                              Both scenarios presented in the file are specific to the items in the examples, but in both cases more generic approaches could be taken where you could have the same functions used to evaluate any number of drag/drop or text entry interactions.


                              And as a result of making use of my artistic laziness license... that's a cat, not a dog.

                              1 person found this helpful
                              • 12. Re: Help me create a flash quiz please!
                                larousse1979 Level 1

                                Thank you very much Ned - I am at work at the moment so I will download and study this evening.


                                I understand what Ive to do - just dont know (or have time-that my own fault) to find the code that works for AS3.


                                I find it is so pernickety AS2/AS3 and am complete novice which doesnt help.


                                One more thing - is it made so the "next" button on a page wont show or they cant move forward until they get all options/words correct?


                                Thanks again.

                                • 13. Re: Help me create a flash quiz please!
                                  Ned Murphy Adobe Community Professional & MVP

                                  I did not attempt to show you how to build your quiz, I just showed how to accomplish some of the interactions you described.  If you do not have time to learn, then you need to find funds to pay someone to do your design work for you.

                                  • 14. Re: Help me create a flash quiz please!
                                    larousse1979 Level 1

                                    Ned - I 1000% appreciate the help -but I dont think that comment was fair. I have 48 pages of content and other interactions made.

                                    I simply cannot get code or code working for those two quizzes and syronising buttons.


                                    It may take you 1 minute to know what is wrong with code etc... it can take me 24hrs.

                                    • 15. Re: Help me create a flash quiz please!
                                      Ned Murphy Adobe Community Professional & MVP

                                      That was entirely fair, but from your position, it is understandable that you cannot accept it.  Yes, it may take you a long time to figure out something, but that is something we all have to go thru in gaining a level of proficiency at something.  Do you think it took me 1 minute to create what I did for you?


                                      No one but you is responsible for your workload. If you do not have the ability to do something, then you need to either take whatever time is needed to acquire the ability or get someone else to do the work.  If you don't have the time, then you don't have a choice, but seeking out free help/lessons from a forum as a solution to meet a schedule is gambling more than just a deadline.

                                      1 person found this helpful
                                      • 16. Re: Help me create a flash quiz please!
                                        larousse1979 Level 1

                                        I really have been trying ned.


                                        I have created my text input boxes etc.

                                        But because its looking for the same length of characters to verift the answer, it doesnt work and because I dont know the code, I cant fix it.


                                        I have been trying believe me.


                                        For example, if I want the answer to be je suis. If I enter je suit it will accept it as being correct because it is the same length.


                                        Please help.

                                        • 17. Re: Help me create a flash quiz please!
                                          Ned Murphy Adobe Community Professional & MVP

                                          That's not how my version verifies the correct answer, so you need to study it some more... first it tests if the user entry (as each letter is entered) matches the answer and it only says correct when the 2 lengths agree after it passes the matching (done this way to avoid using a button to click to check the answer).  Don't be afraid to look things up in the help documents.  All of the methods and properties you need to know are explained there.


                                          You could take a different approach altogether that doesn't automatically test the answer like my version.  Just have a button that when clicked tests to see if the user input matches the answer.

                                          1 person found this helpful