Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Move an image left or right next to a text layer which is aligned to the left.

  • Move an image left or right next to a text layer which is aligned to the left.

    Posted by Chris Tandoh on March 30, 2018 at 1:54 am

    I have a text layer like so [Youtube.com/helphelphelp] and this text is aligned to the right meaning when text letters increases, it would the last letter will always remain at its current position. My problem is that I have an icon on another layer which is positioned at the left but when I increase the letters from [Youtube.com/helphelphelp] to [Youtube.com/helphelphelphelphelphelp], it overlaps onto the image icon. Is there a way to link this image to the text layer so as it expands to the left, the image icon will also move to the left keeping the same distance all the time.

    Chris Tandoh replied 8 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    March 30, 2018 at 8:02 am

    You should put this into the position of the icon
    textLayer = thisComp.layer("textLayer");//replace it with the name of your text layer
    textPosition = textLayer.transform.position;
    tempX = textPosition[0]+textLayer.sourceRectAtTime(time,true).left;
    [tempX ,value[1]]

    If you want to add some distance between the text layer and the icon, just move the anchor point of the icon to the left for the desired amount.

    Andrei
    My Envato portfolio.

  • Chris Tandoh

    March 30, 2018 at 9:35 am

    It works perfectly. A big thank you!!

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