Solved

createTextField question

Posted on 2008-06-24
3
211 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:mingchih
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Dreammonkey earned 500 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:mingchih
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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

803 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