?
Solved

Set dynamic text to bold using actionscript 2

Posted on 2010-09-02
2
Medium Priority
?
616 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
Antonio Estrada earned 2000 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

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…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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 …
Suggested Courses

765 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