Controlling audio with icons (Beginner)

you can download the following sample how to stop and start audio when page switching.
https://www.kwiksher.com/tutorials/Multi/AudioControl.zip

sample BGM is koto_bgm.mp3.  It plays in all pages  when each page starts

Now you can make audio control with play/stop buttons

Create a button to play audio and set with layer hide for play icon and layer show action for stop icon.

Create a button to pause audio and set with layer hide for stop icon and layer show action for play icon.

code_isplaying is an external code with mycode.lua which should be executed after buttons and actions https://kwiksher.com/user-guide/add-external-code/

mycode.lua
—————————————
if audio.isChannelPlaying(1) then
layer.audioOff.alpha = 1
layer.audioOn.alpha = 0
else
layer.audioOff.alpha = 0
layer.audioOn.alpha = 1
end
—————————————

bandicam 2015-03-29 18-01-19-309 bandicam 2015-03-29 18-01-27-168

 

OLD Kwik2 tutorial.
https://youtube.com/watch?v=vvVXk8rThC8%5B