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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number Comparison only comparing first digit

Status
Not open for further replies.

goody1577

Programmer
Jun 19, 2001
2
CA
I'm writing a quiz program in flash that access a database using asp. The quiz length is pass from asp to flash. but when i compare the current question number to quiz length it seems to only compare the first number.


Ex.
When it tries to load the third question of 20, this happens.

Question = 3
Length = 20

(Question > Length) return true.

It seems to only be comparing the first digit of variable.
But if I put Length in a textbox it displays the number fine.

 
I'm not sure but maybe you should try using number

Sharky99 >:):O>
 
I had a similar problem when I loaded a value in from a text file. Flash thought they were text because they were on seperate lines and had CR/LF at the end.

I had to convert them to numbers and remove the end characters :-

Flash
question_qty = number(q_qty.substring(0,(q_qty.length-2)))

quiz.txt
&question_qty=3
&question_points=1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top