views:

75

answers:

1

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
    }
+3  A: 

I fail...

The line: titleString = sentText; should have been: vTitle.text = titleString;

Leon
+1 For awesome-ness, don't you love finding those?
Tyler Egeto
+1 Because you found out your own error. Good job :)
Christopher Richa
Yup, one of the greatest feelings as a coder/programmer :D
Leon