Hi...I have persistent bug that keeps on...bugging me!!!
In whatever level, since some of the subs are similar, if not equal, I coded the buttons to be invisible after button click, so they wouldn't be able to fire the sub again, forcing the player to choose another Button...
It happens that the button does NOT get invisible, and taping in the imageview, fires the button click event...
I have tried several aproaches to solve this, but no luck...
All buttons fire the same event...
Heres the sub..:
In whatever level, since some of the subs are similar, if not equal, I coded the buttons to be invisible after button click, so they wouldn't be able to fire the sub again, forcing the player to choose another Button...
It happens that the button does NOT get invisible, and taping in the imageview, fires the button click event...
I have tried several aproaches to solve this, but no luck...
All buttons fire the same event...
Heres the sub..:
B4X:
Sub Btn_Click
Sound.Play
Dim value, imgn As String
If Timer2.Enabled = True Then Return
If Counter = 0 Then
Butao1 = Sender
Anim0.Start(Butao1)
Butao1.Visible = False
Counter = 1
Else If Counter = 1 Then
Butao2 = Sender
Anim1.Start(Butao2)
Butao2.Visible = False
Dim Buttons() As Button
Buttons = Array As Button(Button1,Button2,Button3,Button4,Button5,Button6,Button7,Button8,Button9,Button10,Button11,Button12,Button13,Button14,Button15,Button16)
For i = 0 To Buttons.Length - 1
Buttons(i).Enabled = False
Next
If Butao1.Tag = Butao2.Tag Then
Value = Label2.Text + Score
Label2.Text = Value
Pair = Pair + 1
Dim Buttons() As Button
Buttons = Array As Button(Button1,Button2,Button3,Button4,Button5,Button6,Button7,Button8,Button9,Button10,Button11,Button12,Button13,Button14,Button15,Button16)
For i = 0 To Buttons.Length - 1
Buttons(i).Enabled = True
Next
Butao1.Enabled = False
Butao2.Enabled = False
Else
Timer2.Enabled = True
End If
Counter = 0
Ticks = Ticks + 1
End If
If Pair = MaxPair Then
Timer1.Enabled = False
TotalScore = NumberFormat(((((1/((Label4.Text * 60 )+ Label6.Text))*Label2.Text) + (1/Ticks))*100)+Score * MaxPair,0,0)
Timer3.Enabled = True
End If
End Sub
Last edited: