Solved

Set dynamic text to bold using actionscript 2

Posted on 2010-09-02
2
607 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

23 Experts available now in Live!

Get 1:1 Help Now