PDA

View Full Version : Font Size


Zath
09-17-2005, 08:26 PM
How would the font size be changed using this code...

var test_mc:MovieClip = this.createEmptyMovieClip( "test_mc", this.getNextHighestDepth() );
test_mc._x = 500;
test_mc._y = 45;

var test_mc:MovieClip = eval( this + ".test_mc" );

var verticalOffset:Number = 0;
test_mc.createTextField( "text_txt", test_mc.getNextHighestDepth(), 0, verticalOffset, 290, 180 );
var text_txt:TextField = eval( test_mc + ".text_txt" );
text_txt.autoSize = false;
text_txt.wordWrap = true;
text_txt.selectable = false;
text_txt.border = true;
text_txt.html = false;
text_txt.textColor = 0xFF0000;
text_txt.text = "TEST";



I have tried to do it with .html = true and .htmlText, but problem with that way is my background is black and I can't seem to get the font color to change using that method.

Thanks,

Thanks,

moot
09-18-2005, 05:56 PM
you know about setting the format?

macromedia support (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary513.html)

Zath
09-18-2005, 06:27 PM
Thanks, I figured it out earlier. Should have posted it here....

public function showText(myText:String):Void{
var link_mc:MovieClip = this.createEmptyMovieClip( "link_mc", this.getNextHighestDepth() );
link_mc._x = 400;
link_mc._y = 45;

var link_mc:MovieClip = eval( this + ".link_mc" );

//this.removeMovieClip(link_mc);

var verticalOffset:Number = 0;
link_mc.createTextField( "link_txt", link_mc.getNextHighestDepth(), 30, verticalOffset, 350, 75 );
var link_txt:TextField= eval( link_mc + ".link_txt" );
link_txt.autoSize = false;
link_txt.wordWrap = true;
link_txt.selectable = true;
link_txt.border = true;
link_txt.borderColor = 0xFFFF00; //yellow
link_txt.html = true;

var m:String = "Comic Sans MS";
var t:String = "#FFFFFF"; //white
var r:String = "20";

//link_txt.htmlText = "<font color=\"#FFFFFF\" size =\"20\">" + myText + "</font>";
link_txt.htmlText += "<font color=\""+t+"\" size=\""+r+"\" face=\""+m+"\">"+myText+"</font>";


}



Thanks,