change the X position incrementally w/ (right/left) buttons

What type of scripts do you need?

Moderator: byronnash

Post Reply
fapelbaum
Posts: 2
Joined: March 28th, 2015, 10:35 am

HI GUYS, first of all, thank you all you great dedicated people who helps us all with our questions!

So, I am trying something I never tried before, it might be very simple to do, but just couldn't find the way to do it on my own....

I created a comp that holds two pre-comps, one that sets the "day" (Monday through Sunday), the text within this pre-comp is right justified and then a "time" pre-comp that sets the time (12am to 12pm), the text within this pre-comp is right justified.

Everything works as it should, where I am having problems is that the word "today" and the word "tomorrow" have different lengths and when I replace one for the other, in the main comp it does not look centered. So, as you can see in the UI (picture attached), I created two arrows to move a null object left or right incrementally every time you click on the buttons for either side, the two pre-comps (Day and Time) are parented to this null object.. I dont know how to make the two arrow buttons work.... what script should I write to tell the position of the null object to change by 20 on the x position every time you click that button and so on..... Any ideas? Is this the best way to accomplish this? Is there a better way?
GUI-arrows.jpg
GUI-arrows.jpg (499.76 KiB) Viewed 8904 times
Thanks again! I am including a screen grab so hopefully you can understand better what I am talking about!

Take care you all!

Fabio
Post Reply