dazzafact Posted June 21, 2023 Share Posted June 21, 2023 (edited) Can anyone explain to me why "onComplete" does not trigger? The only thing that works is "onFrameChange". The animation works without any problems. Actually I wanted to add a loop to the animation, but "loop=true" doesn't work either, so I wanted to find another solution, with onComplete in combination with "gotoAndPlay()". But that just doesn't work. onLoop() also does not work $sl[$allImgs]=new PIXI.AnimatedSprite(texture1); $sl[$allImgs].loop = false; $sl[$allImgs].onComplete = function() { console.log('animatedSprite complete123',$allImgs); $sl[$allImgs].gotoAndPlay(1); }; $sl[$allImgs].onLoop = function() { console.log('animatedSprite onLoop',$allImgs); }; $sl[$allImgs].onFrameChange = function() { console.log('animatedSprite onFrameChange'); }; PixjS V6.5 PS: ChatGpt PRO could not solve it either...☺ Edited June 21, 2023 by dazzafact Quote Link to comment Share on other sites More sharing options...
dazzafact Posted June 21, 2023 Author Share Posted June 21, 2023 (edited) ok, now i use $sl[allImgs].gotoAndStop(currentFrame); in GSAP. Works! Edited June 21, 2023 by dazzafact Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.