Hey I wonder what happens if there's a TWEEN_COMPLETED handler scheduled to be called but before it gets
called another tween schedules the handler to be called with a different target..what happens to the original handler?
tween complete
(4 posts) (2 voices)-
Posted 2 years ago #
-
Hi Mike!
I'm not quite sure if I understand your question correctly. Please correct me if I'm wrong: you've got a tween and add an event listener to its "onComplete" event:
[tween1 addEventListener:@selector(onTweenCompleted:) atObject:self forType:SP_EVENT_TYPE_TWEEN_COMPLETED];And then you've got another tween that uses the same method, but another target:
[tween2 addEventListener:@selector(onTweenCompleted:) atObject:someOtherObject forType:SP_EVENT_TYPE_TWEEN_COMPLETED];And then tween2 finishes before tween1 does.
If this is what you mean: that should not be a problem. Internally, the event dispatcher (the tween) always saves the target (self, someOtherObject) together with the selector (onTweenCompleted:). They are not overriding or cancelling out each other.
If this is *not* what you meant, please just rephrase your question =)
Best regards,
DanielPosted 2 years ago # -
Hi Daniel!
Perfect..that's exactly what I was hoping would happen. I remember a tween library for flash I once used where you could
have the option of it forgetting about the first completion if a new one arrived first. So I wasn't sure if that was the way it worked here.
Great! Thanks again!
MikePosted 2 years ago # -
You're welcome! =)
Daniel
Posted 2 years ago #
Reply
You must log in to post.