TextField + TextFormat => text does not show even though is there

i am trying to make a function to deal easily with text formatting. there seems to be a problem as the text in the textfield is not visible. all the parameters and attributes are set properly when i trace, i can even copy the text from the textfield, but i cannot see it.

/**
* Description
* @author Mat Janson Blanchet
* @version 0.1
*/


package {
    
    // imports
    import flash.display.MovieClip;
    import flash.text.TextField;
    import flash.text.TextFormat;
    
    
    // class definition
    public class Main extends MovieClip {
        
        // variables
        
        
        // constructor
        public function Main () {
            
            var textfield:TextField = new TextField ();
            var text:String = "<p>some paragraph 01</p><p>some paragraph 02</p><p>some paragraph 03</p>";
            
            format (text, textfield, { width:160, height:80, selectable:true, multiline:true, border:true }, false, { font:"_arial", size:16, color:0x000000 } );
            
            addChild (textfield);
            
        }
        
        
        // events
        
        
        // functions
        public function format    (
                                    
                                    text            :String,        // text to display
                                    textfield        :TextField,        // textfield to target
                                    textfieldParams    :Object,        // textfield parameters
                                    textfieldIsHTML    :Boolean,        // whether or not the textfield should display in html
                                    formatParams    :Object            // format parameters
                                    
                                )    :void {
            
            trace ("textfield parameters: ");
            // loop through the parameters name and associate the proper value to the textfield
            for (var txtfldParamName:String in textfieldParams) {
                textfield[txtfldParamName] = textfieldParams[txtfldParamName];
                trace (textfield + "[" + txtfldParamName + "] = " + textfieldParams + "[" + txtfldParamName + "]");
                trace ("textfield[txtfldParamName]: " + textfield[txtfldParamName]);
                trace ("textfieldParams[txtfldParamName]: " + textfieldParams[txtfldParamName]);
            }
            trace ("textfield: " + textfield)
            
            trace ("");
            trace ("format parameters: ");
            // loop through the parameters name and associate the proper value to the textfield
            var format:TextFormat = new TextFormat ();
            
            for (var fmtParamName:String in formatParams) {
                format[fmtParamName] = formatParams[fmtParamName];
                trace (format + "[" + fmtParamName + "] = " + formatParams + "[" + fmtParamName + "]");
                trace ("format[fmtParamName]: " + format[fmtParamName]);
                trace ("formatParams[fmtParamName]: " + formatParams[fmtParamName]);
            }
            trace ("format: " + format);
            
            trace ("");
            trace ("textfieldIsHTML: " + textfieldIsHTML);
            trace ("text: " + text);
            // input text into textfield
            if (!textfieldIsHTML) {
                textfield.text = text;
                trace ("textfield.text: " + textfield.text);
                
            } else {
                textfield.htmlText = text;
                trace ("textfield.htmlText: " + textfield.htmlText);
            }
            
            textfield.embedFonts = true;
            trace ("textfield.embedFonts: " + textfield.embedFonts);
            textfield.setTextFormat (format);
            
        }
        
    }
    
}

does anyone know what i forgot or did not do right? i also enclosed the fla and the as if it helps anyone

[quote=nikefido;2312049]you can’t embed fonts programmatically using Flash (as you can with Flex)

if you use “textfield.embedFonts = true” then you need to embed the fonts you are using (which increases the size of your .swf file!)

you do this via your stage - find your library options, go to “new font”, select your font, name it, click OK and then right click it in your library, go to Linkage and then Export to ActionScript

You can then use that font as an embeded font (be sure that your textFormat uses the name of the font that you chose when importing the font to your library)

additionally, there are some issues with using HTML tags in text (you have to set it to use html text, i didn’t see if you did that or not)[/quote]

How else can I do this in AS2