How to pass additional arguments / parameters to an event listener

I am trying to use a listener for indicating when a sound has finished playing and in the main process after I invoke the playsound and pass the listener I go into a loop waiting for a variable to be set by the listener. The loop locks up the simulator because the variable never gets set by the listener.

Does anyone know how to do this? Basically, go into a holding pattern waiting for a listener to be fired?

Does Corona even support something like this with listeners? [import]uid: 27017 topic_id: 1600 reply_id: 32903[/import]

@cminshall

In an event driven engine like Corona you can’t use infinite loops. They run forever and never give the control back to Corona. That is why it hangs up.

Does anyone know how to do this? Basically, go into a holding pattern waiting for a listener to be fired?

Use a finite state machine setup for your enterFrame event. [import]uid: 5712 topic_id: 1600 reply_id: 32908[/import]

Are there any code samples around regarding your suggestion (finite state machine)? I am new to Corona and Lua so any points in the right direction would be appreciated!

Thanks,
Chris
[import]uid: 27017 topic_id: 1600 reply_id: 32996[/import]

One clarification for my actual requirement is that I need to play a series of sounds one right after the other and so I need to kick off the next sound when the previous sound finishes playing. [import]uid: 27017 topic_id: 1600 reply_id: 33003[/import]

hi,
how to convert the java script code to lua script code can any one tell me??? [import]uid: 82456 topic_id: 1600 reply_id: 54821[/import]