A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Simple math. (Should be anyway)

  1. #1
    Member
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    40

    Simple math. (Should be anyway)

    I have two variables:

    Correct
    Incorrect

    I want to work out a percentage.

    (Correct / (Correct plus Incorrect)) X 100

    The result should be a percentage.

    I'm mucking up the code here I know and I'm almost embarrassed to post it here but here goes......


    yourScore = ((correct / (correct - - incorrect))*100);

    Note - I have the variables correct and incorrect showing properly in their own text fields so I'm sure I've declared the variables correctly. Just need help with the math bit. I thought it was as simple as how you'd do it on the Mac calculator but apparently not. Note also the " - - " was my attempt instead of using the " + " character.

    I AM happy to report that I THINK this might be the final stroke in what's been a fantastic learning experience for me and much to the thanks of this forum!

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    code looks right, except for - -

    would you mind posting your FLA file?
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Member
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    40
    Sadly the FLA is MASSIVE still (haven't started optimizing it). But happily the need for the above equation was removed so I'm good but I do thank you for offering to help me sort it out.

  4. #4
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Make a duplicate/copy of your FLA, delete all the images of that duplicated FLA from the library, and post it here so we can replace the movieclips with shapes and help fix your code.

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