Sorry for the newbie question. Just started with Corona a few days ago with limited programming experience and have already pieced together about half of my basic app.
Question: I have a screen with 2 buttons. Pressing each button should change screens. Is there a way to dynamically pass a variable in the addEventListener so that I can create one function to switch screens.
Not complete code below, just a general idea.
function pressChangeScreen (event)
director:changeScene (variable)
button1:addEventListener (“touch”, pressChangeScreen)
button2:addEventListener (“touch”, pressChangeScreen)
can these event listeners above be passed with a variable so each button can use the same function and go to a different screen.
thanks,
Jason [import]uid: 38758 topic_id: 6706 reply_id: 306706[/import]