Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 333

Programming actionscript 3.0
Table of Contents

Advertisement

Assembling XMLList data
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
scope of this declaration is the
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
method uses the return value of the
xmlLoaded()
converts it to a string:
XML.prettyPrinting = false;
rssOutput = outXML.toXMLString();
directive has function block-level scope. This means that the
method.
buildItemHTML()
Example: Loading RSS data from the Internet
method and
buildItemHTML()
333

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents