Hi, my app is base on 2 or more objets everyone has a mp3
local nota1 = audio.loadSound(“M1.mp3”)
local nota2 = audio.loadSound(“M2.mp3”)
–when you began or moved event.phase
local object = display.newImage ( “bStop.png” )
object.x = 200
object.y = 200
object.id = “ball object”
local function stopAllButOne( keep )
for i = 1, audio.totalChannels do
if( i ~= keep ) then
audio.stop(i)
end
end
end
function object:touch( event )
if event.phase == “began” or event.phase == “moved” then
if(event.target == object) then
stopAllButOne( 1 )
audio.play(nota1, {channel=1})
end
elseif event.phase == “ended” or event.phase == “cancelled” then
audio.stop(1)
end
end
object:addEventListener(“touch”, object)
Runtime:addEventListener(“touch”, object)
–and the same for the second object
Everything works fine when i move my finger and touch the objects turns on and off the audio as programed it but,
I need a multi touch activated it and when i do that (system.activate…)
and i touch both objects only one sound…What else do i need to do? any help?