Listener jump to another Character ?

hi ,i have a problem with a listener based on a table with Characters. The listener jump to another Character but i dont’ understand why ?

below the explanation and thanks if you could help me to solve this :slight_smile:

the table for the Characters :

local Character = {} local myIdx = 0 for a= 1,10 do myIdx = myIdx + 1 Character[a] = display.newSprite( myGroupCharacter, mySheet, sequenceData ) ... Character[a].myId = myIdx end

the listener pointed to my character

local function handleButtons(event)     target = event.target     for k=1,#Character do     if target.myId == (k) then     print("kill Character"..(target.myId))    print("kill Character"..(target.myId))     end     end end --LISTENER ----------------------------- for i = 1, #Character do Character[i]:addEventListener("tap", handleButtons) end

but the result of print  is

kill Character 1 kill Character 3

or normaly i would have the same id and have this result

kill Character 1 kill Character 1

resolved a stupid error i have another print somewhere :wacko: :unsure: :unsure:

resolved a stupid error i have another print somewhere :wacko: :unsure: :unsure: