Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions looping news ticker template creation

  • looping news ticker template creation

    Posted by Tobias Pfeiffer on October 20, 2010 at 7:32 am

    hi,
    i wanted to create a template for easy lower thirds news ticker creation. the template should be used by people not too familiar with after effects.
    the main problem that im stumbling upon is that i cant access the actual width (character count would be another valuable information) of the textlayer. the width of the text layer is changing on a weekly basis. without this information im not able to script an ever repeating ticker.
    any thoughts?
    thanks in advance,
    tobi

    Clayton Glenn replied 7 years, 10 months ago 5 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    October 20, 2010 at 5:37 pm

    You can get the character count of a text layer this way:

    thisComp.layer(“your text”).text.sourceText.length

    This thread discusses a hack, using sampleImage() that will give you the left or right edge of the text:

    https://forums.creativecow.net/readpost/227/15135

    Other than that, you’d have to use a script, which does have access to the actual extents of the text in a text layer.

    Dan

  • Kevin Camp

    October 20, 2010 at 7:36 pm

    if i under stand what you are trying to do — just have a line of text crawl across the bottom of the screen — then i don’t think you need to know the width.

    i think you could time to offset the position with an expression like this:

    offset = 2; // value in pixels per frame
    x = timeToFrames()*offset;
    value – [x,0]

    it will march across the screen for as long as the comp’s duration.

    and to make the source text string loop, you could use an expression like this:

    value + ” ” + value + ” ” + value;

    just keep adding + ” ” + value to make the string loop.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Chris Wright

    October 20, 2010 at 7:59 pm

    if you want a ticker to look like fox news where it wraps around, just add effect-distort-offset and add this to shift center, creating an infinite wrap-looping ticker.

    [time*1000,value[1]]

    https://technicolorsoftware.hostzi.com/

  • Tobias Pfeiffer

    October 21, 2010 at 9:57 pm

    thanks to everyone here.
    great suggestions.
    fixed it.

  • Clayton Glenn

    June 28, 2018 at 9:03 pm

    Did you try something like this?
    Seems like what you are trying to do….


    txt = thisComp.layer("text");

    w = txt.sourceRectAtTime(time,true).width;

    border = 10;

    s = (w + 2*border)*100/width;

    [s,value[1]]

    Saving the world one pixel at a time.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy