Android Question Play a sound while touching screen?

Cecil

New Member
Licensed User
Longtime User
Hello!
I've had an interesting idea and I need to implement this but don't know if it is possible to do. Basically what I need is make the program play a sound only when the screen is touched (for example, in a drawing manner), and when I release my finger the sound has to stop even if it doesn't have finished yet.

I was trying with something like this...

B4X:
Sub Panel2_Touch (Action As Int, X As Float, Y As Float)
    SignatureCapture.Panel_Touch(SD,X,Y,Action)
    MP.Play
End Sub

...but obviously it doesn't stops when I release :(

Help!
 
Top