Welcome to TalkGraphics.com
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
  1. #11
    Join Date
    Sep 2013
    Posts
    318

    Default Re: Hiding audio play buttons

    Hi Siran

    Your New version works exactly how I wanted, but I am having trouble replicating your result.

    To test the process I have created a new web page and added the code to the body.

    If I import one of your placeholders everything works OK and I can change the audio file - so I understand that bit of the process, but if I create a new object on the page, apply the two names and then add the audio file using ctrl+alt+shift+A nothing happens. I am obviously missing a step somewhere.

    Sorry for being so stupid!

  2. #12
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: Hiding audio play buttons

    Could you upload an example? Not sure what might go wrong.

  3. #13
    Join Date
    Sep 2013
    Posts
    318

    Default Re: Hiding audio play buttons

    Wow Siran - you are the fastest responder ever!

    File attached as requested.

    audio test.xar

  4. #14
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: Hiding audio play buttons

    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.

  5. #15
    Join Date
    Sep 2013
    Posts
    318

    Default Re: Hiding audio play buttons

    Hi Siran

    Its easy when you know how! (but I didn't! LOL)

    Thanks again - especially for your super speedy responses!

  6. #16
    Join Date
    May 2011
    Posts
    8

    Default Re: Hiding audio play buttons

    wonderimg how you can modify this code to work on mobile so that when a button is touched it plays audio

  7. #17
    Join Date
    May 2011
    Posts
    8

    Default Re: Hiding audio play buttons

    how can you modify this code to work in a mobile browser so that when an object is touched an audio file will play?

  8. #18
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: Hiding audio play buttons

    I don't have a mobile device to test on at the moment, but you could try to add a line
    Code:
    e.addEventListener('touchstart',function(){soundClips[f].play();},false);
    below (or above, that really doesn't matter) the line
    Code:
    e.addEventListener('mouseenter',function(){soundClips[f].play();},false);
    if you also would like the sound clip to stop when the user lifts the finger then also add
    Code:
    e.addEventListener('touchend',function(){soundClips[f].pause();soundClips[f].currentTime=0;},false);

  9. #19

    Default Re: Hiding audio play buttons

    Thanks Siran for your code. Now how can one bookmark this thread? And where does one learn to write code like this for Xara?

  10. #20
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,835

    Default Re: Hiding audio play buttons

    Quote Originally Posted by Mike in Canada View Post
    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

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •