Hi,
I am doing a soundboard app and when pressing the buttons the sound doesn’t always play and yet other times it plays every time and I can’t work out why.
This is my code for setting up the button -
local btnAaaooww = widget.newButton( { onEvent = btnAaaooww\_Click, defaultFile = "charlieimages/aaaooww-button.png", overFile = "charlieimages/aaaooww-button-over.png", width = 360, height = 213, } ) btnAaaooww.anchorX = 0.5 btnAaaooww.x = screenLeft + (btnAaaooww.height / 2) btnAaaooww.y = screenBottom - (btnAaaooww.width / 2) btnAaaooww:rotate( -90 )
I am rotating everything as the app is landscape but the soundboard is portrait.
This is the event code
local function btnAaaooww\_Click( event ) if ( "ended" == event.phase ) then currentSound = audio.loadSound( audioPath .. "Aaaoow.aif" ) currentPlaying = audio.play(currentSound) end return true end
Any ideas?
Thanks
Dave