PDA

View Full Version : Dynamic Newsticker


dBS
05-04-2005, 04:50 PM
Hey guys,

I know a few different posts have been made about the news ticker stuff but ive spent the last 2 days going through it and not being able to solve my problem.

Im using the Dynamic Newsticker (MX) code found in the library. But i cant find any directions as to how to direct the code to the .txt file or how to format the text file so that the AS can pull the text.

I thought I found the code which points to the .txt file at the bottom of the page but that doesnt seem to work.

newsticker("http://mywebsite.net/ticker.txt", 0, 0, 1, 1)


System.useCodepage = true;

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";

createTextField("text2", depth+1, posX, posY, 10, 20);
text2.html = true;
text2.htmlText = news;
text2.selectable = false;
text2.autoSize = "left";
text2._x = newstext._width;

function tick() {
text._x -= tempo;
text2._x -= tempo;
if (text2._x <= posX) {
text._x = posX;
text2._x = text._width + posX;
}
updateAfterEvent();
}
setInterval(tick, 30);
};
}

newsticker("http://mywebsite.net/ticker.txt", 0, 0, 1, 1);

On my .txt file all it says is:

testing testing testing

do I need to some how name/format it? and if so what do i name it? ive tried a bunch of stuff but not haveing much luck. If somone could post a working example of this and include the .txt file that would be great.

Thanks.

tg
05-04-2005, 05:15 PM
looks like the content argument should be a url/path to the file holding your info.

just change :

"http://mywebsite.net/ticker.txt"

to the correct path to your content.

dBS
05-04-2005, 10:58 PM
I did that it didnt work. But like i said im not sure how to format the .txt document.