Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 19th, 2004, 03:23 PM
jessenco jessenco is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 3 jessenco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question XML Flash News Ticker

This an actual XML file that I would like to parse with a Flash ActionScript from a news provider.

The file has always the same following structure except, as shown below, for the <news id="[color=royal blue]000000[/color]"> nodes which "[color=royal blue]id[/color]" value attribute change upon news update.

---------------------------------

<?xml version="1.0" encoding="ISO-8859-1" ?>
- <crawl>
<datePublication>19/01/2004 12:13:33</datePublication>
<br />
<category>Techno News</category>
<dateMod year="2004" month="01" day="19" hour="12" minutes="13" />
<news id="[color=royal blue]141840">News sample bla bla bla</news> [/color]
<br />
<category>Headlines</category>
<dateMod year="2004" month="01" day="19" hour="12" minutes="04" />
<news id="[color=royal blue]147808">Other news sample bla bla bla</news> [/color]
<br />
<category>Top News</category>
<dateMod year="2004" month="01" day="19" hour="11" minutes="42" />
<news id="[color=royal blue]141830">Other news sample bla bla bla</news> [/color]
<br />
<category>Local News</category>
<dateMod year="2004" month="01" day="19" hour="11" minutes="41" />
<news id="[color=royal blue]187819">Other news sample bla bla bla</news> [/color]
<br />
<category>World News</category>
<dateMod year="2004" month="01" day="19" hour="11" minutes="38" />
<news id="[color=royal blue]147727">Other news sample bla bla bla</news> [/color]
<br />
<category>Top News</category>
<dateMod year="2004" month="01" day="19" hour="10" minutes="58" />
<news id="[color=royal blue]127801">Other news sample bla bla bla</news> [/color]
<br />
- </crawl>

----------------------------------------

Yet, I did not find any Flash ActionScript to make a news ticker out of this XML file.

The best I got is this: (But it only extract the last node succesfully, not all).


gDoc = null;

function GetNewData()
{
gDoc = new XML();
gDoc.onload = HandleXMLOnLoad;
gDoc.load ("newsfile.xml");
}


function HandleXMLOnLoad(success)
{
if (success)
{
debugXML = gDoc.toString();
var node = gDoc.firstChild.firstChild;


while (node != null)
{

if (node.nodeName=="datePublication")
wdatpub = node.firstChild.nodeValue;
if (node.nodeName=="category")
wCat = node.firstChild.nodeValue;
if (node.nodeName=="news")
wNews = node.firstChild.nodeValue;

node = node.nextSibling;
}

scriptTimer.gotoAndPlay(2);

}
}

//end
-------------------
Any Idea?
thks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > XML Flash News Ticker


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT