• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

createTextField question

hi, experts

I am trying to place text inside another movie clip. The instance name is test. However, it's not working. How do I change the code ? Also, how do I change to the font and font size i want ?

thanks
sendText.onRelease = function() {
	trace(" Send out text ");
	// text
	test.createTextField("test_txt",5,0,0,300,200);
	test_txt.multiline = true;
	test_txt.wordWrap = true;
	test_txt.autoSize = "left";
	test_txt.type = "input";
	test_txt.maxChars = 16;
	test_txt.text = _root.message101;
	// bubbles
};

Open in new window

0
Brian Lin
Asked:
Brian Lin
  • 2
1 Solution
 
DreammonkeyCommented:
You're not targetting the test mc right,
this should work :
sendText.onRelease = function() {
	trace(" Send out text ");
	// text
	test.createTextField("test_txt",5,0,0,300,200);
	test.test_txt.multiline = true;
	test.test_txt.wordWrap = true;
	test.test_txt.autoSize = "left";
	test.test_txt.type = "input";
	test.test_txt.maxChars = 16;
	test.test_txt.text = _root.message101;
	// bubbles
};

Open in new window

0
 
Brian LinDesignerAuthor Commented:
cool.... so, how do i write code to control font and size ?
0
 
DreammonkeyCommented:
In the exact same way as you already did for the other presets :
test.test_txt.font = "Times New Roman" // "Times" on Max OS
test.test_txt.size ="555"// a little less will do the trick as welll...

Personnaly I find it much easier to already have a textfield on stage,
instead of creating one at runtime,
this way you have much more control over its appearance, (and you have to deal with a lot less code !!!)

but maybe that 's a different question?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now