/ Published in: ActionScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
///////put this somewhere with your other functions////// TextField.prototype.applyStyles=function(styles){ fmt = new TextFormat(); for (var key:String in styles){ fmt[key]=styles[key]; } this.setTextFormat(fmt); } ////////pass in an object with all the styles you want myTextField.applyStyles({color:"0xFFFFFF",letterSpacing:-2,bold:true,size:18}); /* here's some other styles (flash8) myTextField2.applyStyles({ align:"center", blockIndent:10, //indents the text block 10pt bullet:true; font:"Gill Sans", indent:"3", //indents first character 3pt italic:true, kerning:true, //kerning enabled leading:15, //15 pixels (line spacing) leftMargin: 10, //10 point left margin leftMargin: 10, //10 point right margin underline:true, color:"0xFFFFFF", letterSpacing:-2, bold:true, size:18 }); */