Mintoris Forum

Author Topic: touchevent  (Read 2395 times)

rendomizer

  • Full Member
  • ***
  • Posts: 87
touchevent
« on: Dec 02, 2015, 11:59 AM »
https://www.dropbox.com/s/9jhbabhaj6x4jxu/synth5.wav?dl=0
 synth5.wav
The programme does 22 randomize position in the audio file called "synth5.wav" but i want to stop the audio after 2000 ms per  position after touch on the screen. i don't know what's the problem with my little code for touchevent ?.after little touch it don'tstop the the audio after 2000ms why ???
Code: [Select]
playaudio 1,"synth5.wav",1
loopio:
 
ifms>(position*2000)+500 then
pauseaudio(1)
endif

touchevent action,index,x,y
if action=0 then
position=rnd(22)
 
setaudioposition 1,position*2000
endif
ms=getaudioposition(1)
goto loopio
« Last Edit: Dec 04, 2015, 09:33 PM by rendomizer »

rendomizer

  • Full Member
  • ***
  • Posts: 87
Re: touchevent
« Reply #1 on: Dec 03, 2015, 09:20 PM »
solved

i found the problem :P i need a delay in touchevent
Code: [Select]
playaudio 1,"synth5.wav",1
loopio:
 
ifms>(position*2000)+500 then
pauseaudio(1)
endif

touchevent action,index,x,y,500:rem the delay :P
if action=0 then
position=rnd(22)
 
setaudioposition 1,position*2000
endif
ms=getaudioposition(1)
goto loopio
« Last Edit: Dec 04, 2015, 08:40 PM by rendomizer »