GiG
June 3, 2015, 10:12am
#1
Hi,
I am using Actuate and I need to kill a delayed call to a specific function:
I started with the obvious approach
Actuate.delay(2).onComplete(function);
But I had no references to stop the delay, so I used a dirty trick
Actuate.tween(delayedCallDummy, 2, {}).onComplete(function);
where delayedCallDummy is a Sprite, and to stop/kill the delayed call I do
Actuate.stop(delayedCallDummy);
It is an ugly trick, and it partially works, because it forces the tween to complete, event if the parameter “complete” is set to false (a bug?).
Is there a better way of doing this?
Actuate.stop(delayedCallDummy, null, false, false)
will stop without calling callback.
event if the parameter “complete” is set to false (a bug?).
actually you should set sendEvent
to false.
1 Like
GiG
June 4, 2015, 7:41am
#3
Oh, ok, sendEvent is what I need, thank you @restorer !
Anyway, is there a better way to kill a delayed call without using a dummy?
Anyway, is there a better way to kill a delayed call without using a dummy?
No.
But tween target doesn’t need to be sprite, it can be any object, for example
var delayedCallDummy = new Dynamic();
Or you can try different tweening library, for example Delta.
Have you tried this ?
opened 09:13AM - 16 Jan 15 UTC
closed 10:17AM - 16 Jan 15 UTC
Hi,
I was trying to use the RoxGesture for one of my projects but it seems that it works with an older...
You are right, it seems that it is actually possible. Just as you I was confused by private stop() in GenericActuator
for @GiG :
var tween = Actuate.timer(2).onComplete(function);
...
Actuate.stop(tween);
GiG
June 4, 2015, 12:40pm
#7
Actuate.stop(tween, null, false, false);
?
GiG
June 4, 2015, 12:52pm
#9
It works.
About Delta, I should give it a try, like TweenX.