The example code below doesn’t work.
If I move the function above where the event listener is added, it does work. I thought pre-declaring functions at the start of a lua file meant they could be used anywhere in the code?
Thanks
Tom
[lua]-- Hide status bar
display.setStatusBar(display.HiddenStatusBar);
– Define functions
local moveLeft;
local left = display.newImage(“control.png”);
left:addEventListener(“touch”, moveLeft);
function moveLeft(event)
– do something
end[/lua] [import]uid: 55068 topic_id: 16416 reply_id: 316416[/import]
[import]uid: 3826 topic_id: 16416 reply_id: 61309[/import]