19 Replies Latest reply on Dec 27, 2006 1:42 PM by kglad

    createTextField flash 7

    soleID
      Hello,

      I'm trying to create a text field inside a movieclip. This code works:

      var tempText = this.createTextField("tf"+k, myClip.getNextHighestDepth(), 100*k, 100, 75, 100);
      var tempMC = eval("tf"+k);

      tempMC.multiline = true;
      tempMC.wordWrap = true;
      tempMC._visible = visible;
      var text_fmt:TextFormat = new TextFormat();
      text_fmt.color = 0xFF0000;
      tempMC.text = "test";
      tempMC.setTextFormat(text_fmt);

      trace(tempMC); //traces: _level0.tf2

      If I change the first line to:
      var tempText = myClip.createTextField("tf"+k, myClip.getNextHighestDepth(), 100*k, 100, 75, 100);

      trace(tempMC); // traces: undefined

      This second way doesn't work. I don't want to create the text field in the root level (by using this.createTextField...). Does anyone have any idea why I'm getting an undefined from the second way?

      Any help is appreciated. Thanks!