A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: "loadvariables" and "if" not working together

  1. #1
    Junior Member
    Join Date
    Aug 2004
    Posts
    15

    "loadvariables" and "if" not working together

    PLEASE HELP!
    im trying to store a password in a .txt file. when i load the password into a flash file using loadvariables (and confirm the variables have loaded) and ask if this loaded variable is the same as the text written into the password box by the user, it always returns false even if the two are the same. this is my code:

    if (passtry==passcheck) {
    gotoAndStop ("end");
    }

    where passtry is the input password text
    and passcheck is the loaded variable

    i even tried loading the variable into a text box and using a code and then comparing the input text to that text box...this did not work either...is there something i'm missing?

    thanks
    Attached Files Attached Files

  2. #2
    Junior Member
    Join Date
    Aug 2004
    Posts
    15

    you'll need this

    to view this file, you'll need this text file as well
    Attached Files Attached Files

  3. #3
    Senior Member
    Join Date
    May 2004
    Posts
    182
    i cannot look at your fla file, but if the strings are equal it must return true. did you trace the values?

  4. #4
    Junior Member
    Join Date
    Aug 2004
    Posts
    15

    yep.

    yep. i traced them they're the same. i never encounter this unless i am using load variables and a conditional statement. if i compare the input: passtry with either "12" (the right password) or a dynamic text box with 12 typed into it, it works fine, but obviously this does not solve my problem in this case...but when i compare passtry with a dynamic text box that has the variables loaded into it or directly with the variables it does not work.

  5. #5
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    I am sure that if you will load this text file, everything will be OK.
    Attached Files Attached Files

  6. #6
    Senior Member
    Join Date
    May 2004
    Posts
    182
    looks like the variables do not get loaded or you incorrectly access the loaded variables. i bet if you put
    Code:
    trace(passtry + "," + passcheck)
    right before the if statement they will be different. sorry again, i do not have flash IDE installed on this comp to see your files.

  7. #7
    Junior Member
    Join Date
    Aug 2004
    Posts
    15

    yes!!!

    yes! thanks sergwiz, that totally worked! YOU RULE!!! i hope good things happen to you.

    thanks for helping me add a lot to my site: emogame.com

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