3 Replies Latest reply on Nov 18, 2007 9:40 AM by kglad

    syntax

    jonnybennett Level 1
      Im trying to setTextformat a textfield by inserting its path into the setTextFormat, however the final line isn't working...

      clipname='_root.text1.text2.my_txt';
      newTextFormat=new TextFormat();
      newTextFormat.font='arial';
      this[clipname].setTextFormat(newTextFormat);

      How can I do the correct syntax for the final line? thanks to any responders.

      p.s. I know that the setTextformat works because...
      _root.text1.text2.my_txt.setTextFormat(newTextFormat);
      works fine.