6 Replies Latest reply on Jul 27, 2006 8:28 AM by kglad

    loadVariablesNum and If Statement

    Sambora
      Hi all,

      I'm trying to load a variable into a dynamic text field in my movie. This what I have in my .txt document.

      &sbd=20&

      On the stage I have a dynamic text field with the var name "sbd" In frame 1 of my movie I have the following script:

      loadVariablesNum("planes.txt", 0);

      This works fine and loads in the correct value from the .txt document into the text field.

      The problem I'm having is I what to use this result of what appears in the text field to play a label in a movie clip called on the stage called "sbdplane". For example if its 10 to to and play from label "plane" or if its 20 go to and play label "plane2".

      This is the code I'm using on frame 2 of my movie:

      if (_root.sbd="10") {
      _root.sbdplane.gotoAndPlay("plane");
      } else if (_root.sbd="20") {
      _root.sbdplane.gotoAndPlay("plane2");
      }

      This works fine when I set the value in the .txt document to 10 but when I change value in the txt document to 20 and resave it and then test it it shows 20 in the text field but ignores the if staement.

      Any help greatfully received as it driving me mad.

      Thanks