Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Actionscript Code for calculating percentage

Status
Not open for further replies.

polyglot

Programmer
Nov 28, 2007
11
Helloo All,

I have a problem that I simply cannot solve after having messed around with it for a couple hours... I am sure the solution is so simple it's stupid, but I still can't figure it out. I am new to Flash and quite new to actionscript, but I can't figure out why this little problem is so difficult for me to solve because I have figured out how to code far trickier things than this... I am really not of a programming background - I am a foreign language teacher. So be nice to me!!! :eek:)

Anyway... I have come up with a quiz-type game where my students will be told what percentage of questions they got right at the end. The variable for number of questions right is "nbrRight". The variable for total number of questions is "maxscore". The percentage will show up in a dynamic textbox with the variable "percRight". Here is my code (which I have placed as a frame action):

percRight = nbrRight/maxscore * 100;

Instead of a percentage showing up, I keep getting "_level0.perc" in the percRight textbox. Can anyone help me with this??? Any help will be greatly appreciated!

Thanks!
Monica D
 
Hello-

Never mind this post - I figured it out!!

Thanks!

Monica D :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top