Solved

Set dynamic text to bold using actionscript 2

Posted on 2010-09-02
2
606 Views
Last Modified: 2013-11-11
Experts,

Im struggling to set a dynamic text field to bold at run time. I have the following code:

on (rollOver) {
      this.ans1_txt.textColor = 0xff0000;
      this.ans1_txt.bold=true;
}

The first line successfully sets the color, but the second line fails to embolden...

Any suggestions would be appreciated.

Regards
Easynow
0
Comment
Question by:Dean OBrien
2 Comments
 
LVL 18

Accepted Solution

by:
Antonio Estrada earned 500 total points
ID: 33591637
Try the following instead:

<code>

-V
on (rollOver) {

	var textFormat:TextFormat = new TextFormat();

	textFormat.color = 0xFF0000;

	textFormat.bold = true;

	this.ans1_txt.setTextFormat(textFormat);

}

Open in new window

0
 
LVL 12

Author Closing Comment

by:Dean OBrien
ID: 33594967
Awesome thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now