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

What is Framer? Join the Community
Return to index
Presten Wang
Posted Dec 10 - Read on Facebook

Hi, guys
could anyone tell me why the following codes cause endless printing "animation end"?
I was planning to execute another animation when the first animation ends. But it never stops listening. Thanks for your help~

5 Comments

Marc Krenn

'sq.off Events.AnimationEnd' is the problem here, delete line 8 and it will print "animation end" only once after ANY sq.animation ends.

###

If this 'Events.AnimationEnd' should really only fire ONCE, you'll have to change your setup quite a bit, see:

http://framerjs.com/docs/#layer.off

Presten Wang

thanks for reply. if i remember correctly i can do this in Flash AS3: remove a listener right after listening to it...and i tried your suggestion by deleting Line 8 but it still keep looping and printing.

Presten Wang

another example: how can i remove a Click listener right after the button is Clicked? it does not work as i expected :(

Marc Krenn

So if you really want to remove the listener - I wasn't sure about that in my first reply as it's not a supercommon pattern -, deleting line 8 wouldn't help you at all ;)

Please check out the link above to see how 'layer.off' works in framer.

Koen Bok

Also, there is layer.once <event>

Read the entire post on Facebook