I was wondering if I could use several events on one display table, like several custom events, touch events and enterFrame events.
If so, what are the restrictions? can I trigger an event inside an event response function?
I was wondering if I could use several events on one display table, like several custom events, touch events and enterFrame events.
If so, what are the restrictions? can I trigger an event inside an event response function?
As far as I know you can use an event inside event response function but it depends on what do you want to achieve for example an enterFrame
can be trigger by a touch eventListener
but some eventListener
will need to complete it's function in order to trigger another eventListener
like targeted events or collision event.
I haven't personally used all the events and listener so a may not cover all the restriction of it but you can refer to this link to know event and listener.
I achieved that in one of my projects. I used collision and touch event together and it worked great. So I assume that you can use events togetger. And also because of event structure its possible to triger one or more events together. ( Touching and colliding in the same time ). But I dont recommend to use enterFrame event with other events, because of performance issues
I needed to send a simulated touch event when a user pressed the menu button on an android device, and I was able to use dispatchEvent within the touch event handler http://docs.coronalabs.com/api/type/EventListener/dispatchEvent.html