I am using the following code
local myObject = display.newImageRect( "wallpapers/1.png",320,480 )
myObject.x = \_W/5 -2
myObject.y = 130
myObject.xScale = .3
myObject.yScale = .3
local myObject2 = display.newImageRect( "wallpapers/2.png",320,480 )
myObject2.x = \_W/2
myObject2.y = 130
myObject2.xScale = .3
myObject2.yScale = .3
function click (event)
if(event.phase == "began") then
event.target:setFillColor(250,200,200)
end
end
myObject:addEventListener("touch", click)
myObject2:addEventListener("touch",click)
I am trying to see which object is using the function by event.target, but that isn’t working. My whole objective here is to “highlight” which wallpaper is being pressed!
Thanks! [import]uid: 24708 topic_id: 26557 reply_id: 326557[/import]