/ Published in: ActionScript 3
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
Please feel free to punch holes in my code and help me make it leaner
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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>"; }