webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Forums
The webOShelp.net WebOS / Mojo Developers' Forum
July 29, 2014, 12:39:54 AM *
Welcome, Guest. Please login (using the form in the left column) or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Create button to play sound (wav file)  (Read 4757 times)
Joffroi
webOS Newb
*
Offline Offline

Posts: 5


View Profile
« on: July 01, 2009, 06:43:55 AM »

Hey,

I'm looking for the script that enables me to create a button and when clicked, it plays a single instance of a sound.  Can anyone please help me with that?

Thanks
Logged
steveram
webOS Newb
*
Offline Offline

Posts: 11


View Profile
« Reply #1 on: July 01, 2009, 07:34:11 AM »

Depends how you want the file to be played. To you want it to be played embedded as a sound object in the current scene? Or do you want it to open up the music player? Either way, there are examples in the Services sample app of the SDK. Check it out.
Logged
Joffroi
webOS Newb
*
Offline Offline

Posts: 5


View Profile
« Reply #2 on: July 01, 2009, 11:20:59 AM »

Hey, thanks for the help with that. Unfortunately, I have am really good with html and css, but lack in the areas of javascript and mojo tools  Undecided. I tried looking through the services app and I just couldn't figure out how to do it. I want to pretty much just make an image or text an embedded link and when someone clicks, it just plays a sound in the same screen. 

I tried attaching the the correct javascript files but I'm just not sure if I'm pulling from the right ones.  I then tried to use the same div tags just to see if I could get a button but it didn't work out. Care to help out?

<div x-mojo-element="Button" id="PlayButton"></div>

Thanks
Logged
steveram
webOS Newb
*
Offline Offline

Posts: 11


View Profile
« Reply #3 on: July 01, 2009, 08:45:45 PM »

I haven't tried out playing audio in the current scene. What sucks is that I'm only working with the emulator which has sound disabled so I can't truly test out embedding sound in the scene or even the audio player Sad Wish I had an actual pre. I'm up in Canada and we still haven't received it.   Angry

Does anyone know if I get a Sprint Pre off of Ebay, would I be able to use it solely for development?
Logged
Joffroi
webOS Newb
*
Offline Offline

Posts: 5


View Profile
« Reply #4 on: July 02, 2009, 04:51:06 AM »

Yea, I don't see why it wouldn't work.  I work for Sprint and was able to just use some non-activated devices to test installing an app to see if it worked and such. 
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2009, Simple Machines LLC
SMF customization services by 2by2host.com
Valid XHTML 1.0! Valid CSS!