Skip to main content
Participant
January 5, 2011
Answered

News Crawler Flicker's

  • January 5, 2011
  • 1 reply
  • 1233 views

Hi Everyone,


I am trying to create a news crawler or ticker using Adobe Flash CS 5 (AS 3.0) but I notice that what I did is

not scrolling smoothly (the text actually flickers). Please see my source code below:


var endOfText= textCrawler._txt.x - (textCrawler._txt.textWidth + 50);

function scroller()
{
textCrawler._txt.width = textCrawler._txt.textWidth;
textCrawler._txt.multiline = false;
textCrawler._txt.autoSize = "right";

addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
scroller();  //calls the function

function onEnterFrame(event:Event):void {
textCrawler._txt.x -= 4;
if (textCrawler._txt.x < endOfText)
{
var resetPos:Number = (textCrawler._txt.x * -1) + 2;

textCrawler._txt.x = resetPos;

this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
scroller();
}

}


Thanks for your time and help.

This topic has been closed for replies.
Correct answer

Hmm that is strange because in my machine, it is not that smooth.

You can access the fla file using this link: http://www.4shared.com/file/bQpRQfOt/NewsCrawler.html.


downloaded fla...

works great , sliding smoothly.

Try and check with a different PC.

Change fps to 30 and change the line as:

mcNewsCrawler._txt.x -= 3;

1 reply

January 5, 2011

maybe you should embed the font.

Participant
January 5, 2011

Thanks for the reply Hakan.

Actually, I already embedded the font for the dynamic text and still the same

January 6, 2011

I have tried your code.

Text slides smoothly from right to left.

What do you mean with scrolling? down to up ?