Jump to content
Search Community

noob problem on using complete()

chbH test
Moderator Tag

Recommended Posts

Can anyone help me? How do I skip a tween using a button function. I want to skip to the end of a tween with a button click.

 

Example if I click on button1 the mc will tween, but when I click button2 the mc will skip the tween. I'm totally new in using AS3 and I have no idea how to get this to work. Help me please.

Link to comment
Share on other sites

Hi and welcome to the forums.

 

complete() was dropped in v12 (latest version of the platform), but here is how you would do it in v11

var tween = TweenLite.to(mc, 5, {x:500});

skip_btn.addEventListener(MouseEvent.CLICK, skipHandler);

function skipHandler(e:MouseEvent):void {
  tween.complete();
}

v12

var tween = TweenLite.to(mc, 5, {x:500});

skip_btn.addEventListener(MouseEvent.CLICK, skipHandler);

function skipHandler(e:MouseEvent):void {
  tween.seek( tween.duration() );
}

if these solutions don't work, please provide more information on which version of TweenLite you are using.

 

add the following code to get the version number

trace(TweenLite.version)

Also having a basic file to work with would be most helpful.

 

Let us know if you need more help.

Link to comment
Share on other sites

I'm very sorry. I think I made a stupid mistake. It's not for tweenlite, it's for TimelineMax. I think the code I'm using is from your tutorial on making a 3d card flip effect. 

 

This code:

 

var tl:TimelineMax = new TimelineMax({paused:true});
 
tl.append(TweenMax.to(flipper.front, flipSpeed, {rotationY:90, visible:false, ease:Linear.easeNone}))
tl.append(TweenMax.to(flipper.back, 0, {alpha:1, immediateRender:false}))
tl.append(TweenMax.to(flipper.back, flipSpeed, {rotationY:0, ease:Linear.easeNone}))
 
and THANK YOU so much for responding and for the code^-^
I had to say that in all caps.. = )
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...