Skip to main content
Phi.Def
Inspiring
March 10, 2022
Answered

Javascript vs AE Expressions reference

  • March 10, 2022
  • 1 reply
  • 1528 views

I'm writing code to be used both as javascript on a web page, and as an AE expression, but I'm finding errors occur (regardless of whether the project is set to "Legacy ExtendScript" or "JavaScript"). I've consulted this Adobe reference page to figure out what issues I'll encounter, but, even after clicking through the links, it's still not clear.

An example of an issue I've encountered is the "ease" expression. In AE, the only function available seems to be "ease()", whereas in JS, "ease()" doesn't seem to work, and instead there are an array of ease expressions like "easeInOutSine()". I don't see anything mentioned about these functions in the Adobe reference page.

I have two questions: 1) Is there a clearer reference to learn the differences between the two languages? and 2) Does anyone have any advice for writing code that will work in both environments?

Thanks!

This topic has been closed for replies.
Correct answer Dan Ebberts

Well, I'd say if it's listed in the expression language reference (like ease() and linear() are), it's not part of JavaScript. Other than that, I'm not sure what to suggest.

1 reply

Dan Ebberts
Community Expert
Community Expert
March 10, 2022

If you look at the expression language reference in the AE help, pretty much all of that consists of AE-specific extensions to JavaScript that won't work on a web page. It's possible, but not often useful, to construct an expression out of pure JavaScript, but the real power of expressions lies in those AE-specifc extensions. Core JavaScript is the glue that holds it all together, but not particulary useful on its own.

Phi.Def
Phi.DefAuthor
Inspiring
March 10, 2022

Thanks for the reply, but I'm not having any problems with extensions beyond what's available in JavaScript, I'm having problems with functions not being the same - such as the "ease" functions I mentioned. I'm hoping to find some reference for differences like these. Do you know of any?

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
March 10, 2022

Well, I'd say if it's listed in the expression language reference (like ease() and linear() are), it's not part of JavaScript. Other than that, I'm not sure what to suggest.