1 Reply Latest reply on Jun 11, 2008 7:42 AM by kglad

    TextFormat not working : what did I do wrong ?

    Stéphane Mercier Level 1
      First, I am a flash newbie, so I am working with a friend much better than me at ActionScripting. We are working on a flash movie with a menu created from instanced movieclips ("synClip"). "synClip" contains 2 buttons showing a selected state (s_synBut) and an unselected one (u_synBut). Each button has a dynamic textfield named "titre".

      dynamic text is loaded from an .xml (menu.xml).

      I put the TextFormat actionscript on the first frame of "synClip" movieclip. Instances are then made from this movieclip thanks to the ActionScript present on the first frame of my flash movie (there is other code/functions there because I cleaned up my .fla rather roughly before uploading it as a simplified example).

      The Action Script on "synClip" is :

      var format01 = new TextFormat();
      format01.letterSpacing = 3;
      format01.font = "Myriad Pro Cond";
      format01.color = 0xff0000 ;
      titre.setTextFormat(format01);

      But it doesn't work : character kerning is still wrong

      I tried also setNewTextFormat but to no avail (also what is the difference between setNewTextFormat and setTextFormat ?)

      I think I won't be successful without some help on this thing, guys… :/

      the "menu.xml" file
      simplified.fla
        • 1. Re: TextFormat not working : what did I do wrong ?
          kglad Adobe Community Professional & MVP
          do you mean letterSpacing is not taking effect even in frame 1?

          if yes, is titre on-stage in frame 1 and has text already been assigned to titre (and that text property doesn't change)?

          setTextFormat() applies to all text assigned to your textfield's text property before you assign a textformat and assignNewTextFormat() applies to text you assign after you assign a textformat.