2 Replies Latest reply on Jun 16, 2006 11:05 PM by dmcdonald

    Key.getCode inconsistencies

    dmcdonald
      I am having problems with an interactive module that I created. It was built to work with the 6.0 player. Sometimes this codes works and sometimes it does not - can someone see something wrong with the way this is written?

      Key.removeListener(userKeynm);
      passwordz = "|";
      Selection.setFocus("passwordz");
      passwordz.tabEnabled;
      passwordz.tabIndex= 1;


      userKey = new Object();
      userKey.onKeyDown = function(){
      if (((Key.getCode() == Key.CONTROL) || (Key.getCode() == Key.ENTER)) && (passwordz == "LEARNINGFS" || passwordz == "learningfs")){
      gotoAndPlay("pressf2");
      } else {
      if (((Key.getCode() == Key.CONTROL) || (Key.getCode() == Key.ENTER)) && !(passwordz == "LEARNINGFS" || passwordz == "learningfs")){
      gotoAndPlay("wrongpass");
      }
      if ((Key.getCode() == Key.TAB) && !(passwordz == "LEARNINGFS" || passwordz == "learningfs")){
      gotoAndPlay("wrongpass");
      }
      if ((Key.getCode() == Key.TAB) && (passwordz == "LEARNINGFS" || passwordz == "learningfs")){
      gotoAndPlay("pressenter");
      }
      }
      }
      Key.addListener(UserKey);
      stop();
        • 1. Re: Key.getCode inconsistencies
          dmcdonald Level 1
          Help? Seriously!
          • 2. Re: Key.getCode inconsistencies
            dmcdonald Level 1
            After playing with this -- some more -- it seems like what is happening is if the person types in the wrong thing and is sent back to say "wrongpass" - I have to have it go to the frame before in order to have the code process. It's like it will not reset/process the code unless I have a frame before the destination from.

            Example: frame 10 - with code: gotoandPlay ("wrongpass")
            frame 11 (code above)

            I'm wondering if I don't have the listener keys figured out right?? I'm putting them first in the code remove the last listener.