A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Creating a Quiz in Flash?

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Location
    Saugus, MA
    Posts
    14

    Creating a Quiz in Flash?

    I'm a flash n00b (=P), so I figured I'd just start off by making a simple quiz. I am going to revolve the quiz around the popular video game series "Mega Man X". I already have all of the questions and answers, the classic multiple choice set-up will be used, but I just need flash work. Some questions were going to be audio related such as "Who says this?" and the viewer would hear the sound file and guess, but I also want for them to click a "Replay" button, in case they needed to hear it again. I also intended on having some questions display an image and ask "What X game is this from?" or "What character is that?". If anyone can help me that would be greatly appreciated.

    Thank You

  2. #2
    Senior Member pup100's Avatar
    Join Date
    Oct 2004
    Location
    Close
    Posts
    575
    That's a big ask AlphaAxl - Unfortunately it would encompass a lot of the disciplines in Flash that would probably take months to learn & about 30 pages in this forum to explain fully.

    Although not here to plug any book, Colin Moock's "Flash MX – The definitive Guide" actually takes you through building an online quiz from a simple linear version to a much more sophisticated "Object" based one.

    It can be done & probably with just a day or so with the right reference book will see you having a fair stab at it.

    We are always here to help out if you have a more focused question during your studies.

  3. #3
    Junior Member
    Join Date
    Dec 2004
    Location
    Saugus, MA
    Posts
    14
    Thanks for replying pup100. Yeah, I know it's a big thing to ask, but can someone tell me how to do certain steps of it? Such as...

    1. Creating a Loading Screen
    2. Create a button that would take you to the quiz after loading
    3. Create a multiple choice selection
    4. Create an audio clip to play for a question
    5. Show an image for a question

    If anyone could answer any of those, that would be amazing. If not, could someone direct me to a flash tutorial that explains a quiz as such? I've googled and found nothing yet. By the way, I already put the quiz into an .xml file, if that helps at all with the ActionScript. Thanks again everyone!

  4. #4
    A Flashkit User
    Join Date
    Sep 2005
    Location
    Ontario, Canada
    Posts
    405
    Hey Alpha

    Thats asking a lot...but lets take this one step at a time.

    Okay so this post is referring to your second question about buttons.

    So on your time line, create a keyframe on frame 1 which would be your LoadScreen and create another keyframe on frame 2 which would be the starting of your quiz (this is for example purposes, this might be different from what you might want but it will work either way). F6 is the shortcut to creating keyframes.

    Now you will want to create a button and place it onto frame one. Since your new to flash, I will now go through the steps of creating and programming a button:

    -Draw what you want for your button. (a box with the text "Begin" on it or something along those lines)

    -Select all of your drawing, right click, "Convert to Symbol", "Button"

    -Open this button, and you should see the following in the timeline:
    -Up -> What the button looks like on the screen

    -Over -> What the button looks like when the mouse is over it

    -Down -> What the button looks like when your mouse button is down on it

    -Hit -> The area around the button where you want it to begin to register i it as a button (being able to click)


    Now the button should be on frame one where the load is. Click on the button and open the actions panel (or press F9 which is its shortcut) The action panel is where you do all the coding. Copy this code and place it in the button.

    on (Release){
    gotoAndStop(2);
    }

    This code means that when you release your mouse off the button, it will stop on frame 2 of the timeline. You will also want to create a new layer on your timeline called Actions and on the first frame open the action panel and insert this code into it:

    stop();

    This is prevent it from constantly playing through frame 1 and 2.

    Thats pretty much it for the buttons you wanted. Theres a lot of info in what I just posted, so if you dont understand, just post your problem and we'll try to help you out =D

    -Ostil-

    PS Mega Man bring back good memories from the good old days =D
    Last edited by Ostil; 11-29-2005 at 02:56 PM.

  5. #5
    A Flashkit User
    Join Date
    Sep 2005
    Location
    Ontario, Canada
    Posts
    405
    Okay Alpha,

    This post is referring to your question about Audio Clips:

    I'm also assuming that you dont know how to create Movieclips which you will need. I'll explain how to use these for your audio like I did for your buttons.

    Okay begin by importing your sound clip into your library. Now create a new movieclip (the shortcut is Ctrl-F8) and name it according to what the voice clip is. Once you name it, push okay and it will open the movieclip.

    Next drag the sound clip onto the stage anywhere and you will see in the movieclip's timeline that it will span the amount of frames that is needed to play the sound. Thats alright because once you put this on your main timeline, it will only take up one frame.

    Now create a new layer called Actions and create a keyframe on the frame where the sound clip ends (put this keyframe in the actions layer of course). Then insert the stop action like the one used in your button:


    stop();


    This will make it stop playing at the end.

    Thats pretty much all you need for the sound portion. Just drag the sound movieclip onto the stage on the frame you want it too play on. Each frame on your main timeline should be a different question. So if the 5th question has a voice clip in it, you would create a keyframe on frame 6 (keep in mind that the load screen is on frame 1 so question 5 will be on frame 6) and just drag on the movieclip with the corresponding sound clip.

    Of course your going to need to make seperate movieclips for each voice clip.

    Again, if your confused, just ask your questions here =P

    -Ostil-

    PS I suggest you do this part first before going into the replay button.
    Last edited by Ostil; 11-29-2005 at 03:16 PM.

  6. #6
    A Flashkit User
    Join Date
    Sep 2005
    Location
    Ontario, Canada
    Posts
    405
    Alright next up...

    This ones referring to your question on Loading Screen.

    First up, if this is a big file and takes a while to load, you can use something called a preloader. There are a ton of tutorials about those here on flashkit as well as other flash sites. However, I suggest you dont worry about the preloader right now. But you can have a Main Screen that can be used as a menu with buttons that link you too instructions, the game, highscores (which Im not even going to explain how to make haha...) and things like that.

    Okay so to create a Menu Screen, want you want to do is have this main screen on frame 1 of your timeline so it will be played first. Each 'page' of your .fla (quiz questions, instructions, etc.) will need its own frame on the timeline so organize things accordingly.

    So for this main screen, just draw what you want. You can use the flash tools to create it or other programs and import your images into flash and drag those onto the stage. Have a title, funky grahpics that are MegaMan related, and anything else you want to make it look snazzy.

    Now for your buttons, just use the same idea explained in my buttons tutorial. Just make a keyframe for your intructions on frame 10 (im just using frame 10 for example purposes) and write out your instructions on that frame. Then on your instructions button (which should be on frame 1 where your menu is), you would put in the code:

    on (Release){
    gotoAndStop(10);
    }

    So thats the basics. You can have a menu screen will these things to make it more like a game. But for now, I dont think you should worry about a load screen.

    -Ostil-

    PS Search for preloaders in the tutorial section if you want too learn more about them and how too use them
    Last edited by Ostil; 11-29-2005 at 03:30 PM.

  7. #7
    Junior Member
    Join Date
    Dec 2004
    Location
    Saugus, MA
    Posts
    14
    Wow...thank you SO much Ostil! *bows down to the flash God* =P

  8. #8
    A Flashkit User
    Join Date
    Sep 2005
    Location
    Ontario, Canada
    Posts
    405
    NEXT!!! *ahem*...

    Alright Alpha, this post will go over putting on images for your questions.

    This is a very simple thing too do. To do this, get your images that you want and make them all nice and clean in a program such as photoshop. After, just import them into your flash library. The library is where all the things you create are (things such as your movieclips, buttons, etc. so that they can be used again and again).

    Now on the questions that you want images, just drag those images onto the frame's stage that correspond with that question. Thats all there is too it! But of course..easy things have a catch to it...

    If you want to animate images or anything in general, they need to be converted into a graphic or movieclip. I explained how to convert objects already in the buttons tutorial, so just do the same thing to your images but convert them into movieclips.

    When these images are movieclips (or graphics, but I prefer movieclips for some reason), you can do all sorts of things such as fades, spins, animating, etc. But if you just want them to be there when you are on that question, minds as well not convert them to save space. However, animating them makes it more fancier and you might want to look into doing that later on.

    Thats pretty much it. Just import and drag onto the stage.

    -Ostil-

    PS Heres a tip because this is project is going to have a lot of objects in your library. Keep your library organised with folders and name everything including layers, movieclips, everything. That way you know where and what everything is.

  9. #9
    A Flashkit User
    Join Date
    Sep 2005
    Location
    Ontario, Canada
    Posts
    405
    Okay...finally...(my fingers are going to fall off)...

    This post is going to be about your choice selection. I'm also assuming that your going to be using buttons so this will be also referring to the first post about buttons:

    Now for each question, your going to want to make different answers. Each of these answers should be buttons. For example, the question could be "What colour is Mega Man's standard armour?". You will then create buttons for the answers:
    -White
    -Red
    -Blue
    -Black

    Just follow the buttons part I wrote. Now for the programming portion, you will want to have the gotoAndStop code. So for the correct button BLUE, you would put the code:

    on (release){
    nextFrame();
    }

    This will play the next frame if its clicked which would be the next question. And for the three wrong buttons, you would put the code:

    on (release){
    gotoAndStop(100)
    }

    Frame 100 would be your gameover screen (of course 100 being only an example).

    Okay thats the basics of it all, pretty simple. I hope this was the way you were planning on creating your answers, if not, just say so. =P

    -Ostil-

    PS I noticed all the other posts had PS's so I felt obligated to put one here...

  10. #10
    A Flashkit User
    Join Date
    Sep 2005
    Location
    Ontario, Canada
    Posts
    405
    Okay AlphaAxl

    Thats all of it in a very basic way. Yes basic, and look how much there is! That is why we like it when people post specific and focused questions like pup100 had said in the second post. =P

    Keep in mind, this was all an example, so there might be things you will have to change around to make them fit your needs. Also, there are other ways of doing things but I tried to keep it very basic for learning purposes.

    This is a basic skeleton of a quiz game, you can always change it around and make it look awesome with animations and such. So use your imagination!

    Dont forget to ask us if you get stuck =D

    -Ostil-

    PS There are way better flashers out there then me =P

  11. #11
    Junior Member
    Join Date
    Dec 2004
    Location
    Saugus, MA
    Posts
    14
    Thanks again Ostil, you are such a big help =D

  12. #12
    Senior Member pup100's Avatar
    Join Date
    Oct 2004
    Location
    Close
    Posts
    575
    Quote Originally Posted by AlphaAxl
    Wow...thank you SO much Ostil! *bows down to the flash God* =P
    Me too!!!

  13. #13
    Junior Member
    Join Date
    Dec 2004
    Location
    Saugus, MA
    Posts
    14
    Quote Originally Posted by pup100
    Me too!!!
    True...me is sorry...lol =P

  14. #14
    Senior Member pup100's Avatar
    Join Date
    Oct 2004
    Location
    Close
    Posts
    575
    Quote Originally Posted by AlphaAxl
    True...me is sorry...lol =P
    Sorry AlphaAxl I think my comment may have been lost in translation.

    By the observation I meant that I was also impressed by Ostil's "valor beyond the call of duty" in his multiple post, not that I had missed out on any praise.

    That won't be the first time that our peculiar British sense of humor has fallen flat on its face

    Thanxs anyway & I hope with the commendable help Ostil has given you, you are on your way to becoming an Action Script master.

    P100

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center