logo-dw

Go Back   Dreamweaver Club Forums > Graphic Design > Flash
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 11-25-2009, 07:14 PM   #1
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default RSS Feed

Hi guys, does anyone know of a tutorial on how to create a news rss feed widget in CS4 flash? Thanks
gigiloumill is offline   Reply With Quote
Old 11-26-2009, 07:12 PM   #2
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default

anyone????
gigiloumill is offline   Reply With Quote
Old 11-26-2009, 11:30 PM   #3
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

Quote:
anyone????
it seems not,
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 11-27-2009, 12:47 PM   #4
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default

O.K. How about this:

I've created the code for it in flash, however, when testing it's blank. Am I missing something? Thanks

var widget //Widget;

var rss;
var textfield:TextField;

addEventListener("widget-loaded",onWidgetLoaded);

function onWidgetResize( evt:Event ):void
{
textfield.width = widget.width -20;
textfield.height = widget.height -20;
}

function onDropDownLoaded( evt:Event):void
{
widget.chrome.addDropDownItem("digg","http://digg.com/rss/index.xml",loadFeed);
widget.chrome.addDropDownItem("flickr","http://api.flickr.com/services/feeds/photos_public.gne?format=rss2",loadFeed);
}


function onWidgetLoaded(evt:Event)
{
//your widget has started and is ready for display
widget.initWidget(300,350,0xffffff);
widget.addEventListener(widget.WIDGET_RESIZED,onWi dgetResize);
widget.addEventListener(widget.DROPDOWN_LOADED,onD ropDownLoaded);

//add the textfield to the form
textfield = new TextField();
textfield.x = 5;
textfield.y = 5;
textfield.width = 280;
textfield.height = 330;
textfield.multiline = true;
textfield.wordWrap = true;

addChild(textfield);

rss = widget.newRSS();
rss.addEventListener(Event.COMPLETE,onRSSLoaded);
rss.load(new URLRequest(widget.getSetting("feedurl","http://feeds.portfolio.com/portfolio/businessnews")));

addEventListener(TextEvent.LINK, linkHandler);
}

function loadFeed(feed)
{
widget.setSetting("feedurl",feed);

rss = widget.newRSS();
rss.addEventListener(Event.COMPLETE,onRSSLoaded);
rss.load(new URLRequest(feed));
}

function linkHandler(evt:TextEvent)
{
widget.reporting.trackURL(evt.text);
}

function onRSSLoaded(evt:Event)
{
var loader:URLLoader = URLLoader(evt.target);
var rssxml:XML = XML(loader.data);

var str = "";
for each (var item:XML in rssxml..item)
{
str+="<b><a href='event:" + item.link + "' target='_blank'><u>" +
item.title + "</u></a></b><br/>" +
item.description + "<br/><br/>";
}
textfield.htmlText = str;
}
gigiloumill is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:24 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com