Hi!
How can I :
- pass parameters to a function I call with a Runtime eventListener
- remove the Runtime eventListener (in that function on a condition)
- return parameters from the function.
I found at that
function myFunction(parameter)
return function()
print( "Listener called with paramater: " ..paramater)
end
end
paramater = "hello"
Runtime:addEventListener( "enterFrame", myFunction(parameter))
seems to work, but I have no clue how to remove the eventlistener and how to return parameters (or should I use global variables for that?) .
If I put Runtime:removeEventListener( "enterFrame", myFunction(parameter)) in the function I get a stack overflow error.
Runtime:removeEventListener( "enterFrame", myFunction) is just ignored.
thx! [import]uid: 148841 topic_id: 30939 reply_id: 330939[/import]
[import]uid: 52491 topic_id: 30939 reply_id: 123733[/import]