You can do it is just like PointC showed...
var tl = new TimelineMax({
onComplete: myCallback,
onCompleteParams: ["foo", "bar"],
callbackScope: myScope // what 'this' will refer to
});
function myCallback(a, {
console.log("A: %s B: %s", a, ; // A: foo B: bar
}
Another option is to create a bound function...
var tl = new TimelineMax({
onComplete: myCallback.bind(myScope, "foo", "bar")
});
function myCallback(a, {
console.log("A: %s B: %s", a, ; // A: foo B: bar
}
If you don't have a scope, just put null as the first argument.