I am suspecting the problem may be linked to " theMouseResponseData = Nothing" but I did not managed to solve it. Would anyone have a solution?
Mouse.ShowCursor True
Dim theSlideText As SlideText
Dim theState As SlideState
Dim cnvs As Canvas
Dim strHit As String
Dim posMouse As Point
Dim theMouseResponseData As MouseResponseData
Dim intRating As Integer
'Designate "theState" as the Default Slide State, which is the
'current ActiveState on the Slide object "Stimulus".
Set theState = Slide2.States("Default")
'Was there a response?
If Slide2.InputMasks.Responses.Count < 1 Then
Set theMouseResponseData = Nothing
c.SetAttrib "Results", intRating
End If
'Was there a response?
If Slide2.InputMasks.Responses.Count = 1 Then
Mouse.GetCursorPos posMouse
strHit = theState.HitTest(posMouse.x, posMouse.y)
'Get the mouse response.
Set theMouseResponseData = CMouseResponseData(Slide2.InputMasks.Responses(1))
Set theSlideText = CSlideText(Slide2.States.Item("Default").Objects(strHit))
intRating = CInt(Mid(strHit, 6, 1)) 'Return the final character in strHit (the digit) as subject's rating for this
'row.
'Log rating in the data file under the attribute "Rating"
c.SetAttrib "Results", intRating
Else
Set theMouseResponseData = Nothing
c.SetAttrib "Results", intRating
End If