C
Cmi
Guest
I want to play sound in HTML 5 target.
Here is my code, am not sure what is wrong with it. It works in windows just not in HTML 5.
Create Event:
execute code:
// Music on = mon
global.mon = 1;
// set the image speed to 0
image_speed = 0;
// Play the sound
audio_play_sound(snd_lvl_1,0,1)
Mouse Event for Left Pressed:
execute code:
// If on and clicked, pause
if global.mon = 1 {
audio_pause_sound(snd_lvl_1)
image_index = 1;
}
// If off and clicked, start playing
if global.mon = 0 {
audio_resume_sound(snd_lvl_1)
image_index = 0;
}
global.mon = !global.mon // toggle between on and off
Here is my code, am not sure what is wrong with it. It works in windows just not in HTML 5.
Create Event:
execute code:
// Music on = mon
global.mon = 1;
// set the image speed to 0
image_speed = 0;
// Play the sound
audio_play_sound(snd_lvl_1,0,1)
Mouse Event for Left Pressed:
execute code:
// If on and clicked, pause
if global.mon = 1 {
audio_pause_sound(snd_lvl_1)
image_index = 1;
}
// If off and clicked, start playing
if global.mon = 0 {
audio_resume_sound(snd_lvl_1)
image_index = 0;
}
global.mon = !global.mon // toggle between on and off
Last edited by a moderator: