Hi,
I dug out some old AS2 code - which used XFactorStudio's XPath
library to grab the first entry from the RSS feed and stick it in a text
field.
Below is the example (it uses a generic string replacement function
that I think came from Mike Chambers or someone @ adobe who did some
nice String library for AS2). AS3 will be similar, but you can use
e4X... Again, the blog content was simple text - they stayed away from
fancy formatting too much, although I have tried basic css formatting of
tags, which sometimes works... There are probably better examples out
there, but hopefully you can get the picture.
function _xmlLoad(success:Boolean ) {
if(success) {
var obj:Object = XPath.selectNodes(_xmlObj,
"//item[1]/content:encoded/text()");
//trace("Obj is " + obj);
var content:String = replace(String(obj), "&", "&");
content = replace(content, ">", ">");
content = replace(content, "<","<");
content = replace(content, """, "\"");
content = replace(content, "'", "'");
//trace(content);
var format:TextFormat = mpadText.getTextFormat();
mpadText.html = true;
mpadText.htmlText = content;
mpadText.setTextFormat(format);
} else {
trace("Could not load XML");
}
}
Glen
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders