I don't believe it. It works like a charm. I tested the 3 of them with sending parameters also. They all works just fine. It's so look like OOP and I'm so happy to use it. Makes me feel I'm still on AS 3.0 Thank you Jack. you saved me tons of codes. For any one else who may have the same problem , to complete this forum, I'll write the callbacks with Parameters.
function function2() {
cacTimeline.eventCallback("onReverseComplete", callback_function);
cacTimeline.eventCallback("onReverseCompleteParams", [parameter_value]);
cacTimeline.reverse();
}
function2() {
TweenLite.delayedCall(cacTimeline.time(), callback_function, [parameter_value]);
cacTimeline.reverse();
}
function2() {
cacTimeline.tweenTo(0, {onComplete:callback_function,onCompleteParams:[parameter_value]});
cacTimeline.reverse();
}
And also for any one who has the same problem as me, you should not write the callback function with " () " , you just write the name of the function and the separately the parameters.
function callback_function(parameter) {
// Do some stuff
}
// Right way to use the method.
cacTimeline.tweenTo(0, {onComplete:callback_function,onCompleteParams:[parameter_value]});
// Wrong way to use the method.
// Fires the function immediately at the runtime
cacTimeline.tweenTo(0, {onComplete:callback_function(),onCompleteParams:[parameter_value]});