hallo,
I’ve got these dynamic text fields that have their autosize and multiline set to true. I assign a width when I create the textfields, but that doesn’t seem to have an effect. Using an interval, i cycle through an array that provides strings to populate the text fields.
The textfields seem to take the width of the first strings that populate them, and then stay that size, regardless of the amount of text in each new string.
what is this madness? :stunned:
I have some other formating things going on too, i just paste my code in case it helps:
import flash.filters.DropShadowFilter;
//-------------------------------
// SET VARIABLES
//-------------------------------
var tempQuotesArray:Array = new Array({q:"blah blah", a:"author"}, {q:"yadaee yada yada"+newline+"blah blah blah", a:"authoer name and stuff ogg"}, {q:"poop poop poop", a:"author name stuff stuff"});
var quoteTextHolderMC:MovieClip = _root.createEmptyMovieClip("quote_mc", 0);
var quoteTF:TextField = quoteTextHolderMC.createTextField("quote_txt", 0, 0, 0, Stage.width-80, 10);
var authorTF:TextField = quoteTextHolderMC.createTextField("author_txt", 1, 0, 0, Stage.width-80, 10);
var quoteTextFormat:TextFormat = new TextFormat();
var authorTextFormat:TextFormat = new TextFormat();
var textDropShadowFilter:DropShadowFilter = new DropShadowFilter(2, 45, 0x000000, .8, 2, 2, 2, 3, false, false, false);
var myFilters:Array = quoteTF.filters;
var switchQuoteInterval:Number;
var quoteIntervalTime:Number = 1000;
var quoteIndex:Number = 0;
//-------------------------------
// TEXT FORMATING
//-------------------------------
quoteTextFormat.font = "myArialQuote";
quoteTextFormat.size = 24;
quoteTextFormat.bold = true;
quoteTextFormat.letterSpacing = 5;
quoteTextFormat.color = 0xFFFFFF;
authorTextFormat.font = "myArialQuote";
authorTextFormat.size = 18;
authorTextFormat.italic = true;
authorTextFormat.color = 0xFFFFFF;
quoteTF.multiline = true;
quoteTF.autoSize = true;
quoteTF.embedFonts = true;
authorTF.multiline = true;
authorTF.autoSize = "right";
authorTF.embedFonts = true;
myFilters.push(textDropShadowFilter);
authorTF.filters = myFilters;
quoteTF.filters = myFilters;
//-------------------------------
// SET CONTENT
//-------------------------------
function newQuote():Void {
quoteTF.text = tempQuotesArray[quoteIndex].q;
quoteTF.setTextFormat(quoteTextFormat);
authorTF.text = tempQuotesArray[quoteIndex].a;
authorTF.setTextFormat(authorTextFormat);
// SET POSITION
authorTF._y = quoteTF._height;
quoteTextHolderMC._x = 20;
quoteTextHolderMC._y = Stage.height-quoteTextHolderMC._height-20;
quoteIndex = (quoteIndex<tempQuotesArray.length-1) ? quoteIndex+1 : 0;
}
//-------------------------------
// INIT INTERVAL
//-------------------------------
switchQuoteInterval = setInterval(newQuote, quoteIntervalTime);
newQuote();