Why does the textField not show up when I change the defaultTextFormat
Posted
by Leon
on Stack Overflow
See other posts from Stack Overflow
or by Leon
Published on 2010-04-13T21:47:33Z
Indexed on
2010/04/13
21:53 UTC
Read the original article
Hit count: 321
I have an if/else statement which checks the length of my current title, and then is suppose to change the defaultTextFormat of the title textField and set the text.
Currently the title will not show up now, no matter what character length the title is, any thoughts on what I could be doing wrong here?
public function switchTitle(sentText):void
{
titleString = sentText;
trace("---------"+"\n");
trace("Forumula testing");
trace("titleString = "+titleString);
trace("titleString.length = "+titleString.length);
trace("titleSize/10 = "+(titleSize/10));
trace("\n");
// If Title can fit:
if (titleString.length < (titleSize/10)) {
vTitle.defaultTextFormat = Fonts.VideoTitle;
titleString = sentText;
// If Title can't fit:
} else if (titleString.length >= (titleSize/10)) {
vTitle.defaultTextFormat = Fonts.VideoTitle2;
titleString = sentText;
}
trace("---------"+"\n");
//vTitle.text = titleString; // <-- Original code, worked
}
© Stack Overflow or respective owner