all groups > flash actionscript > february 2004 >
You're in the

flash actionscript

group:

Verifying password


Verifying password Dinghus
2/4/2004 8:47:24 PM
flash actionscript:
This is so basic it hurts.

I have a form asking for name and password. The form sends the data to a CF template which verifies it against a db. IF the data is good, CF returns the word "good" in the variable "verified", if not, the word "bad" is returned.

This all works. I get either "good" or "bad" into Flash. BUT I can't get it to pass the if statement.

I do this:

if(verification.verified == "good") {
gotoAndStop(section2);
} else {
isVerified.text = "Invalid login. Please try again";
gotoAndStop(start);
}

No matter what I do, I get the invalid login message. I have checked by having the isVerified.text = verification.verified and it is "good".

Why can't I get actionscript to recognize that the 2 are the same?

Oh, the CF script I'm using just to troubleshoot is this:

<cfset returnToFlash = "&verified=okay">
<cfoutput>
#returnToFlash#
</cfoutput>

Re:Verifying password Dinghus
2/5/2004 8:09:05 PM
Nobody knows?

Wow.

Nobody else has ever uploaded data into Flash and then compared it to a set variable already in the movie?


Re:Verifying password Dinghus
2/5/2004 8:23:02 PM
Never mind. I tried an old trick and it worked.

Just so anybody else trying to do this and is having a hard time with it, the trick I used was to use the indexOf method on the incoming string.

So I did this:

if(verification.verified.indexOf("verified") != -1)

I checked to see if the word "verified" was anywhere in the returned string. If not, the result is -1.

If anybody has a better way, let me know.

AddThis Social Bookmark Button