Cannot get sound to play, why?
The following code produces a sound, when an on screen graphical button is pressed.
Why does it work in 1.30 but not in 1.20?
How do I get it to work in 1.20?
Here is the code:
var sound1 = Titanium.Media.createSound({
url:'../sounds/jingle.mp3'
});
var b1 = Titanium.UI.createButton({
color:'#000',
backgroundImage:'../images/b1.png',
top:5,
left:15,
width:130,
height:50,
font:{fontSize:12,fontWeight:'bold',fontFamily:'Helvetica Neue'},
title:'Click for Sound!'
});
win.add(b1);
b1.addEventListener('touchstart', function()
{
sound1.play();
pb.max = sound1.duration;
});
If you can help me, many, many thanks I am having to go back to 1.20 to get my code to build and this is causing me a big headache.
1 Answer
-
Change the event to click. Maybe this will fix the problem.