Hi guys,
I’m trying to change an image when it is dragged, but so far doesn’t seem to be working.
Here’s what I have
local image1 = display.newImage("image1.png")
image1.x = 50; image.y = 50
local function startDrag( event )
local t = event.target
t.x = event.x
t.y = event.y
replaceImage()
end
local function replaceImage()
if (event.target == image1) then
image1 = "image2.png"
end
end
image1:addEventListener( "touch", startDrag )
Anyone know what I’m doing wrong? I’ve tried all sorts of other options too but none seem to work. [import]uid: 40538 topic_id: 8731 reply_id: 308731[/import]

[import]uid: 12455 topic_id: 8731 reply_id: 32366[/import]