Skip to main content
January 31, 2009
Answered

formatting dynamic text with html

  • January 31, 2009
  • 7 replies
  • 1209 views
i am trying to form text with html. rending text as html is on. but the html is showing as test

my code:
info = " Donna Bonessi <I>President</I>";
This topic has been closed for replies.
Correct answer kglad
re-read my message. i did not assign a htmlText property to info.

7 replies

kglad
Community Expert
Community Expert
February 1, 2009
don't use the return key when entering your sting.
February 1, 2009
i hate to be a pest but i am stuck

i put

info = "<p align='center'>Donna Bonessi <I>President</I></p>
<br>Donna Bonessi’s 18-year career providing services to persons with developmental disabilities (DD) has included general and business management, direct service experience, training, developing programs with both private not for profit and public agencies.";


errors:

1095: Syntax error: A string literal must be terminated before the line break.

1084: Syntax error: expecting identifier before end of program.
February 1, 2009
got it! i needed

bio_mc.biotext_txt.htmlText = info;
February 1, 2009
but infoTF is not an instance.

my code:
stop();
var closebutton:String;
var info:String;
var X:Number;
var Y:Number;
mission_btn.addEventListener(MouseEvent.CLICK, missionbtn);

events_btn.addEventListener(MouseEvent.CLICK, eventsbtn);

joinapse_btn.addEventListener(MouseEvent.CLICK, joinapsebtn);

contactus_btn.addEventListener(MouseEvent.CLICK, contactusbtn);


function about(info:String, X:Number, Y:Number):void {
bio_mc.biotext_txt.text = info;
bio_mc.x = X;
bio_mc.y = Y;
}
getbio_btn.addEventListener(MouseEvent.MOUSE_OVER, getbiobtn);
function getbiobtn(event:MouseEvent):void {
info.htmlText = " Donna Bonessi <I>President</I>";
X = 427.8;
Y = 513.1;
about(info, X, Y);
}

function shut(closebutton:String, X:Number, Y:Number):void {
bio_mc.biotext_txt.text =closebutton;
bio_mc.x = X;
bio_mc.y = Y;
}


bio_mc.closebubble_btn.addEventListener(MouseEvent.CLICK, closebubblebtn);
function closebubblebtn(event:MouseEvent):void {
closebutton = " ";
X = -314.6;
Y = -437.3;
shut(closebutton, X, Y);
}

am i missing your point?
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
February 1, 2009
re-read my message. i did not assign a htmlText property to info.
February 1, 2009
i put
info.htmlText = " Donna Bonessi <I>President</I>";

errors
1119: Access of possibly undefined property htmlText through a reference with static type String.

Warning: 1072: Migration issue: String is not a dynamic class. Instances cannot have members added to them dynamically.

Thank you for your help
kglad
Community Expert
Community Expert
February 1, 2009
use the textfields instance name and its htmlText property.
February 1, 2009
please explain. i want format each line
kglad
Community Expert
Community Expert
February 1, 2009
if your textfield has instance name infoTF, use: