Solved

How to make dynamic text expand to fit text Flash CS4?

Posted on 2011-02-27
2
565 Views
Last Modified: 2012-06-21
I have dynamic text converted to an so I can expand the dynamic text by 500% through a tween. The text ( a single word) in the box will change periodically so I can't say exactly how large of a box I'll need.

As the word in the box changes sometimes it fits, sometime it is just truncated at the right end. Sure wish the dynamic text box would expand itself to fit the text.

Anyway to do this without making the dynamic text box as big as my stage to start with?
0
Comment
Question by:chevronrod
[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 Comments
 
LVL 17

Accepted Solution

by:
deepanjandas earned 500 total points
ID: 34993987
Yes, using autosize property:

Try this sequence:
var titleFormat:TextFormat = new TextFormat();
titleFormat.bold = true;
titleFormat.color = 0xFFFFFF;
titleFormat.size = 14;

var titleLabel:TextField = new TextField();
titleLabel.defaultTextFormat = titleFormat;
titleLabel.autosize = "left";
titleLabel.label = data;
addChild( titleLabel );

Open in new window


Warm Regards
Deepanjan Das
0
 

Author Closing Comment

by:chevronrod
ID: 34994021
Too bad they don't put autosize (and maybe some others) in the Properties panel of text boxes....
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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 set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

691 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