createTextField question

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

sendText.onRelease = function() {

	trace(" Send out text ");

	// text


	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

Question by:mingchih
  • 2

Accepted Solution

Dreammonkey earned 500 total points
Comment Utility
You're not targetting the test mc right,
this should work :
sendText.onRelease = function() {

	trace(" Send out text ");

	// text


	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


Author Comment

Comment Utility
cool.... so, how do i write code to control font and size ?

Expert Comment

Comment Utility
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?

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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 …
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 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 use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

772 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

10 Experts available now in Live!

Get 1:1 Help Now