Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: resize dynamic text movie without resizing text?
From: Bryan Ax
Date: Mon, 05 Mar 2001 03:49:40 -0000

OK, one problem solved, another one pops up.

I'm making this little ticker - generated dynamically from a database.

So, the ticker might be short, like:

"You Rule!"

or it might be really long, like:

"Organization announces new rules for educational spending."

So, I'm trying to make it so that after I import the text, I count the
number of chars in it, and then use that number to try and resize the
one-line text box to a new width - that way short tickers won't take forever
to scroll across the screen. Here's the script on the MC:


//variable coming in is called results, var success determines if this
operation has finished

if (success eq "0") {
this.Results = "No current events at this time";
//if results are 0, then put up no current events
}
//calculate the length necessary for the field, based on the number of
characters in the text field
temp1 = this.Results.length; //results is a var that stores the results
coming in
txtWidth = temp1 * 9; //9 is just some number I've come up with, based on
font size. Should probably make this dynamic,too, but not doing it now.
this._width = txtWidth;
this.TickerResults = this.Results; //tickerResults is the final variable
assigned to the dynamic text field.
gotoAndPlay (8);


Pretty simple script. However, the problem is that when I resize the text
field, the text within it all gets resized too - so for short ones, it
squishes in a heck of a lot, and for really long ones, it stretches the hell
out of the text.

So my question. Is there any way to resize the width of a dynamic text
element while leaving the text inside of it as is, looking normal? In the
script above, I've tried loading the text in to the variable, then setting
the width, and vice versa, setting the width, then loading the text.
Neither worked.

Sincerely,

bryan ax




[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]