Best Way to Clear an Action without calling EVENT_STOP?

New to Moai? Get started here with our best tips and tutorials.

Moderators: ezraanderson, DanielWolf

Best Way to Clear an Action without calling EVENT_STOP?

Postby naturally » Thu Feb 09, 2017 9:07 pm

Sometimes I'll add a listener to an action, like:

:setListener(MOAIAction.EVENT_STOP, function() dosomething() end )

Now when I call the root to :stop() all actions for clearing, it calls all those EVENT_STOP functions.
What is the best way to avoid this?

I was calling ":setListener(MOAIAction.EVENT_STOP, nil)" but I think that may be causing crashes on 1.7
Image - Don't Be Patchman - a sneak-and-grow adventure!
User avatar
naturally
 
Posts: 690
Joined: Thu Aug 29, 2013 8:05 pm
Location: Canada

Re: Best Way to Clear an Action without calling EVENT_STOP?

Postby naturally » Thu Feb 09, 2017 9:19 pm

Hmm I tried replacing the "nil"s with an empty function and 1.7 seems to like that instead :)
Image - Don't Be Patchman - a sneak-and-grow adventure!
User avatar
naturally
 
Posts: 690
Joined: Thu Aug 29, 2013 8:05 pm
Location: Canada


Return to Questions and Tips

Who is online

Users browsing this forum: No registered users and 0 guests

cron

x