Hi,
In a function I run this code:
for i = 1, #word do
letters[i] = word:sub(i,i)
– letterTable[letters[i]]
local letterImage = display.newImage("/images/letters/a.png", 30 * i, 380)
letterImage.param1 = “A”
letterImage:addEventListener(“tap”, touchLetter)
lettersGroup:insert(letterImage)
print(letterImage.param1)
end
I create an event listener for each image that is produces on screen then I want to able, from touchLetter() to find that letter (in this case always “A”) but I only get a nil value:
function touchLetter(event)
print(event)
print(event.letter)
print(event.other)
print(event.other.param1)
end
I want event.other.letter to print out “A” but I only get two nil values (
Runtime error
…ecito\documents\corona projects\languagepic\main.lua:98: attempt to index fie
ld ‘other’ (a nil value)
stack traceback:
[C]: ?
…ecito\documents\corona projects\languagepic\main.lua:98: in function
<…ecito\documents\corona projects\la
Can someone please help me understand why?
Thanks in advance,
Best regards,
Tomas