TweenMax instance
GreenSock Docs
TweenMax.delayedCall()
[static] Provides a simple way to call a function after a set amount of time (or frames).
Parameters
delay: Number
Delay in seconds (or frames if useFrames
is true
) before the function should be called
callback: Function
Function to call
params: Array
(default = null
) — An Array of parameters to pass the function (optional).
scope: *
(default = null
) — The scope in which the callback should be called (basically, what “this” refers to in the function). NOTE: this parameter only pertains to the JavaScript and AS2 versions; it is omitted in AS3.
useFrames: Boolean
(default = false
) — If the delay should be measured in frames instead of seconds, set
useFrames
to true
Returns : TweenMax

Details
Provides a simple way to call a function after a set amount of time (or frames). You can optionally pass any number of parameters to the function too.
Note: - Due to the way JavaScript doesn't maintain scope (what "this
" refers to, or the context) in function calls, it can be useful to define the scope specifically. Therefore, the 4th parameter allows you to define the scope
.
//calls myFunction after 1 second and passes 2 parameters:
TweenMax.delayedCall(1, myFunction, ["param1", "param2"]);
function myFunction(param1, param2) {
//do stuff
}