Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Text Size 1

Status
Not open for further replies.

simonWMC2

Programmer
Aug 5, 2004
161
GB
Hi !

I have some dynamic text, i set the properties of this text using the properties bar.
Then i needed to underline so i created
Code:
myformat = new TextFormat();
myformat.underline = true;

which worked nicely !

But now I want to set the test size using actionscript - but it always takes it from the properties window.

for the textsize i am using
Code:
myformat.textSize = 72;

any ideas how i can force it to take not of the actionscript over what is in the properties bar ?

thanks

 
Here you go:

Code:
myformat.size = 72;

Here is a broader example:

Code:
//create a new text format
myformat = new TextFormat();
myformat.underline = true;
myformat.size = 72;
myformat.font = "verdana";
myformat.color = 0xff0000;

//apply to existing field with instance name "myText"
myText.text = "This is the test text";

myText.setTextFormat(myformat);

//Create a text field, fill it and apply the text format
this.createTextField("my_txt", this.getNextHighestDepth(), 0,0,300,200);
my_txt.text="I just created this box"
my_txt.setTextFormat(myformat);

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top