Jump to content
Search Community

addCallback performs other than I expect

Eckstein1 test
Moderator Tag

Recommended Posts

Hi,

 

the following makes no sense but tries to explain the problem I found:

 

import com.greensock.*;

var TIMELINE:TimelineMax=new TimelineMax({repeat:-1});
TIMELINE.addCallback(debug, 0, ["0"]);
TIMELINE.addCallback(debug, 1, ["1"]);
TIMELINE.addCallback(debug, 2, ["2"]);
TIMELINE.addCallback(debug, 4, ["4"]);

function debug(s1:String) {
   trace(s1)
}

 

I expect the output to be:

0, 1, 2, 4, 0, 1, 2, ...

But it is

0, 1, 2, 4, 1, 2, ...

 

What am I doing wrong? Thanks for your help.

Uli

Link to comment
Share on other sites

Yeah, that's actually a very complex conundrum that was resolved with an architectural change in v12. I'd encourage you to hop on up to v12 and don't be scared away just because there's a "beta" label on it; it has been out in the wild for a while with MANY developers using it successfully. If I were doing a production site today, I'd honestly opt for v12 at this point. The bulk of the "beta"-ness of v12 is just with the JavaScript side of things because it's so new, but even that has proven to be pretty solid thus far. I'm not aware of any bugs (although that doesn't mean there aren't any). Let me know if you come across any odd behavior. I think it'll serve you well though. And rest assured that bugs are squashed very quickly around here once we become aware of them.

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