for instance having the event listener only work if a statement is true, and if not then it will no longer respond to clicks or whatever.
By statement for instance I started out saying red = true, and after the clicking on the object (a button) it refers it to the function buttonHandler and one of the things this function does is sets the statement to red = false. This way the next time someone clicks on the button, red will now equal false which will keep the listener from referring to buttonHandler. Here is a segment of my work so far:
red = true
function buttonHandler (e)
if(e.phase == “began”) then
audio.play (knock);
physics.setGravity (0, -3);
physics.addBody (button, “static”, {bounce= 0.5})
red = false
end
–elseif (red = false) then
–audio.play (knock);
end
button: addEventListener (“touch”, buttonHandler)
[import]uid: 35535 topic_id: 6587 reply_id: 306587[/import]