4 Replies Latest reply on Mar 9, 2008 8:59 PM by rlc5611

    CreateTextField not showing - HELP!

    clem_c_rok Level 1
      Hello,
      I'm creating a series of movie clips that are attached from the library.

      After the movie clip is attached, I want to create some text on that movie clip. When I try this, I can't see any of the text that is created

      When I print the movie clip contents it shows that the the mytext textfield exists:

      j:mytext : _level0.mc_scroll_group.masked_movie.scrollpage.show_db_list.mc_show_plate.mytext
      j:mc_image_loader : _level0.mc_scroll_group.masked_movie.scrollpage.show_db_list.mc_show_plate.mc_image_loade r
      j:instance3 : _level0.mc_scroll_group.masked_movie.scrollpage.show_db_list.mc_show_plate.instance3

      Here's the code I'm trying:

      [code]
      _root.mc_scroll_group.masked_movie.scrollpage.attachMovie('show_db_list', 'show_db_list', 1, {_x:4, _y:4} );

      //==== build test fields ======================================
      _root.mc_scroll_group.masked_movie.scrollpage.show_db_list.mc_show_plate.createTextField(" mytext",10,0,0,300,300);
      _root.mc_scroll_group.masked_movie.scrollpage.show_db_list.mc_show_plate.mytext.multiline = true;
      _root.mc_scroll_group.masked_movie.scrollpage.show_db_list.mc_show_plate.mytext.wordWrap = true;
      _root.mc_scroll_group.masked_movie.scrollpage.show_db_list.mc_show_plate.mytext.border = true;

      myformat = new TextFormat();
      myformat.size = 14;

      _root.mc_scroll_group.masked_movie.scrollpage.show_db_list.mc_show_plate.mytext.setTextFor mat(myformat);
      _root.mc_scroll_group.masked_movie.scrollpage.show_db_list.mc_show_plate.mytext.text = "this is some test text";
      //=============================================================
      [/code]

      Any help is desperately needed!

      Thanks,
      Clem
        • 1. Re: CreateTextField not showing - HELP!
          clem_c_rok Level 1
          It's weird - the only thing that will show up is the text border and I gave the text a color and the only thing that shows up is the border. I also tried the setNewTextFormat idea instead setTextFormat.
          • 2. Re: CreateTextField not showing - HELP!
            rlc5611 Level 1
            It can take time to attach a clip from the library so you really should wait to ensure that the attached clip is instantiated before trying to do something with it. I don't think that is your problem here though since you can see the outline of the textbox. I would use setNewTextFormat also but what I believe is happening is that you have set a timeline mask for the text clip and don't have embedded fonts so they don't show up. So either embed the fonts or use setMask to se the mask dynamically (or both) through AS and it should show up.
            • 3. Re: CreateTextField not showing - HELP!
              clem_c_rok Level 1
              I have tried to embed the fonts like this:
              [code]
              depth = _root.mc_scroll_group1.masked_movie.scrollpage['show_db_list' + i].mc_show_plate.getNextHighestDepth();
              _root.mc_scroll_group1.masked_movie.scrollpage['show_db_list' + i].mc_show_plate.createTextField("mytext"+i,depth,10,30,150,40);
              _root.mc_scroll_group1.masked_movie.scrollpage['show_db_list' + i].mc_show_plate["mytext"+i].embedFonts = true;
              [/code]

              I have also tried to embed all Upper and lower case fonts manually w/ no luck.

              Still trying to make the dynamic mask work.

              • 4. Re: CreateTextField not showing - HELP!
                rlc5611 Level 1
                For the setMask to work, the text must be contained within a movie clip. You cannot dynamically mask the textfield itself AFAIK. Also, if you do place the textfield in a clip and use setMask, do NOT use the embedFonts = true if they are not really embedded.

                Go to the library panel in the upper RHC and click the dropdown and click on "New Font". Select the font you want to embed from the popup window and give it a name (such as "myfont").