Hello again, seems like a need a lot of help today)
i’d really like to know, is there any way to stop Runtime listener from firing forever?
say i have this:
[lua]local function show_thing()
if tonumber(_G.somevar) == 1 then
thing.isVisible = true
print(thing.isVisible)
end
return true
end
Runtime:addEventListener(“enterFrame”, show_thing)[/lua]
it will work fine, but also it will make my terminal stack all those “true” and so on without stopping
i tried to return true, but it doesnt seem to work…
is there any way to stop this? i dont know if this is bad for device memory, so i concerned [import]uid: 16142 topic_id: 14874 reply_id: 314874[/import]
nothing,just set .isVisible = true or false upon changing variables
i just want to know if i want to do this kind of thing, maybe its bad for memory
also, if i make a function thats working on touch and then attach listener for it in a runtime functions - its fires many times, instead of one
is it normal? [import]uid: 16142 topic_id: 14874 reply_id: 54950[/import]
@darkconsoles you wan’t to make something visible when the variables value is 1 right ? why can’t you make it visible where you are setting the value of that variable ? or is the variable
_G.somevar coming from some other file ? in that case why you need to do it inside an enter frame ? you can just put