Solved

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

Posted on 2011-02-27
2
564 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

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft WSUS 4 114
Failed download 57 592
How to convert image files to a movie file 6 114
You Tube Videos not playing 9 143
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
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,…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses

738 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