Why did you change original post to a new question?
Never never never … change your original post to ask a new question.
I simply won’t help you in the future if you do this again. The reasons for having a forum are:
-
Get help when you are stuck.
-
Keep a record of the conversation so others with similar questions can learn from the conversation in the future.
If you want to continue the discussion, add the new details at the end of the post, as long as it is closely related to the original question.
However, starting a whole new question at the end of a post bad practice. This is not an email thread.
Generally the best practice is ONE question per thread. i.e. Make new posts for new questions. This is most useful for future readers. If you’re extra awesome you can go back and link the threads to each other for future readers.
( Update: This may seem like a total freakout, but I put real effort into answering forums questions and It is a super-pet-peeve of mine to see that effort wasted. )
Your original text was:
Hello,
2 things :
First the “table listener” don’t work with a “tap” detection.
local t={}
t.tab=function() print(1) end
local cercle=display.newCircle(0,0,30)
cercle:addEventListener(“tap”,t)
– Don’t work !
Second, I so loved to have the inner code of the function “addEventListener”.
Is it possible to have an history link about this function ?
I think it’s firstly defined on stage.currentStage._class table and when we create a display object, an index table is automatically given to the metatable’s object with a key value look’s like "index.addEventListener=function(self,event)… "
Is it correct ? A clue pleased lol
Thanks.
Proxy
In your original question’s code snippet, you had this:
local t={} t.tab=function() print(1) end local cercle=display.newCircle(0,0,30) cercle:addEventListener("tap",t)
In this code, you are using the the table ‘t’ as a proxy to catch event. Or at least you were trying to. This is a valid practice, but is is advanced and most people do not need to do it in their apps or games.
Do you have the internal description code of the addEventListener function ?
No idea what this means. Please elaborate on ‘internal description’