If an event completion listener calls a 2nd event completion listener how is the return execution?
-- EVENT COMPLETION LISTENER 2
function onTransitionComplete(event)
-- do stuff 3
end
-- EVENT COMPLETION LISTENER 1
function onEventSoundComplete(event)
-- do stuff 2
transition.to(aGrp, {time=500, x=0, onComplete=onTransitionComplete}) -- Transition a display group with a event completion listener
end
-- MAIN CODE
media.playEventSound("aSound.caf", onEventSoundComplete) -- Play a sound with a event completion listener
-- do stuff 1
I know that the code after media.playEventSound will execute immediately before aSound.caf has finished playing.
onEventSoundComplete is the event completion listener for aSound.caf and it sets up onTransitionComplete as an event completion listener for the aGrp transition.
Will onEventSoundComplete return (or finish executing) before onTransitionComplete completes? Or will it create within the Corona runtime a stack like happens in non-event-based code where if a 1st function calls a 2nd function, which call a 3rd function, and each inner function must return to be popped off the stack?
[import]uid: 295 topic_id: 1550 reply_id: 301550[/import]