FORUMS: list search recent posts

Add Prefix & Suffix to an array in sourceText

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Roland R. Kahlenberg
Add Prefix & Suffix to an array in sourceText
on Nov 25, 2013 at 9:07:37 pm

I've got a comp where a user enters the following data into a Text Layer - up to 20 different values are allowed.

The following is an example of how the text is formatted:
[ 211 , 251 , 230 , 231 , 155 , 140 , 70 , 214 , 190 , 262 , 210 ]

In another comp, using a single Text Layer with multiple Range Selectors, I have been able to parse each number and place each number in different places in the comp.

I would now like the user to be able to add a Prefix and Suffix. These can be typed in another Comp, in another Text Layer. I would like these to be automatically positioned at the front and back of each number.

Is this possible with a single Text Layer? And if it's possible,
what's the Expressions to achieve this?

TIA
RoRK

Intensive mocha & AE Training in Singapore and Other Dangerous Locations

Imagineer Systems (mocha) Certified Instructor
& Adobe After Effects CS6 ACE/ACI


Return to posts index

David Alex
Re: Add Prefix & Suffix to an array in sourceText
on Dec 2, 2013 at 3:36:52 pm

Hmm, I'm not sure how to solve this particular problem, but when I work with SourceText I find you can add strings.
Example, I can use a Slider to control a number representing a %, and I need that symbol at the end and the digits within square brackets. I can do it like this:

"["+Math.floor(effect("Slider Control")("Slider"))+"]%"

This method doesn't always work, as I found without the "Math.floor" rounding off the slider the expression doesn't work, but hopefully it should help with your case, as you can replace the slider reference with a reference to another text layer.

Hope it helped :)

Ideas to Creations | Motion Graphics, Visual Effects and Digital Art inspiration, tutorials and much more!
http://ideastocreations.blogspot.com


Return to posts index

Marcel Tineo
Re: Add Prefix & Suffix to an array in sourceText
on Sep 21, 2014 at 4:29:57 pm

Yeah!! that worked for me, I only had to delete the... [] and that was it. Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]