Other Problem wih seekbar tutorial

howard bassen

Member
Licensed User
I compiled this code from an example on Youtube.
youtube.com/watch?v=N8qRT_QJT9I)

It flashes the screen for a second and then disappears.
It uses the audio library from B4A.
Can anyone see what is the problem with this code?

Also, how would I substitute a progressbar as an indicator of the seekbar value?

Thanks in advance.


---------------------------------------

Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region

#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region

Sub Process_Globals
End Sub

Sub Globals
Dim audio1 As Beeper
Dim SeekBar1 As SeekBar
Dim btnplay As Button
Private SeekBar1 As SeekBar
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("tutorial")
SeekBar1.Max = 2500
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub SeekBar1_ValueChanged (Value As Int, UserChanged As Boolean)
If UserChanged Then
audio1.Initialize(5000,Value)
End If
End Sub
Sub btnplay_Click
audio1.Initialize(5000,SeekBar1.Value)
audio1.Beep
End Sub
 

NJDude

Expert
Licensed User
To better assist you, it would be better you attached the project, on the IDE, click on FILE -> EXPORT AS ZIP.

Also, when you post code, please enclose it between [code]...[/code] tags.
 
Last edited:

NJDude

Expert
Licensed User
You are loading the wrong layout, it's supposed to be "seek1" not "tutorial", also, you are not declaring AUDIO1.
 
Top