sound fx stop on button click

I have a bubble sound fx that infinity loops, on my title page. When you click on the button to enter the the main page, I am trying to get the sound fx to stop. I tryed a few different ways, but nothing seems to be working. Is there a way that when you click a button the sound fx stops? Thanks [import]uid: 14967 topic_id: 8572 reply_id: 308572[/import]

if event.phase == “release” then
audio.stop(yoursSound)
end

This is what you need ? [import]uid: 13156 topic_id: 8572 reply_id: 30783[/import]

the is my code, I am getting a runtime error saying that bubbleSound is a number value

[code]local bubbleSound = audio.loadSound(“sounds/bubbles.caf”)
bubbleSound = audio.play( bubbleSound, { channel=1, loops=-1, } )

local function audioStop (event)
if event.phase == “release” then
audio.stop(bubbleSound)
end
end

bubbleSound:addEventListener(“tap”, audioStop)

localGroup:insert(bubbleSound)[/code] [import]uid: 14967 topic_id: 8572 reply_id: 30797[/import]

try like this…

local bubbleSound = audio.loadSound(“sounds/bubbles.caf”)
audio.play( bubbleSound, { channel=1, loops=-1, } )

local function audioStop (event)
if event.phase == “release” then
audio.stop(bubbleSound)
end
end

OBJECTTOTAP:addEventListener(“tap”, audioStop)

localGroup:insert(bubbleSound) [import]uid: 13156 topic_id: 8572 reply_id: 30804[/import]

I get a new runtime error when inserting the bubbleSound to the localGroup, if I take that line out, I dont get an error but the sound continues to play when tapping the button [import]uid: 14967 topic_id: 8572 reply_id: 30807[/import]

got it fixed i used

[code]local bubbleSound = audio.loadSound(“sounds/bubbles.caf”)
audio.play( bubbleSound, { loops=-1 } )

local function audioStop()
audio.stop(bubbleSound);
end

scubaDiver:addEventListener(“tap”, audioStop) [/code] [import]uid: 14967 topic_id: 8572 reply_id: 30819[/import]