Hi, guyscould 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~
'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:
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.
another example: how can i remove a Click listener right after the button is Clicked? it does not work as i expected :(
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.
Also, there is layer.once <event>