Return to Snippet

Revision: 41122
at February 12, 2011 10:24 by vdubplate


Initial Code
var a:Object = new Object();
a.color = "#fd0e08";
a.fontWeight = ("bold");
a.fontSize = 20;

var aHover:Object = new Object();
aHover.fontSize = 20;
aHover.color = "#cccccc";

var style:StyleSheet = new StyleSheet();
style.setStyle("a", a);
style.setStyle("a:hover", aHover);

textfeed0.styleSheet = style;

var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();

xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("http://www.associatedcontent.com/rss/rss_process.shtml?content_type=rover_feature&content_type_id=721602"));

function LoadXML(e:Event):void {
xmlData=new XML(e.target.data);
Parserover_feature(xmlData);
}

function Parserover_feature(rover_feature:XML):void {
textfeed0.htmlText = "<a href=\"http://www.yahoo.com\">"+rover_feature.items.item.title[0]+"</a>";
}

Initial URL


Initial Description
So in this example I Pull an RSS feed and display it, then make the link a clickable HTML link styled with CSS.

Please feel free to punch holes in my code and help me make it leaner

Initial Title
Dynamic HTML/XML links in as3

Initial Tags


Initial Language
ActionScript 3