I have a play button and a series of memory buttons. When play is clicked, MP1 starts playing and I want to store MP1.Position at the moment a user clicks one of the memory buttons and continue playing. The following routine (a small part extracted), works well in B4a because of DoEvents. But I can't make it work very well in B4i. Can anyone suggest an equivalent for DoEvents? I was thinking of another timer at 1ms but how would I implement that to check if one of the memory buttons has been pressed? (I set the memory buttons to use the same click event, which also triggers timer2)
B4X:
'timer2 set at 100mS intervals
Sub timer2_Tick
Dim n As Int
.
.
.
If MP1.IsPlaying And col(n) <> Colors.Blue Then
If col(n) = Colors.Yellow Then
MP1.Pause
colbtn(n).Color = Colors.Green
'DoEvents from b4a was here
End If
End If
'DoEvents from b4a was here
.
. 'process other buttons
.
End Sub