Solved

Set dynamic text to bold using actionscript 2

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

707 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