Jump to content
Search Community

onRollOver to only start anim not pause it when I move my mouse multiple times.

TheJoostie test
Moderator Tag

Recommended Posts

Hey,

 

I've had to create a banner that plays an animation when the user mouses over a particular part of the banner. I've got the first part working using:

 

onRollOver = function()
{
TweenLite.delayedCall(0,anim3);
TweenLite.to(strobing_corner, 0.75,{_alpha:0});
}

 

Now the problem comes in when I start the animation by mousing over the banner then moving the mouse away and then over it again which pauses the animation for a little bit before it continues again.

 

Is there a way for me to use the above code to only be effective once and stop it interupting the animation every time a user mouses over the banner until anim3 is done?

 

Thanks for your help

Link to comment
Share on other sites

Hello!

 

One idea is to make a boolean variable (false at the begging) and when the animation starts is going to be true. Like this...

 

 

 

var isStarted:Boolean=false;


onRollOver = function()
{
    if(!isStarted){
	 TweenLite.delayedCall(0,anim3);
        TweenLite.to(strobing_corner, 0.75,{_alpha:0});
			  isStarted=true;
   }
}

 

this is just one idea. I dont know if someone else have another proposal.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...