Alex.A Posted September 5, 2014 Share Posted September 5, 2014 Hi! Is there a way to check if mc has already started tween or not? import com.greensock.*; import com.greensock.easing.*; addEventListener(Event.ENTER_FRAME, updater); function updater(e:Event) { var collision:Boolean = CDetector.checkCollision(); if (collision) { TweenLite.to(mc, 2, {alpha:0}); } else { TweenLite.to(mc, 2, {alpha:1}); } } Tween in enterFrame is not good for CPU I think Link to comment Share on other sites More sharing options...
Carl Posted September 5, 2014 Share Posted September 5, 2014 I think TweenMax.isTweening() is what you want. To test if mc is being tweened do if (TweenMax.isTweening(mc) ) { // if true do this } else { // if false do this } Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now