Hi
I’m extremely new to programming in lua. i’m making an application that mimics the same functions as an iBook library, and i was wondering how to have 2 events to 1 object. I have 2 functions, mbHold and mbPress. right now i can drag an image anywhere, but after i let go of the image mbPress will fire. What i want is if the user is holding the image, mbHold will fire and mbPress won’t even after its release. and if the user touches the image really quick, like tapping it with their finger, i want mbPress to fire and not mbHold. here is the code that i have for that:
[lua] local mbPress = function (event)
if event.phase == “ended” then
transition.to(mbCover, { time = 100, xScale = .80, yScale=.80, x=(w/2), y=(h/2)})
end
end
local mbHold = function (event)
mbCover.x = event.x
mbCover.y = event.y
end
mbCover:addEventListener(“touch”, mbHold)
mbCover:addEventListener(“touch”, mbPress)[/lua]
i dunno if this was answered in the forums before, I have been looking for the past 3 hours and I’ve been coding for the past 24 hours straight so my search skills may be jacked up
if anyone can help that would be awesome! thanks in advance [import]uid: 82086 topic_id: 13939 reply_id: 313939[/import]
[import]uid: 3826 topic_id: 13939 reply_id: 51256[/import]