Forum Discussion
How to use GSAP for animation in Storyline
Hello Math,
Is there a way to get the shape/png/object to return to its original scale when clicking outside the object again? Or maybe when the user clicks it again after it has been clicked and animation completes?
- MathNotermans-93 years agoCommunity Member
Hi Jake,
Offcourse.
For clicking outside an object you would need to add custom mouse-event handlers...as Storyline doesnot have these default. When you add a custom mouse-event handler...you can either loop all elements and check whether they are not at scale 100% (1) and reset them...or add a custom variable of the last clicked element and only scale that back to 1.
Clicking an object again to reset scale you can use a Boolean variable to check if it has been clicked...or even better usegsap.getPropery( clickedElement, "scale")
to check the size...and when that is not 1.... well scale it back to 1.gsap.to(clickedElement, {duration:0.5, scale:1 });
- JakeHolmberg-c23 years agoCommunity Member
Thanks Math,
I'm currently working through Javascript, html, and css course through udemy hopefully I'll be able to piece together a good string for the boolean once im done. In the mean time I can move forward with this training without any resets. I appreciate your help!!!