This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Sergey Li
Posted Feb 08 - Read on Facebook

Hi guys. Started using Framer Studio fairly recently. This morning I kept getting this "unexpected", I guess, syntax error. The code is quite simple and I looked over it for many times. I just couldn't notice what was wrong. I have attached a screenshot. Could anyone perhaps have a look at what I am doing wrong here?

9 Comments

Scott Criswell

Are you trying to have the animation play as soon as the screen loads or on a specific event? Like a tap event for example.

Scott Criswell

OK so the problem here is that you're calling a function in a way that expects an event. Try this example: http://share.framerjs.com/1m0dcf00hr4c/

Scott Criswell

So you would write it like this:

layerA.animate
- properties:
- - x: 200
- curve: "ease"

Scott Criswell

I've updated my example showing both animation methods. One shows animation on screen load and the other on click so you can see the differences in each approach.

Scott Criswell

Interesting, well here's your example working as you expect and written as you have it written. I'm not really sure but this link does what you want doesn't show the error.

http://share.framerjs.com/g7h015abr074/

Scott Criswell

The main benefit of writing up the animation function is that it's more readily reusable so your concept is a good one. Perhaps someone else can chime in here as well.

Sergey Li

Marc Krenn No, I didn't. When I ⌘ + A to copy it to a entire newly created empty document, the same error will appear.

Koen Bok

This looks like a whitespace error, if I had to guess. They are hard to spot with invisibles turned off. Since the last version I default to invisibles on, and gave them a bit more contrast.

Sergey Li

Koen Bok Thats what I thought.

Read the entire post on Facebook