www.webOShelp.net

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

Home Forums

The www.webOShelp.net WebOS / Mojo Developers' Forum

WebOS Mojo Development => Mojo Newbies => Topic started by: Joffroi on July 01, 2009, 06:43:55 AM



Title: Create button to play sound (wav file)
Post by: Joffroi 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


Title: Re: Create button to play sound (wav file)
Post by: steveram 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.


Title: Re: Create button to play sound (wav file)
Post by: Joffroi 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  :-\. 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


Title: Re: Create button to play sound (wav file)
Post by: steveram 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 :( Wish I had an actual pre. I'm up in Canada and we still haven't received it.   >:(

Does anyone know if I get a Sprint Pre off of Ebay, would I be able to use it solely for development?


Title: Re: Create button to play sound (wav file)
Post by: Joffroi 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.