• Global community
• Language:
• Deutsch
• English
• EspaÃ±ol
• FranÃ§ais
• PortuguÃªs
• æ—¥æœ¬èªžã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£
Dedicated community for Japanese speakers
• í•œêµ­ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Exit
• How to code a scroll in an After Effects Script?

# How to code a scroll in an After Effects Script?

Explorer ,
Mar 22, 2019 Mar 22, 2019

Copied

I'm curious if it is possible, what I suppose, to create a scroll bar when the window is at a certain height.

I hope someone can help me out with this issue.

TOPICS
Scripting

Views

2.9K

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Community Expert , Mar 23, 2019 Mar 23, 2019

I still don't understand.

Are you writing a script for AE? Are you working with expressions? Are you trying to look at the timeline? Have you spent any time with the user guide?

Please post a screenshot of your problem. Just PrintScreen and Paste to the forum or drag a screenshot to the forum. That's all it takes.

7 Replies 7
Community Expert ,
Mar 22, 2019 Mar 22, 2019

Copied

Scroll? Left to right movement?

Try adding this expression to position:

t = time;

s = 300; // number of pixels you want to move per second

v = t * s

[value[0] + v, value[1]]

Here's how that works. In expression language, "time" returns the running time of the layer from the start of the composition. You just multiply time by however many pixels you want the layer to move in one second. If you are working in an HD comp then it is 1920 pixels wide. 1920 / 5 = 384 so if you set the speed to 300 it will take a little longer than 5 seconds for the layer (text) to scroll from left to right. Use whatever value you want for s.

Then there is just a simple multiplication function. Time in seconds multiplied by the speed gives a value we can add to the X value of the layer. This gives us the 'v' value.

The most confusing part of this expression for a newbie is the array at the bottom. I'll break that down. X and Y values for position are always in an array. value[0] is the current x value, value [1] is the current y value. If the layer was 3D there would also be a value for z and that would be described as value[2]. So the last line of the expression reads like this:

Take the current value of X and add to it the product of multiplying time by the speed in pixels per second you want for movement but just keep the current value for Y.

I hope that makes sense.

If you want a roll instead of a scroll just change the last line, the array so 'v' is subtracted from value[1]. If you are doing a scroll or a roll you always want to move the layer an even number of pixels so never use something like 250.5 for a speed value. You will have aliasing issues with fine lines and could easily introduce a stroboscopic visual effect called Judder, which makes scrolling or rolling text layers look pretty awful.

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Explorer ,
Mar 23, 2019 Mar 23, 2019

Copied

I actually meant to add a vertical scrollbar because the script is too high to fit the dimensions of my laptop screen and with that scrollbar I can keep the window at a defined height and everything that doesn't fit within that size is viewable by scrolling down.

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
Mar 23, 2019 Mar 23, 2019

Copied

I still don't understand.

Are you writing a script for AE? Are you working with expressions? Are you trying to look at the timeline? Have you spent any time with the user guide?

Please post a screenshot of your problem. Just PrintScreen and Paste to the forum or drag a screenshot to the forum. That's all it takes.

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
Mar 23, 2019 Mar 23, 2019

Copied

See this thread for a general description of how to add a scrollbar to the panel of a script:

Mathias MÃ¶hl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Jan 10, 2022 Jan 10, 2022

Copied

Hi,

I'm interested in the thread you mentioned: (add a scrollbar to the panel of a script),  but I don't see a link. Please can you repost.

Thanks!

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Engaged ,
Dec 06, 2022 Dec 06, 2022

Copied

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Engaged ,
Dec 06, 2022 Dec 06, 2022

Copied

LATEST