Question

I got a symbol that has a TLF text placed, and I need to retrieve the information of this text and use it. The thing is, everytime that kind of text is on the stage, I get a weird result, in the content of the currentTarget of the load result, instead of the children of the movieclip I get a MainTimeline__Preloader. <- what is this?, and why does the TLF text break my symbol?.

Do you guys know of any way to do this?.

Thanks.

(The classic text works, but, I don't get informatino from it, I'd like to have some info like font used, style, etc, I think the TLF text could be used for this, correct me if Im wrong).

Was it helpful?

Solution

Frankly, TLF text is a horrible beast and messes up your swf if not used absolutely correctly.

Luckily you can get details on the formatting used in classic text by using the getTextFormat method like so:

var textField:TextField;
var textFormat:TextFormat;

textFormat = textField.getTextFormat(0,0); //replace these numbers with where in the text you want to read the formatting

trace(textFormat.color)
trace(textFormat.font)
trace(textFormat.bold)
trace(textFormat.italic) //etc
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top