# Newsticker xml problem

**URL:** <https://forum.kirupa.com/t/newsticker-xml-problem/223102>\
**Category:** Uncategorized\
**Created:** [April 19, 2007, 2:37pm UTC](https://forum.kirupa.com/t/newsticker-xml-problem/223102 "2007-04-19T14:37:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rk74](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rk74/32/3533_2.png) [@rk74](https://forum.kirupa.com/u/rk74)\
**Post date:** [April 19, 2007, 2:37pm UTC](https://forum.kirupa.com/t/newsticker-xml-problem/223102/1 "2007-04-19T14:37:00Z")

</div>

Hello,

I am very glad i found the great tutorial how to make a newsticker.  
I got i working so im very proud of myself, even if i was only pasting some code in flash :bucktooth: But unfortunately the xml doc where i have to get the info from is pretty complex.

[COLOR=blue]\<?xml version=“1.0” encoding=“utf-8” standalone=“yes”?\>  
\<rss version=“2.0”\>  
\<channel\>  
\<title\>blablabla\</title\>  
\<link\>blablabla\</link\>  
\<description\>blablabla.\</description\>  
\<ttl\>60\</ttl\>  
\<language\>blabla\</language\>  
\<generator\>blablae\</generator\>  
\<managingEditor\>[redactie@blabla.com](mailto:redactie@blabla.com)\</managingEditor\>  
\<webMaster\>[info@blabla.com](mailto:info@blabla.com)\</webMaster\>  
\<copyright\>Copyright 2000-2005, blabla\</copyright\>  
\<image\>  
\<url\>[http://blabla.com/img/lg\_home.gif](http://blabla.com/img/lg_home.gif)\</url\>  
\<title\>blabla.nl\</title\>  
\<link\>[http://www.blabla.com/](http://www.blabla.com/)\</link\>  
\<description\>blablabla\</description\>  
\<width\>110\</width\>  
\<height\>82\</height\>  
\</image\>

```
&lt;item&gt;
  &lt;title&gt;Meedenken over wijkknooppunt in Daalmeer&lt;/title&gt;
  &lt;link&gt;http://www.blabla.com/ga/naar.aspx?ct=a&amp;ci=95699&lt;/link&gt;
  &lt;pubDate&gt;Thu, 19 Apr 2007 00:00:00 GMT&lt;/pubDate&gt;
&lt;/item&gt;
&lt;item&gt;
  &lt;title&gt;Prins Willem-Alexander opent Windfarm Egmond&lt;/title&gt;
  &lt;link&gt;http://www.blabla.com/ga/naar.aspx?ct=a&amp;ci=95667&lt;/link&gt;
  &lt;pubDate&gt;Thu, 19 Apr 2007 00:00:00 GMT&lt;/pubDate&gt;
&lt;/item&gt;
&lt;item&gt;
  &lt;title&gt;Vrouw buiten bewustzijn geslagen&lt;/title&gt;
  &lt;link&gt;http://www.blabla.com/ga/naar.aspx?ct=a&amp;ci=95663&lt;/link&gt;
  &lt;pubDate&gt;Thu, 19 Apr 2007 00:00:00 GMT&lt;/pubDate&gt;
&lt;/item&gt;

```

\</channel\>  
\</rss\>[/COLOR]  
[COLOR=#0000ff][/COLOR]  
[COLOR=black]I can seem to get the right code in my actionscript so flash only reads out the item “things” (title and link). With other words, i can’t get past the link, description, ttl etc tags. When i delete al these tags, the script works fine, but that’s no option, these tags must be in de xml doc. Can anyone give me a clue? This is my code:[/COLOR]

[COLOR=blue]function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
caption = [];  
url = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
caption\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
url\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
}  
first\_item();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load("[/COLOR][[COLOR=blue]http://rk74.host.sk/blabla.xml[/COLOR]](http://rk74.host.sk/blabla.xml)[COLOR=blue]");  
//  
function first\_item() {  
delay = 3000;  
p = 0;  
display§;  
p++;  
}  
function timer() {  
myInterval = setInterval(ticker, delay);  
function ticker() {  
clearInterval(myInterval);  
if (p == total) {  
p = 0;  
}  
fadeout();  
}  
}  
function display(pos) {  
over = new TextFormat();  
over.underline = true;  
//  
out = new TextFormat();  
out.underline = false;  
//  
newsMC.newsText.\_alpha = 100;  
newsMC.newsText.text = caption[pos];  
newsMC.onRelease = function() {  
getURL(url[pos], “\_self”);  
};  
newsMC.onRollOver = function() {  
this.newsText.setTextFormat(over);  
};  
newsMC.onRollOut = function() {  
this.newsText.setTextFormat(out);  
};  
timer();  
}  
function fadeout() {  
this.onEnterFrame = function() {  
if (newsMC.newsText.\_alpha\>=0) {  
newsMC.newsText.\_alpha -= 10;  
} else {  
display§;  
p++;  
delete this.onEnterFrame;  
}  
};  
}[/COLOR]

I am a beginner in actionscript so don’t shoot me if this question turns out to be a stupid one :bucktooth: Thanks!
