Skip to main content
Known Participant
June 8, 2013
Question

How do I get bold text on this xml-element with AS3?

  • June 8, 2013
  • 1 reply
  • 838 views

How do I get bold text on this xml-element with AS3?

It goes to a scrollable list component, where I have 2 lines of text per "button".

I do not want to do it in the XML file (due to practical reasons.)

The element(s) I want to show as bold through the list component is in bold in the code below:

var loader:URLLoader = new URLLoader();

loader.addEventListener(Event.COMPLETE, onLoaded);

list.addEventListener(Event.CHANGE, itemChange);

function itemChange(e:Event):void

{

          ta.text = list.selectedItem.data;

}

var xml:XML;

function onLoaded(e:Event):void

{

          xml = new XML(e.target.data);

          var il:XMLList = xml.Planter.Lauvtre;

          for(var i:uint=0; i<il.length(); i++)

          {

                    list.addItem({data:il.Farge.text(),

                                                            label:il.Botanisk_navn.text() +"\n"+ il.Norsk_navn.text() });

          }

}

loader.load(new URLRequest("lauvtre.xml"));

This topic has been closed for replies.

1 reply

Inspiring
June 10, 2013

that depends what you want to use to render your data on screen.

If you use a Textfield you can simply display the content with htmlTexts <b> Tag