Solved

createTextField question

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

733 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