A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [RESOLVED] Math game HELP !

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Posts
    4

    [RESOLVED] Math game HELP !

    Here's the thing... I have to make a game of basic math learning.

    So I have two dynamic text fields (no1 & no2) that generate random numbers at a press of a button, and an input text field (answer) to type the result.

    Then I have an OK button with this:

    on (release, keyPress "<Enter>") {
    if (answer eq no1*no2) {
    gotoAndPlay("good");
    }
    else {
    gotoAndPlay("bad");
    }
    }


    The problem is... it ALWAYS sends me to the "bad" Frame Label.
    Can anyone tell me how can I fix this?

    Thank you ! ^^;

  2. #2
    Senior Member Genesis F5's Avatar
    Join Date
    Jan 2002
    Location
    Unallocated memory
    Posts
    1,845
    Did you put a stop(); on the bad frame? If the frame order is "good" then "bad", if you don't have "stop();" on frame "good" the movie will play to frame "bad" because you're using "gotoAndPlay()." Use gotoAndStop(); instead.

    Try changing your code to this:

    Code:
    if (answer == no1 * no2)
    {	gotoAndStop("good");
    }else {
    	gotoAndStop("bad");
    }

  3. #3
    Junior Member
    Join Date
    Feb 2007
    Posts
    4

    Nop

    No =/ That's not the mistake.

    Something strange I just realized is that if I save as MX 2004 it works ! But some other things don't... Is too weird =S I really need it to be in Flash 8.

    ><

    But thanks for the reply.

  4. #4
    Senior Member Genesis F5's Avatar
    Join Date
    Jan 2002
    Location
    Unallocated memory
    Posts
    1,845
    Attach a mock up of the project. Take out all non essential graphics / sounds so we can see what's going on. It seems the problem is a lot more complicated.

  5. #5
    Junior Member
    Join Date
    Feb 2007
    Posts
    4

    Here are the files

    Here's the basic system of how the game should work...

    The file saved as Flash 8 won't work... but the one saved as MX 2004 with no changes at all will.

    =(
    Attached Files Attached Files

  6. #6
    Senior Member Genesis F5's Avatar
    Join Date
    Jan 2002
    Location
    Unallocated memory
    Posts
    1,845
    You have to click on the answer box and in the properties window, uncheck "Auto kern." If you want to see what's going on, add "trace(answer)" to the submission button to see what's being outputted. It looks like Flash 8 parses auto kerned input as HTML.

  7. #7
    Junior Member
    Join Date
    Feb 2007
    Posts
    4
    Wow ! Thank you so much ! It seems all the un-knowledge that kept me from ending this thing has been solved.

    Really really THANK YOU !

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