Skip to main content
Chipleh
Inspiring
June 28, 2010
Answered

Display list of text in htmlText...

  • June 28, 2010
  • 2 replies
  • 593 views

I am having a problem with the following code.

//Display paragraph text

//evt is a parameter being fed into the function that represents a specific page number.

myText.htmlText = paragraphText;
var xmlSubMenuLength:Number = xml.sim.bodyText.page[evt].subpage.subtitle.length()
trace("mySubTitle = " + paragraphText + subTitleText);
if(xmlSubMenuLength>0){ 
   for(var j:Number=0;j<xmlSubMenuLength;j++){
    var subTitleText:String = xml.sim.bodyText.page[evt].subpage.subtitle;
    //myTitle.htmlText = subTitleText;
    trace("mySubTitle = "+ subTitleText);
    var topicOutline = subTitleText;   
   }
   myText.htmlText += "\n"  + "•" + subTitleText + "\n" +  "";

Right now, the code is displaying:

Content goes here
• Sub Test Data 1 Sub Test Data 2 Sub Test Data 3

What I really want to display is:

Content goes here
• Sub Test Data 1

• Sub Test Data 2

• Sub Test Data 3

Little help? I've been away from Flash for several months and I'm just now getting back to it.

Thanks,

~Chipleh

This topic has been closed for replies.
Correct answer

You can just make a simple list with HTML. You use <ul></ul> as that start end tags and then <li></li> within to create each list item. It would go something like:

myText.htmlText = "<ul>";

myText.htmlText += "<li> + subTitleText + "</li>";

myText.htmlText += "</ul>";

2 replies

Correct answer
June 28, 2010

You can just make a simple list with HTML. You use <ul></ul> as that start end tags and then <li></li> within to create each list item. It would go something like:

myText.htmlText = "<ul>";

myText.htmlText += "<li> + subTitleText + "</li>";

myText.htmlText += "</ul>";

Chipleh
ChiplehAuthor
Inspiring
June 28, 2010

Nice one, ty kglad...much appreciation.

kglad
Community Expert
Community Expert
June 28, 2010

use <br> or <P></P> with html text.