3 Replies Latest reply on Mar 21, 2007 8:38 AM by kglad

    [b]Password actionscript[/b]

    PLEGEM
      Password script

      I found this actionscript on the net, i try it and it didnt work when i used it in my flash.
      please look at it.
      This is the site: flash password site

      This is the script in frame 1:
      -----------------------------------------------------
      // define an external variable

      var externalVars = new LoadVars();
      // when the file is loaded the password will be assigned to the
      // variable name of the variable in the text file ’secretcode’.
      //’content’ is the name of the variable contained in the text
      //file.
      externalVars.onLoad = function() {

      secretcode = this.content;

      }

      // load the text file.
      externalVars.load("code.txt");

      // When button is pressed�.
      ok_btn.onPress = function() {

      // if ‘thePassword’ input text box = ’secretcode’
      // then goto frame 3.
      if (_root.thePassword.text == _root.secretcode) {

      _root.gotoAndStop(3);

      } else {

      // else ‘thePassword’ is incorrect then goto frame 2.
      _root.gotoAndStop(2);

      }

      }

      thePassword.password=true;

      ----------------------------------------------------
      what is rong with it?
      thanks...