Disabling/enabling a function

Hello,

I am wondering how i can disable/stop a function to work. Let’s say i have a normal function like the code below, how can i disable it? So i can stop it from working then make it work again? Thanks for any help!

[code]

– EXAMPLE

– Normal function.

function addLine(event)
Runtime:addEventListener(“touch”, runTouch)
end

– Button

hi = display.newImage “blahblahblah.png”
hi.x = display.contentWidth/2
hi.y = display.contentHeight/2

function hiClear(event)

– How can i disable and enable the addLine function, by tapping this ?

end
hi:addEventListener(“touch”,hiClear) [import]uid: 23689 topic_id: 14670 reply_id: 314670[/import]

Hi,
for you and for anybody else that has been trying to understand how to enable/disable, switch ON/OFF a function, etc, I have a fresh new tutorial for you here.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 14670 reply_id: 54250[/import]

Thanks so much! The tutorials are great! [import]uid: 23689 topic_id: 14670 reply_id: 54328[/import]

I REALLY NEED TO THANK YOU! This really helped me, i really appreciate you making a whole tutorial for it. Also, keep up the tutorials there just more than great. I needed to thank you, because this really helped me!

THANKS AGAIN. [import]uid: 23689 topic_id: 14670 reply_id: 54331[/import]