Solved

createTextField question

Posted on 2008-06-24
3
210 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

947 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now