1 Reply Latest reply on Apr 29, 2006 10:40 AM by kglad

    change var using equation

    jondro
      Hi I hope you can help:
      I have a dynamic textbox with the var set to "pres" and a text file named "bio.txt" which contains the following variables:

      &pres=something
      &page= test
      &page1=something else
      &page2=etc.

      When i click the button called "next_btn" for the first time I want it to change the var 'pres' to 'page1', and then the second time to 'page2' and so on. So the textbox should display "something" when it loads and then after clickin the button it should display "something else".

      here is the actionscript:

      loadVariablesNum("bio.txt", 0);
      n=1;
      next_btn.onRelease = function() {
      nextImage();
      pres=page+n;
      n++;
      trace(pres);
      };

      When it loads the dynamic textbox displays "something" but when i click the button it should display the var 'page1' which is "something else" but instead it displays "test 1". Why won't "something else" come up when I click the button??? If you need a simple fla file to work with i will be happy to make one. Thanks...
        • 1. Re: change var using equation
          kglad Adobe Community Professional & MVP
          that's probably not going to work the way you want. while you can redefine the variable associated with a textfield by assigning its variable property, after doing so you'll need to redefine the string the variable stores in order for you textfield to "see" that value.

          why not just use the text property of text fields and use: