The HTML data (an XMLList object) is of the following form:
<b>itemTitle</b>
<p>
itemDescription
<br />
<a href="link">
<font color="#008000">More...</font>
</a>
</p>
The first lines of the method clear the default xml namespace:
default xml namespace = new Namespace();
The
default xml namespace
directive has function
block-level scope. This means that the scope of this declaration
is the
buildItemHTML()
method.
The lines that follow assemble the XMLList, based on the string
arguments passed to the function:
var body:XMLList = new XMLList();
body += new XML("<b>" + itemTitle + "</b>");
var p:XML = new XML("<p>" + itemDescription + "</p>");
var link:XML = <a></a>;
link.@href = itemLink; // <link href="itemLinkString"></link>
link.font.@color = "#008000";
// <font color="#008000"></font></a>
// 0x008000 = green
link.font = "More...";
p.appendChild(<br/>);
p.appendChild(link);
body += p;
This XMLList object represents string data suitable for an ActionScript
HTML text field.
The
xmlLoaded()
method uses the return value
of the
buildItemHTML()
method and converts it to
a string:
XML.prettyPrinting = false;
rssOutput = outXML.toXMLString();