CombinedCallback Class
A function that is used as a normal callback, but checks an object for a property in order to combine two callbacks into one. For example usage:
var voPlayer = new cloudkid.VOPlayer(); var callback = cloudkid.CombinedCallback.create(myFunc.bind(this), voPlayer, "playing", "_callback"); Animator.play(myClip, "myAnim", callback);
In this example, when Animator calls 'callback', if voPlayer["playing"] is false, 'myFunc' is called immediately. If voPlayer["playing"] is true, then voPlayer["_callback"] is set to 'myFunc' so that it will be called when voPlayer completes.
Constructor
CombinedCallback
-
call -
obj -
prop -
callProp
Parameters:
-
callFunctionThe callback to call when everything is complete.
-
objThe object to check as an additional completion dependency.
-
propStringThe property to check on obj. If obj[prop] is false, then it is considered complete.
-
callPropStringThe property to set on obj if obj[prop] is true when the CombinedCallback is called.
Item Index
Methods
- create static
Methods
create
-
call -
obj -
prop -
callProp
Creates a CombinedCallback for use.
Parameters:
-
callFunctionThe callback to call when everything is complete.
-
objThe object to check as an additional completion dependency.
-
propStringThe property to check on obj. If obj[prop] is false, then it is considered complete.
-
callPropStringThe property to set on obj if obj[prop] is true when the CombinedCallback is called.
