6 Replies Latest reply on Oct 30, 2013 8:20 AM by Gygex

    How to trigger an event after symbol animation completes?

    AstroB333

      Hello,

       

      I have been trying to figure this out without success.

       

      On the stage I have a button and a hidden symbol. The symbol has an animation within itself.

      When I click the button, the symbol becomes visible and plays the animation. Its all good so far.

       

      This is what I am trying to accomplish:

      I want to be able to click the now visible symbol, the animation within itself plays in reverse and then it hides itself.

       

      How do I make it hide itself after the animation plays in reverse?

      ==================================================================================

      BUTTON CODE (This works for me):

      sym.$("AnimationOne").show();

      var AnimOne = sym.getSymbol("AnimationOne");

      AnimOne.play(0);

       

      SYMBOL CODE (This needs to hide after animation ends):

      var AnimOne = sym.getSymbol("AnimationOne");

      AnimOne.playReverse();

      sym.$("AnimationOne").hide(); // If I add this, it just hides itself without animating in reverse

      ==================================================================================

       

      Thank you in advance for any help/suggestions.