Here’s a sample code. If the sound plays at each isShake, why it’s not the same with transition.to (same way on simulator or device)?
Thanks for feedback.
–Test multiple isShake
local t1 = display.newText("?", 160, 160, native.systemFontBold, 70)
t1:setTextColor(255, 255, 0)
local sound = media.newEventSound( “maj.caf” )
local shake = {}
function shake:accelerometer(e)
if(e.isShake == true) then
transition.to(t1, {time=1000, rotation = 360}) --plays only one time at the first isShake (why?)
media.playEventSound(sound ) --plays at each isShake, ok
end
end
Runtime:addEventListener(“accelerometer”, shake)
-------------------------------------- [import]uid: 8970 topic_id: 4673 reply_id: 304673[/import]