In alert event function, does have "event.target"?

[lua] --main.lua
local things = {}
local object = require(“object”);
thing[1] = object.new(“detail1”);
thing[2] = object.new(“detail2”);
thing[3] = object.new(“detail3”);

–object.lua
function new(detail)

local object = display.newImage(…);
object.detail = detail;

function onAlert( event)
if “clicked” == event.action then
local i = event.index
if 1 == i then
Save(object.detail); end
end
end

local function touchHandler(e)
if(e.phase == “ended”)then
alert = native.showAlert( “Set new detail”,“Are you sure?”,{“Yes”,“Cancel”},onAlert);
end
return true;
end
return object;
end[/lua]

As you see in the code, I do not understand why object.detail always refer to the latest data. There is no problem in touch function (it referred to data correctly). I also found that event.target in Alert function = nil. I read some post which said event.target does not deal with in native function…Do I need to separate scripts to solve the problem?

Ps.Sometimes , create new object in lua make me sick…(If someone can explain easily to me, I will be so glad). I created a new object but I feel like the object that I got was not really new.
[import]uid: 65906 topic_id: 17675 reply_id: 317675[/import]

Can you please post some plug and play code so someone might be able to run and test this, then provide assistance? :slight_smile:

Peach [import]uid: 52491 topic_id: 17675 reply_id: 67396[/import]