4 Replies Latest reply on Feb 3, 2016 10:45 AM by resdesign

    Sprite Disappears After Reverse Play

    carlanim

      I have a simple sprite sheet of a door opening that I just need to play on mouse enter, and play in reverse on mouse leave.

      It all works fine except after it has played in reverse on mouse leave it disappears.

       

      Any idea how to fix?

       

      Many thanks,

       

      Carl

        • 1. Re: Sprite Disappears After Reverse Play
          resdesign Adobe Community Professional & MVP

          Hum,

          Do you have a blank area in your sprite? Do you have the beginning of the timeline with your sprite display off?

          • 2. Re: Sprite Disappears After Reverse Play
            carlanim Level 1

            No, it's always displayed. It shows fine when the page is loaded, plays the sprite on mouse enter and plays in reverse

            on mouse leave...then it disappears.

             

            I did find a work around by going to the sprites timeline and copying and pasting it in reverse, making it one long anim from open to close,

            and added labels to the start, middle and end.

            Then on mouse enter I just play("start") and on mouse leave play("middle"). Also added some stops at those points.

             

            Problem is if you mouse leave before the anim has reached the "middle" label it just freezes at the "middle" label.

            Rolling off and on again gets it back working but was hoping I could use a modified version of your script to test if it was running

            when the mouse leave occurs, and if so make it stop at the "start" label.

             

            Really appreciate your help!

             

            Thanks,

             

            Carl

            • 3. Re: Sprite Disappears After Reverse Play
              carlanim Level 1

              Experimenting with something like this:

               

              var Active = 0;

              sym.$("cab_door_top_sprite_symbol_1").bind('mouseleave',function(){

                if(Active ==0){

                sym.getSymbol('cab_door_top_sprite_symbol_1'),stop('start');

                Active = 1;

                }else{

                sym.getSymbol('cab_door_top_sprite_symbol_1'),play('middle');

                Active = 0;

                }

              });

               

              Not sure how to define the mouse leave.

               

              Thanks,

               

              Carl

              • 4. Re: Sprite Disappears After Reverse Play
                resdesign Adobe Community Professional & MVP

                PM me your files if you want.