Hi I’m very new to Corona and come from a design background. I’m using a program called Kwisher, which I’m extremely happy with. I’ve run into a problem.
I need to run an action only once as I want an animation to start when dragging an object, the problem is the action keeps sending the command to start as I drag the object and this keeps making the animation go back to the start position and therefore only looks like it’s playing when the drag has stopped.
This is my code, could someone tell me please the correct code to send the ‘play action’ just once
Thank you very much in advance.
Daren
– Actions (functions)
function act_playbrain(event)
path_brn2()
path_brn()
path_brn4()
path_brn6()
path_brn7()
path_brn8()
path_brn9()
path_brn10()
end
--End Actions (functions)
– Drag objects
MultiTouch.activate( hook, “move”, “single” , { xBounds = { 20, 1400}, yBounds = { 500, 600} } )
local function hookDrag (event )
local t = event.target
if event.phase == “moved” then
act_playbrain()
elseif event.phase == “ended” then
end
return true
end
hook:addEventListener( MultiTouch.MULTITOUCH_EVENT, hookDrag )