dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: problem with LoadVars.. help

  1. #1
    IT'S GON' RAIN !!! var gotMilk's Avatar
    Join Date
    Apr 2004
    Location
    Yorkshire, England, UK
    Posts
    372

    problem with LoadVars.. help

    hey guys,

    i wrote this but it dont seem to work, can anyone see what i done wrong..

    frame 1 on timeline
    code:

    loadPass = new LoadVars();
    loadPass.load("password.txt");
    loadPass.onLoad = function(success) {
    if (success) {
    trace('txt doc loaded');
    } else {
    trace('txt doc notloaded');
    }
    }



    movieclip
    code:

    on(press){
    if (_root.pass = loadPass.pass1){
    _root.gotoAndPlay(2);
    } else {
    _root.gotoAndPlay(3);
    }
    }




    its supposed load the password txt doc (which it does) and then when you press the button it checks what you wrote in the input box (variable name = pass) against what is written in the text document password.txt (pass1=password) if the correct password is written it goes to frame 2 and if not then frame 3, but it doesnt work? any idea why?

    cheers,
    Var.

    Professional quality freelance work done by Varstudios
    Visit us here http://www.varstudios.com/services



  2. #2
    Junior Member
    Join Date
    Dec 2003
    Location
    Greece
    Posts
    27
    I think that you have a minor mistake in you code. Try replacing if (_root.pass = loadPass.pass1){ with if (_root.pass == loadPass.pass1){
    ------------------------
    no smart things to say
    just smart things to do

  3. #3
    IT'S GON' RAIN !!! var gotMilk's Avatar
    Join Date
    Apr 2004
    Location
    Yorkshire, England, UK
    Posts
    372
    nope still doesnt work..

    if i use (=) it rejects whatever i write in password box

    if i use (==) it accepts anything i write even if i leave it blank.


    any other ideas?
    cheers,
    Var.

    Professional quality freelance work done by Varstudios
    Visit us here http://www.varstudios.com/services



  4. #4
    Junior Member
    Join Date
    Dec 2003
    Location
    Greece
    Posts
    27
    If I got that you want to do is to make some sort of authorization script based on a password (pass1) which is in a text file. If the user writes into the pass textfield the word password then it moves to frame 2 else it moves to frame 3. Correct?
    ------------------------
    no smart things to say
    just smart things to do

  5. #5
    IT'S GON' RAIN !!! var gotMilk's Avatar
    Join Date
    Apr 2004
    Location
    Yorkshire, England, UK
    Posts
    372
    yeah that right.
    why what ya thinking?

    Var.

    Professional quality freelance work done by Varstudios
    Visit us here http://www.varstudios.com/services



  6. #6
    IT'S GON' RAIN !!! var gotMilk's Avatar
    Join Date
    Apr 2004
    Location
    Yorkshire, England, UK
    Posts
    372
    help.. anyone?

    Professional quality freelance work done by Varstudios
    Visit us here http://www.varstudios.com/services



  7. #7
    Junior Member
    Join Date
    Dec 2003
    Location
    Greece
    Posts
    27
    sorry for late response... had to leave my office for a while

    It seems that you have to send the variables loaded from the loadVarsObject to the MC.

    Check out the fla. I think that this should be helpful.
    Attached Files Attached Files
    ------------------------
    no smart things to say
    just smart things to do

  8. #8
    IT'S GON' RAIN !!! var gotMilk's Avatar
    Join Date
    Apr 2004
    Location
    Yorkshire, England, UK
    Posts
    372
    thanks.

    Professional quality freelance work done by Varstudios
    Visit us here http://www.varstudios.com/services



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