I have done java and C programming in the past and I guess im just not familiar with interpreted languages like lua. Does Lua have something like a function declaration or prototypes? for instance
local myListener = function( event )
print( "Listener called with event of type " .. event.name )
end
Runtime:addEventListener( "touch", myListener )
this works but
Runtime:addEventListener( "touch", myListener )
local myListener = function( event )
print( "Listener called with event of type " .. event.name )
end
this does not work… although it doesn’t even give me an error
however I dont understand why " Runtime:addEventListener( “touch”, myListener )" must come AFTER the mylistener declaration. I can see in the future this can be very annoying when you have a function calling another but it must come after it in the actual lua file.
[import]uid: 55057 topic_id: 10681 reply_id: 310681[/import]
[import]uid: 52430 topic_id: 10681 reply_id: 38783[/import]