I am trying to get an audio sound to play on touch, but cannot get it working consistently, its working in stock and dolphin on android but its not working at all on ipad. I have tried on mousedown, onclick, touchstart, on touchstart. None of them are working
<canvas id="scratcher1" class="scratchMe" width="99px" height="89px" onmousedown="alert(down)" onclick="alert(click)" touchstart="alert(touch)" ontouchstart="alert(ontouch)"></canvas>
<canvas id="scratcher2" class="scratchMe" width="99px" height="89px" onmousedown="scratch.play()"></canvas>
This is what its at now, switched to alerts so I could try and work out which is working, as I said neither are.
Managed to find an answer through this forum.
http://www.dynamicdrive.com/forums/showthread.php?65787-How-to-combine-eventhandlers-for-mouse-and-touchscreen-(e-g-iPad)
Similar situation there with iPad.
(function(){
var
first = document.getElementById(‘scratcher1’),
second = document.getElementById(‘scratcher2’);
third = document.getElementById(‘scratcher3’);
fourth = document.getElementById(‘scratcher4’);
fifth = document.getElementById(‘scratcher5’);
sixth = document.getElementById(‘scratcher6’);
seventh = document.getElementById(‘scratcher7’);
eighth = document.getElementById(‘scratcher8’);
})();
Is what finally got it working.