2 Replies Latest reply on Jan 9, 2008 2:47 AM by kapoan

    getFocus and formatting

      I have some textAreas and want to apply custom formatting on actually selected texArea..
      Here is my code:
        • 1. Re: getFocus and formatting
          niki tsanov Level 1
          So here the code i change some of the things i remove the listener and just put onSetFocus function when the textfield is created and also see i input code for new movieclip where to store your textFields because i see your label for your small problem also :)

          var pole:Array = new Array("prvni text", "druhy text", "treti text", "ctvrty text");
          var souradnice:Number = 50;
          var my_fmt:TextFormat = new TextFormat();
          my_fmt.align = "right";
          my_fmt.bold = true;
          var my_mc:MovieClip=this.createEmptyMovieClip("mcForText",this.getNextHighestDepth());
          for (var i = 1; i<=4; i++) {
          var nazev:String = "text"+i+"_txt";
          my_mc.createTextField(nazev, i, 50, souradnice, 200, 20);
          // another small problem... how can i create text area in my_mc?
          // my_mc.createTextField(nazev,i,50,souradnice,200,20);
          souradnice += 30;
          my_mc[nazev].text = pole[i-1];
          my_mc[nazev].onSetFocus = function() {
          // here it is OK
          // this[nazev].setTextFormat(my_fmt);
          • 2. Re: getFocus and formatting
            kapoan Level 1
            Thank You, for fast andd serious replay! I'm sooo happy... Yesterday a was trying this about 5 hours... Tahnx again!