I have the following code vor a volume button (turn sound on/off):
[blockcode]
volBtn = widget.newButton{
labelColor = { default={255}, over={128} },
default=“sound-on.png”,
over=“sound-off.png”,
width=48, height=48,
onRelease = onVolBtnRelease – event listener function
}
[/blockcode]
The onVolBtnRelease function pauses and resumes the audio playback already:
[blockcode]
local function onVolBtnRelease()
if storyboard.isPlaying == true then
audio.pause()
storyboard.isPlaying = false
volBtn.default=“sound-off.png”
volBtn.over=“sound-on.png”
else
audio.resume()
storyboard.isPlaying = true
volBtn.default=“sound-on.png”
volBtn.over=“sound-off.png”
end
return true – indicates successful touch
end
[/blockcode]
The sound will stop and resume correctly, but the images won’t be changed. How can I solve this? Any idea? [import]uid: 106038 topic_id: 26180 reply_id: 326180[/import]