Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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 select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

705 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

21 Experts available now in Live!

Get 1:1 Help Now