Search found 4 matches

by SolidBlock
December 4th, 2022, 8:12 am
Forum: Script Tutorials
Topic: How to clear all keys of a property
Replies: 1
Views: 48505

How to clear all keys of a property

I know I can clear all keys of a property through the following code: for (var index = property.numKeys; index >=1; index--) { property.removeKey(index); } However , when I actually practise it, it consumes quite a long time, if the property has many keys. I don't know why it is so time-consuming. I...
by SolidBlock
December 4th, 2022, 1:59 am
Forum: Scripts Discussion
Topic: Cannot use "for-of" syntax and "forEach"
Replies: 1
Views: 6116

Cannot use "for-of" syntax and "forEach"

If I use `for-of` syntax in my script, the IDE identifies it correctly, but AE thinks it as a syntax error. Also, if I use `forEach` with lambda instead, AE says "> has no value". If I use `forEach` with anonymous function syntax, AE says "forEach is undefined". Also, I cannot us...
by SolidBlock
December 17th, 2021, 7:49 pm
Forum: Expression Discussion
Topic: Has anyone found a practical use for the $.global object?
Replies: 5
Views: 22435

Re: Has anyone found a practical use for the $.global object?

Evaluating the whole text layers is useful but quite strange. It's so silly of AE that it can only select limited variables in limited types by using the "expression control" effect in layers, and use a complicated code to access them inefficiently, and that it can not directly store globa...
by SolidBlock
December 16th, 2021, 6:15 am
Forum: Expression Discussion
Topic: How to apply different styles for different part of text in expression
Replies: 1
Views: 7490

How to apply different styles for different part of text in expression

By using expression, I know how to return a styled text, such as

Code: Select all

text.sourceText.style.setText('red').setFillColor(0xff0000)

But this method will apply same style for the whole text.

So, is there any ways to make different styles for different parts of a text?