Wow Siran - you are the fastest responder ever!
File attached as requested.
audio test.xar
Wow Siran - you are the fastest responder ever!
File attached as requested.
audio test.xar
Only a small change is required. Since your object is a simple rectangle Xara doesn't export it as an image. Just create a more complex button and retry.
Hi Siran
Its easy when you know how! (but I didn't! LOL)
Thanks again - especially for your super speedy responses!
wonderimg how you can modify this code to work on mobile so that when a button is touched it plays audio
how can you modify this code to work in a mobile browser so that when an object is touched an audio file will play?
I don't have a mobile device to test on at the moment, but you could try to add a line
below (or above, that really doesn't matter) the lineCode:e.addEventListener('touchstart',function(){soundClips[f].play();},false);
if you also would like the sound clip to stop when the user lifts the finger then also addCode:e.addEventListener('mouseenter',function(){soundClips[f].play();},false);
Code:e.addEventListener('touchend',function(){soundClips[f].pause();soundClips[f].currentTime=0;},false);
Thanks Siran for your code. Now how can one bookmark this thread? And where does one learn to write code like this for Xara?
Try Thread Tools > Email this Page... & Thread Tools > Subscribe to this Thread...
W3Schools > JavaScript: http://www.w3schools.com/js/default.asp and deconstruct siran's fine examples in TG.
Acorn
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
Thanks Acorn, you are another fantastic contributor btw.
Thanks Acorn, but please keep in mind that you have got me started.
Javascript is quite easy to learn because you can find everything about it on the net and you only need a text editor and a browser to experiment with it.
Bookmarks