Number match game question

Hi, experts:

I have this script should show a formula ( ex. 45 - 15 = ? ) and on the buttons, there should have random number with one of right number on it. So, in this case, there should be a 30 on the button. Than click on the right number button. Then on the left corner, a sign would show " pass ".

This is a very simple math game. However, I could not make it working. It could not gerenate problem. Also, if problem gerenate, I also need one of button to match the number that generate from problem. I would like to ONLY gerenate number from 20 to 80. No number under 20 and over 80.

I attach a demo and please download it @ http://www.brianlinstudio.com/question/numbers.zip ....... What I can do to solve the problem ? If you need to return the solved file, please upload to http://www.brianlinstudio.com/uploadform.htm .... thanks so much !!
Brian LinDesignerAsked:
Who is Participating?
 
blue-genieCommented:
ok, mingchih,

go have a look here, and see if it's what you had in mind.

http://www.geocities.com/bluegenie_sa/ee/test.html

I just made this up now, and i've changed your code quite a bit, it uses some old code but it works.

the fla is available

http://www.geocities.com/bluegenie_sa/ee/test.zip

ps. developed in mx2004 as1.0
0
 
blue-genieCommented:
hi.

1. do you want it to include all operations, ie. +, -. * and /?

2. when you say numbers from 20 - 80, is that for the answers only?

blu

0
 
Brian LinDesignerAuthor Commented:
hi, Blu
For your 1st question, I only want + to show up.......2. 20 to 80 should be the question.... answer can be any number..... and one of button should show the answer..... other buttons are any number but should only range from 20 to 80 too...... thanks :)
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
blue-genieCommented:
what i did was:

1. generate 2 random numbers within  20 and 80 - doesn't matter if they're the same, cause you can have 55+55.

2. work out the answer and store in solution variable.

3. generate another 7 random numbers, checking to see that there are no duplicates (7 because i'll add the correct answer to make up 8 options)

4. put all the options into an array.

5. shuffle that array (otherwise correct answer will always be 1st option)

6. populate my movieclip btns with the options.

7. create a function to check what user has selected.

8. convert the text in the selected option to a number, and compare to solution, if same go to pass frame, if not do nothing (tracing at the moment, you can change it how you want)

9. I also added a gobackto 1 loop after passing, so it starts again, you can action accordingly.

blu.

0
 
y_o_yCommented:
I'll just give you an idea on how to implement that....

first set a button that will be holding the correct answer...which is randomize...

the button that holds the correct answer/number will no longer generate  numbers from 20-80...
0
 
Brian LinDesignerAuthor Commented:
wow, you are amazing.... this is what I need....new scripting is more smooth then what I had.....thank you !! :) I may post another question like this but much more complex.....hope you will have time to look at it. :)

Brian
0
 
blue-genieCommented:
right now, i'm sitting at work bored cause I can't my stuff to work, so its a pleasure to be able to get something right.

:-)
0
 
Brian LinDesignerAuthor Commented:
and additional explain is very helpful !! :)
0
 
Brian LinDesignerAuthor Commented:
Hi, Blue-genie:
I post the silimar question at http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21407018.html .... please take a look if you have time.... :))
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.