4 Replies Latest reply on Mar 26, 2010 3:02 PM by Jubahlingus

    Animations sticking on mouse over and mouse out

    Jubahlingus

      Hi,

       

      im in the process of making an interactive map. I have set up some code for the mouse over and mouse out for each of my movieclips of the 50 states. but if you notice if you move the mouse rather fast over the map the mouse over state seems to be sticking.


      http://megaswf.com/view/8d0c31b22617b9479384991b53c7f712.html

       

      here is what i have for the code for each of the states. california will be the example.

       

      //california
      california_mc.buttonMode = true;
      california_mc.addEventListener(MouseEvent.CLICK, ca_info);
      california_mc.addEventListener(MouseEvent.ROLL_OVER, colorIn);
      california_mc.addEventListener(MouseEvent.ROLL_OUT, colorOut);

       

      function colorIn(event:MouseEvent):void
      {
          event.target.gotoAndStop("in")
      }
      function colorOut(event:MouseEvent):void
      {
          event.target.gotoAndStop("out")
      }

       

      in each instance of the state there are 3 frames, the latter 2 labeled in and out. the in frame is just a shape of the state colored red. on the out frame label there is this code:

       

      import com.greensock.TweenLite;
      import com.greensock.easing.*;
      import com.greensock.plugins.*;
      import flash.geom.ColorTransform;
      TweenPlugin.activate([TintPlugin]);

       

      function colorChange():void
      {
          var color_transform:ColorTransform = cali_mc.transform.colorTransform;
          color_transform.color=0xCC3300;
          cali_mc.transform.colorTransform = color_transform;
      }


      colorChange();

       

      TweenLite.to(cali_mc, .3, {tint:0x999999});

       

      stop();

       


      is there something about this design that is letting it hang like that on the mouse over state? and how to get rid of it?