Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
beno

TweenLite.to Doesn't Work Right

Recommended Posts

Hi;

This works:

 

timeline = new TimelineMax({onComplete:NextSlide()});

timeline.append(TweenLite.to(parent_container, 1, {x:130}) );

 

but this doesn't:

 

TweenLite.to(parent_container, 1, {x:130, onComplete:NextSlide()});

 

The latter doesn't slide to the new position, it just suddenly arrives. (The code in between repositions the container. Again, the first example works.) Why doesn't the second example work?

TIA,

Beno

Link to comment
Share on other sites

hi beno,

 

this could be a simple syntax error. when using onComplete:someFunction... never put the () parenthesis after the function name.

 

GOOD

TweenLite.to(parent_container, 1, {x:130, onComplete:NextSlide});

 

BAD

TweenLite.to(parent_container, 1, {x:130, onComplete:NextSlide()});

Link to comment
Share on other sites

Thank you. I have made that mistake before, and making that edit did clear up the problem. However, it returned when I took out the following code (which has nothing to do with GS, but I was told to take it out on the Adobe Flash list to get rid of a problem with "blinking" images):

 

i = 0;

while (i != parent_container.numChildren)

{

parent_container.removeChildAt(i);

}

if (parent_container.parent)

{

removeChild(parent_container);

parent_container = null;

parent_container = new MovieClip();

addChild(parent_container);

}

 

Again, nothing to do with this forum, but I'd love to know where the glitch really is!!

Thanks,

Beno

Link to comment
Share on other sites

Beno, I don't really understand what you're asking here.

 

It would be best if you kept questions in the GreenSock forums focused on GreenSock tools. There are great general forums at actionscript.org and kirupa.com.

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