Copy link to clipboard
Copied
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"));
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now