Jump to content
Search Community

Remove tween listener

diego_k test
Moderator Tag

Recommended Posts

in this simple example, kill() will stop a tween and prevent its onComplete callback from firing:

 

import com.greensock.*;
import flash.events.MouseEvent;


var myTween:TweenMax = TweenMax.to(mc, 5, {x:400, onComplete:done});

function done():void{
trace("done");
}

stage.addEventListener(MouseEvent.CLICK, kill)

function kill(e:MouseEvent):void{
//tween will stop and onComplete will not fire
myTween.kill();
}

 

if that doesn't work in your particular setup or if you need more fine tuning goto

 

http://www.greensock.com/as/docs/tween/ ... enMax.html

 

under methods, there are 6 that begin with the word kill.

 

one of those flavors of kill should be suitable for your purposes.

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