Jump to content
Search Community

Tween problem with double click

vdubplate test
Moderator Tag

Recommended Posts

Okay, sorry to blow up the forums but I have another problem I'm trying to work through.

So I have my bar/ad and when I click a mask opens up and another tab on top of the flash file comes down.

The problem I'm having is that when I double click on the tab for testing purposes parts of the tween

are turned on and off while other parts with a delay appear once the rest of the animation as already moved back to its previous

state.

 

So my question is, is there an option that will kill those other animations on the users first click?

 

Thanks for all your help

Link to comment
Share on other sites

Hmm, I'm not sure if that is going to solve this problem because I need the button to be inactive for a period of time or even better would be to stop the button from interfering with the animation until it has stopped.

 

I don't understand the problem here. or what it has to do with TimelineLite or the killTweensOf() method. You could do:

var playing:Boolean = false;
function onClick() {
   if (!playing) {
       //put your tween code here and use an onComplete to call onTweenComplete. for example:
       TweenMax.to(mc, 1, {autoAlpha:0, onComplete:onTweenComplete});
       playing = true;
   }
}
function onTweenComplete() {
   playing = false;
}

 

Or use a TimelineLite and call restart() in the onClick function. Lots of possibilities.

Link to comment
Share on other sites

This is an example of what I'm working with:

 

import com.greensock.*;
import com.greensock.easing.*;
var open:Boolean = false; //just tracks whether or not it's open.
button_state_btn.onRelease = function(){

   if (open) {
TweenMax.to(word_mark, 1, {_alpha:100, delay:2});
TweenMax.to(logo, 1, {_x:518, _alpha:100, delay: 2});
TweenMax.to(spots_container.spots3, 30, {_y:150, repeat:-1, ease:Linear.easeNone, _alpha:100})
TweenMax.to(spots_container.spots2, 30, {_y:150, repeat:-1, ease:Linear.easeNone, delay:9, _alpha:100})
TweenMax.to(spots_container.spots1, 28, {_y:150, repeat:-1, ease:Linear.easeNone, _alpha:100})
// Above tweens spots
TweenMax.to(mask_mc, 1, {_y:0, _yscale:1501}); 
TweenMax.to(close_bar_btn, 1, {_y:0, delay: 1}); 
//trace("clicked");        
open = false;
   } else {
   TweenMax.to(logo, 1, {_alpha:0, _x:563});
TweenMax.to(word_mark, 1, {_alpha:0});
TweenMax.to(mask_mc, 1, {_y:733, _yscale:0, delay: 1}); 
TweenMax.to(close_bar_btn, 1, {_y:-44, delay: 0});
//spots1._visible = false; spots2._visible = false; spots3._visible = false; 
TweenMax.to(spots1, 1, {_alpha:0});
TweenMax.to(spots2, 1, {_alpha:0});
TweenMax.to(spots3, 1, {_alpha:0});
//trace("clicked");
       open = true;
   }

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...