create text in a parent MC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxHeight
    New Member
    • May 2007
    • 1

    create text in a parent MC

    I'm trying to put text in a MC one level up.
    Here's what I've tried so far:


    _parent.textBox .createTextFiel d("deck", 1, 0, 0, 300, 100);

    Where textBox is the instance name of the MC at the parent level.
  • bergy
    New Member
    • Mar 2007
    • 89

    #2
    I've never used the createTextField function. I've opted instead to create a new movieclip with a dynamic text field inside of it (so I can specify font settings) and then load that movie from the library onto the stage, give it an instance name and then modify the text inside of the dynamic text field in the movieclip. Hope that helps, there are tons of tutorials about loading movieclips and working with dynamic text boxes in flash - just google it if you're not sure how to do it.

    Originally posted by maxHeight
    I'm trying to put text in a MC one level up.
    Here's what I've tried so far:


    _parent.textBox .createTextFiel d("deck", 1, 0, 0, 300, 100);

    Where textBox is the instance name of the MC at the parent level.

    Comment

    • Atran
      Contributor
      • May 2007
      • 319

      #3
      Originally posted by maxHeight
      I'm trying to put text in a MC one level up.
      Here's what I've tried so far:


      _parent.textBox .createTextFiel d("deck", 1, 0, 0, 300, 100);

      Where textBox is the instance name of the MC at the parent level.
      Hello, Try this code:
      Code:
      //Create a new text format.
      var txtFormat:TextFormat = new TextFormat();
      //Set txtFormat properties.
      with (txtFormat) {
      	bold = true;
      	font = "Curlz MT";
      	color = 0xD55E2B;
      	size = 32;
      }
      //Make the root create a textField.
      //txtbox is the instance name.
      _root.createTextField("txtbox", 0, 12, 12, 100, 100);
      //Set to txtbox a new text format.
      txtbox.setNewTextFormat(txtFormat);
      //Set txtbox text.
      txtbox.text = "Hello";
      And it doesnt works when you write _parent.textBox .createTextFiel d.
      TextBox doesnt create TextField, the movie(_root) creates that.

      Comment

      Working...