Solved

createTextField question

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

688 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