Jump to content
Search Community

onComplete event is not called

alflasy test
Moderator Tag

Recommended Posts

Here is the simple script that I am working. Not sure why onComplete event is not called. Any idea please.

import com.greensock.TweenLite;
import com.greensock.TimelineLite;
import com.greensock.easing.*;

var timeline:TimelineLite = new TimelineLite();
var timeline2:TimelineLite = new TimelineLite();
var timeline3:TimelineLite = new TimelineLite();

timeline2.append( new TweenLite(mc, 1, {_x:400, ease:Circ.easeOut,onComplete:addMovie}) );
timeline3.append( new TweenLite(mc.mc2, 1, {_alpha:50, ease:Circ.easeOut}) );
timeline.appendMultiple([timeline2, timeline3]);
timeline.pause();
scrubber.onPress = function() {
startDrag(this,false,0,300,300,300);
this.onMouseMove = function(){
timeline.gotoAndStop(scrubber._x*timeline.totalDuration/300)
}
};
scrubber.onRelease = function() {
stopDrag();
};
// addMovie()
function addMovie(){
 trace( mc.mc2)
attachMovie("mc4","mc4",10)
timeline2.append( new TweenLite(mc4, 1, {_x:400, ease:Circ.easeOut}) );
}


 

Thank you

Link to comment
Share on other sites

It looks like your onComplete might not be getting called because the tween never reaches its completion point - you put it into a nested timeline and the parent timeline is paused. Does your gotoAndStop() call push it to (or past) the end point?

 

If you're still running into trouble, please post a sample FLA that demonstrates the issue (please make it as simple as possible to isolate the problem). Don't forget to zip your file(s) before you post.

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