AE: String manipulation expression help
Hi guys,
New to ExtendScript/JavaScript and trying to "git gud" at expressions with a simple string manipulation expression.
The goal is for it to add a dot ( . ) every half second until there's 3, reset back to 0 and loop, without using keyframes.
Everything I've written has either returned errors or crashed AE. This is the closest I've gotten:
Expression on "Source Text" animator, Source Text is "Testing".
var dots = "";
var sw = thisComp.layer("Dot Switch").effect("Checkbox Control")("Checkbox");
var output = ""
var count = 0
var dur = thisComp.frameDuration
var t = 0
while( sw == 1 && t < time){
if(Number.isInteger(Math.floor(time*4)/2) == true){
dots += "."
count += 1
}
output = text.sourceText + dots
}
output
At one point it kept adding dots (as intended until I put in a limiter using 'count', but now it just crashes AE every time I run it. Any advice on what I'm doing wrong would be appreciated.
Thanks!
James.
