# Horizontal scrolling paper with XML?

**URL:** <https://forum.kirupa.com/t/horizontal-scrolling-paper-with-xml/225045>\
**Category:** flash\
**Created:** [May 8, 2007, 12:53pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-paper-with-xml/225045 "2007-05-08T12:53:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickycdk](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nickycdk/32/2533_2.png) [@nickycdk](https://forum.kirupa.com/u/nickycdk)\
**Post date:** [May 8, 2007, 12:53pm UTC](https://forum.kirupa.com/t/horizontal-scrolling-paper-with-xml/225045/1 "2007-05-08T12:53:05Z")

</div>

I’ve got this script, as it works now the text is loaded with XML.

It animates across screen, but not quite as i wish.  
If you download the script: [www.playart.dk/scroller.rar](http://www.playart.dk/scroller.rar) -\> you will see the text removes itself before another text from the XML is loaded in the flash…

The way i would like it to work where it all comes in at the same line, so you can see 2 captions(nodes, text) at a time in one line…

Hope you understand my question…

If you dont want to download the file, the script looks like this:

//\_root.p = 0;  
//-----------------------  
//Hent XML  
function loadXML(loaded) {  
//If XML is loaded  
if (loaded) {  
xmlNode = this.firstChild;  
description = [];  
\_root.total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
trace(i);  
description\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
trace(description\*);  
}  
upDatePic();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
[//xmlData.load](https://xmlData.load)("/site/utils/scroller.asp?doc\_id="+doc\_id);  
xmlData.load(“images.xml”);  
//Opdaterer billede (Updates the whole ting to a new caption)  
function upDatePic (){

filesize = description.getBytesTotal();  
loaded = description.getBytesLoaded();  
if (loaded == filesize) {  
DynamicTXT.desc\_txt = description[p];  
PlayTextMC(total); // Play this for every new caption }  
}  
function PlayTextMC(total){  
for (i=0; i\<total; i++) {  
//trace(total)  
\_root.DynamicTXT.\_x = 500;  
}  
}

* * *

At the textMC the AS is:

onClipEvent(enterFrame) {  
speed = -2.6;  
this.\_x += speed;  
}

* * *

I’ve also got a mc called timer which is placed at the AS layer.

In timerMC, there is some AS:

if (\_root.p\<(\_root.total-1)) {  
\_root.p = \_root.p += 1;  
//trace(\_root.p);  
} else {  
// If p is bigger than the total, set it to 0.  
\_root.p = 0;  
}  
\_root.upDatePic(total);
