Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-01-2012, 05:13 PM   #1
m2244
Member
 
Join Date: Oct 2008
Posts: 66
Default How to bold text using this text format

I am trying to set a portion of a textfield to a certain format (Red, size, etc). The formatting works for color, size, etc but when I try to add '.bold = true' to the format, it does not work. Does anyone know how to include a bold setting to a text format?

Code:
var textToBold:String = "";//This marks the text to highlight.
var startBoldText:int = 0;
var formatBoldText:TextFormat = new TextFormat("Times New Roman",15,0xFF0000);
formatBoldText.bold = true; //This does not work
Then when I need to use the format
Code:
if (originalString.search("______") >= 0)
			{
				originalString = originalString.split("______").join(evt.currentTarget.txtAnswer.text);
				textToBold = evt.currentTarget.txtAnswer.text;
				//trace("Trying to bold this: " + textToBold);
				startBoldText = originalString.indexOf(textToBold);
				targetArray[indexOfCurrentTarget].quesText.text = originalString;
				targetArray[indexOfCurrentTarget].quesText.setTextFormat(formatBoldText, startBoldText, startBoldText + textToBold.length);
			}
m2244 is offline   Reply With Quote
Old 08-01-2012, 06:01 PM   #2
[afz]snickelfitz
Senior Member
 
[afz]snickelfitz's Avatar
 
Join Date: Dec 2011
Location: Tucson, AZ
Posts: 1,888
Default

The bold version of the font must be embedded, in addition to the regular version.
The specifics of formatting text is available in the Adobe AS3 docs.
http://help.adobe.com/en_US/FlashPla...extFormat.html
[afz]snickelfitz is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:45 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.