Graph Opinion

I would like to get people’s opinions on what would be easier for me to do. I am working on a game/quiz where people will select a state from a US map, and have to answer a question about each state. There is going to be a fake opponent that they are competing with, and if the player gets an answer right a bar/graph will move up for them, but if they get it wrong it will move up for the fake opponent.
That is the part I would like opinions about. Would it be easier for me to have a mc that plays according to whether the right or wrong answer is selected or is the code to do that not too complicated?

I will probably go the route of having mc’s that play depending on whether a right/wrong answer is selected because I am not very advanced as far as my scripting skills go. I just like to have some background before I dive into because everyone here always comes up with some good ideas that I would not have thought of.

Thanks.

what you have described is certainly doable.
Other options might be just to alter the height properties of 2 “bar” shaped mcs. Or to use attachMovie to attach square shaped mcs to simulate 2 bars. You could store them in arrays and then use removeMovieClip() when you wanted a bar to go down. I would probably go for this last option but i sometimes tend to over complicate things so you are better going with what you are most comfortable with.

Well hello, Stringy. :}

I will probably just go with the bar shaped mc’s. I think I can accomplish what I want without too much of a struggle, and since they will only have the option to go up (either the players or the opponents) it won’t be too complicated. I can just put the if statements on the radio buttons and depending on what is selected it will attach the appropriate move into an empty mc.

Just thought I would throw the idea up on the forum and see what people had to say because I have learned my original thoughts are not always the easiest or best way to do things.

Hello Jillymo
well it should be fairly easy to do and perhaps as you learn a little more you could add to it. Maybe have the last block start flashing if the player is taking too long to answer and then disappear etc.
How are you loading your questions/answers into the file?

yeah, definitely use _height . i’d use easing so it animates.

Stringy, I am loading the questions as swfs once the person clicks the state (you know about this because of all your help with my other post) They each contain the question with multiple choice radio button answers and whatever extra - animations, images…whatever. Therefore, I will put in code similar to this in order to know which mc should load (the opponents graph growing or the players graph) this is the general idea…it will be loading into a container mc not just at a set axis on the stage.

function checkradio() {
if (radiogroup.getValue() == “a.”) {
_root.attachMovie(“graph”,“graphnew”,2) ;
graphnew._x = 860;
graphnew._y = 453;
}
else if (radiogroup.getValue() == “b.”) {
_root.attachMovie(“graph”,“graphnew”,2) ;
graphnew._x = 860;
graphnew._y = 453;
}
else if (radiogroup.getValue() == “c.”) {
_root.attachMovie(“graph2”,“graph2new”,2) ;
graphnew._x = 860;
graphnew._y = 453;
}
else if (radiogroup.getValue() == “d.”) {
_root.attachMovie(“graph”,“graphnew”,2) ;
graphnew._x = 860;
graphnew._y = 453;
}
}

Oops,forgot, my memory is not so good these days :beer:
Yes i did know you were loading images etc in but thought maybe you were just having the textfields in the main movie.Maybe load them in from a txt file or something.

Well if you mean what I think you do by saying load them in from a text file, I may be able to do that. But how would I put the workings of the quiz questions into that? Meaning I modified the Flash Template Learning Interactions to fit what I used for the questions.
I guess you would have to write the function that sets the workings of the question with variables and the variables would be the questions and answers loaded from the text files. I don’t know if I could manage that, but I wouldn’t say it’s impossible especially if I got the basics down and then brought it to the forum for comment.

this is what will happen;
the person will click a state
a mc will load over the us map (white with alpha set so the map barely shows through)
then the question will show up in that area…once the person selects an answer they will get feedback as to whether they are wrong or right, and a running total of how many right they have out of how many they have answered (which I have to go back and put in because I took it out of the learning interaction model I used)
Dependent on which they have selected thier bar or opponents bar will go up, and the mc that loaded over the US Map will be removed along with the question allowing them to choose another state

also, there is going to be a space to the left of the map/question area that will play mc’s that are clues to the answer if it takes them too long to get the answer.
:p:

How you described the text file thing is pretty much it but you can simulate arrays in textfiles so you could have one variable holding all your questions etc. However, since you are going to have to open up the seperate flas anyway to edit the visual clues should you decide to change the questions, its probably better just to leave the text as it is.

well the visual clues will be seperate files from the questions as well. It’s going to be like a user interface with 4 sections:

  1. section for map
  2. section where person’s name is displayed with some other information
  3. section where clues are displayed
  4. section where bar graph is displayed

ok,you certainly have tons to do. I would consider having your questions in the main movie and use swapdepths() to position them above the states you are loading in.Also the bar graph might be better in the main movie.
If you decide to get your questions/answers from a textfile then i`ll try make you a simple example

Oh yes and did I mention I have to design the interface to put all this in as well? :to:

Okay what would be the difference between using swapdepths() or using the loadMovie command to load the swf into a container clip placed on a higher level than the states are displayed on?

Blimey you really do have your hands full.
I just think it is easier if you can keep as much together as possible (without significantly increasing file size).

Stringy I hate to bother you, as you have been such a great help so far I don’t want to ask more of you but I am going to anyway… :smirk:
If you get a chance, could you take a look at this thread and let me know what you think?

http://www.kirupaforum.com/forums/showthread.php?t=65355

It certainly can be done.All you need are a couple of arrays, one containing the correct answers and the other to store the answers of the user. Then just compare the 2. I would also try and keep all the code in the main movie (bet you are getting sick of me telling you to keep stuff together)and the main thing to remember here is that each movie you are loading in must be fully loaded before you can tell it to do anything, so basically you need some preloader type code.(might as well make a preloader on the main movie to load in the others while you are at it although this depends on how you are loading them in-just loading into one clip would be easier to script but if you load into seperate clips may be able to sort of stream(load in the background),it would also be easier to make transitions).I dont know how radio buttons work because basically i do not use the flash components and i have had a long day at work today but if you can wait until tomorrow ill make you a simple question/answer thing so you can see how the variable s are passed between files and stored in arrays. Another thing that will save you work is to label all the textfield/variable and radio buttons with the same instance names in each of the movies.
Are you wanting to retrieve the scores of users or is it just for their benefit?

Hi Stringy, I hope you had some time to relax :beer: after your long day at work yesterday.
I am looking to provide the score (how many correct out of how many answered) for the user’s benefit. The goal of this “game” is to get at least 6 out of 10 answers correct.
Right now, I am waiting on some more approval from my boss’s bosses…(L)
that we can go ahead with all the ideas we have so far. So, I am going to test somethings but until I get final approval, which I think will be tomorrow, I guess that is all I can do.
So anyway, no pressure right now and I do so appreciate you walking me through all this. Cheers! :beer:

(added later) ps I got the scoring thing going…just made a couple of dynamic text boxes that add an increment of one depending upon which radio button gets chosen…I would just have to add the _root.totalquestions = _root.totalquestions + 1; or _root.total = _root.total + 1; (var name of the dynamic text fields are totalquestions and total) to get value function of each radio button (probably not the easiest way)

see if there is anything in here of any use
http://www.gifsrus.com/testfile/states.zip

Well I downloaded the fla’s but there is no as anywhere in any of the files?

hmmm, try download again, there should be script in mainstate1 and mainstate

Okay I will…have to go for now, off to register my daughter for school. I will take a fresh look at it first thing in the morning. :thumb: