Results 1 to 3 of 3
  1. Tibfib's Avatar
    Posts
    345 Posts
    Global Posts
    347 Global Posts
       #1  
    SO, I'm a pretty big noob at javascript but I have gotten far with my simple app. My question is, what is the code to play sounds? The sound is in the main directory of the app.

    I already have the image change "onmousedown" and have it return to normal "onmouseup". How would I make it play a sound "onmousedown" as well?
  2. atlanta's Avatar
    Posts
    324 Posts
    Global Posts
    337 Global Posts
    #2  
    This is straight from palm dev site
    Code:
    <html>
       <head>
          <script type="text/javascript">
          function myExampleFunction(){
    
             // Do some setup
             var audioElem = AudioTag.extendElement($('someDiv'));
    
             // Do standard HTML5 media actions with the object
             audioElem.src = "http://domain.dom/path/to/audio.mp3";
    
             .
             .
             .
          }
    
          // This function is called in response to some event that requires playback audio
          function myFooHandler(){
    
             // Get reference to the audio object by referring to HTML DIV
             var audio = $('someDiv');
    
             audio.play();
    
          }
          </script>
       </head>
    
       <body>
          <div id="someDiv" controls="false" autoplay="false"></div>
       </body>
    </html>
    Check this link out for more help
    Media Extensions – webOSdev – Palm
  3. Tibfib's Avatar
    Posts
    345 Posts
    Global Posts
    347 Global Posts
       #3  
    I have found palm's explanations don't make much sense.

    They are not friendly for beginning developers at all.

    Any other info out there?
    Last edited by Tibfib; 08/11/2009 at 02:47 PM.

Tags for this Thread

Posting Permissions