Here you go :
The oncomplete is optional
[code]
local function doShake(target, onCompleteDo)
local firstTran, secondTran, thirdTran
–Third Transition
thirdTran = function()
if target.shakeType == “Loop” then
transition.to(target, {transition = inOutExpo, time = 100, rotation = 0, onComplete = firstTran})
else
transition.to(target, {transition = inOutExpo, time = 100, rotation = 0, onComplete = onCompleteDo})
end
end
–Second Transition
secondTran = function()
transition.to(target, {transition = inOutExpo, time = 100, alpha = 1, rotation = -5, onComplete = thirdTran})
end
–First Transtion
firstTran = function()
transition.to(target, {transition = inOutExpo, time = 100, rotation = 5, onComplete = secondTran})
end
–Do the first transition
firstTran()
end [import]uid: 84637 topic_id: 21003 reply_id: 82966[/import]