# Can anyone help me with some actionscript for autoscroll?!

**URL:** <https://forum.kirupa.com/t/can-anyone-help-me-with-some-actionscript-for-autoscroll/204272>\
**Category:** flash\
**Created:** [October 18, 2006, 2:39pm UTC](https://forum.kirupa.com/t/can-anyone-help-me-with-some-actionscript-for-autoscroll/204272 "2006-10-18T14:39:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patz](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@Patz](https://forum.kirupa.com/u/Patz)\
**Post date:** [October 18, 2006, 2:39pm UTC](https://forum.kirupa.com/t/can-anyone-help-me-with-some-actionscript-for-autoscroll/204272/1 "2006-10-18T14:39:17Z")

</div>

Hello,

I’m trying to dynamically load a txt file (formatted with html) as a news page, and get it to smoothly autoscroll vertically… Here - [http://www.nocco.co.uk/test/text.html](http://www.nocco.co.uk/test/text.html)

After numerous searches I came across this actionscript which was originally set for horizontal scrolling -

```auto

[LEFT]System.useCodepage = true; [/LEFT]
 
[LEFT]function newsticker(content, posX, posY, depth, tempo) { 
   this.loadVariables(content); 
   this.onData = function() {         
       createTextField("text", depth, posX, posY, 10, 20); 
       text.html = true;         
       text.htmlText = news; 
       text.selectable = false; 
       text.autoSize = "left"; [/LEFT]
 
[LEFT] createTextField("text2", depth+1, posX, posY, 10, 20); 
       text2.html = true;         
       text2.htmlText = news; 
       text2.selectable = false; 
       text2.autoSize = "left";         
       text2._x = text._width; [/LEFT]
 
[LEFT] function tick() { 
           text._y -= tempo; 
           text2._y -= tempo; 
           if (text2._y <= posX) { 
               text._y = posX; 
               text2._y = text._width + posY; 
           } 
           updateAfterEvent(); 
       } 
       setInterval(tick, 30); 
   }; 
} [/LEFT]
 
[LEFT]newsticker("events_artists.txt", 0, 7, 1, 1);[/LEFT]

```

In the function bit i changed all the Xs to Yx which makes it scroll vertically… as it is there are two text fields, i want just one long scroll rather than having it display double like that… So I tried removing the second createTextField bit but then the scrolling completely stops.

Can anyone here help me to understand the actionscript a little so that i can tweak it to my liking?!

Thanks in advance ![](http://flashmove.com/forum/images/smilies/wink.gif)

Pat

The files are attached if it helps
