PDA

View Full Version : comparing textbox variable with loaded variable ????


l.smith@sixforty.co.uk
08-30-2001, 09:13 AM
Hi everyone :)

I am quite new to actionscripting in flash, but an old hand at PHP/Mysql.

I am using loadvariablenum to load some variable into my movie, I am displaying them in a text box so I know they are loaded and a at which level.

I am writing a quiz so I am loading the Q and A from a mysql database and the user answers by typing in a textbox, however when using - (myanswer_var eq answer_var) doesn't ever return a match, I've tried the same thing with the Q and A from a textfile and it works.

I am completely stuck, I've tried String() to make sure the variables are of the same type and I've tried different "equals to" operators.

Please can someone help me, it's driving me mad.

Look forward to hearing from you,

Leigh

mpol777
09-04-2001, 05:29 PM
i'm not quite sure this is what you're looking for but here's how to compare:

if (userAnswer == theAnswer) {
//they're the same
} else {
//they're not the same
}


you also want to make sure you have your paths correct when you do the if statement. such as:

if (moviClip1/userAnser == _root.theAnswer) {


and so on. that trips me up sometimes.