Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

createTextField question

Posted on 2008-06-24
3
Medium Priority
?
221 Views
Last Modified: 2010-04-03
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
Comment
Question by:Brian Lin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Dreammonkey earned 2000 total points
ID: 21856092
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
 

Author Comment

by:Brian Lin
ID: 21856279
cool.... so, how do i write code to control font and size ?
0
 
LVL 8

Expert Comment

by:Dreammonkey
ID: 21856351
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question