DoHitTest & Multiple SlideStates
    Dina 
    deedeevau at hotmail.com
       
    Mon Jul 14 18:38:26 UTC 2008
    
    
  
Hi E-primers,
I have the following problem with the inline and I hope someone can
help me:
I'm using the DoHitTest inline for my task and have defined the
response areas for
mouse input. The inline script works fine for other "normal" Slide-
objects with one state, but when I need to apply this script on Slide-
objects with multiple SlideStates, it goes awry.
In my task, my Slide-object "Motor" consists of 4 SlideStates ("UL"
"UR" "BL" "BR").
The problem I assume is in the first part of the script, and when I
look at the notepad file
to see how my responses are logged, only for the "UL" SlideState are
the responses logged
properly, but this does not happen for the other SlideStates "UR",
"BL" and "BR".
How can I modify the script in such a way that every response, no
matter what SlideState, will be logged appropriately?
Many thanks in advance,
Dina
DoHitTest-Inline script:
'Designate "theState" as the Default Slide State, which is the
'current, ActiveState on the Slide object "Stimulus"
Dim theState as SlideState
Set theState = Motor.States ("UL")
Dim strHit As String
Dim theMouseResponseData As MouseResponseData
'Was there a response?
If Motor.InputMasks.Responses.Count > 0 Then
'Get the mouse response
Set theMouseResponseData =
CMouseResponseData(Motor.InputMasks.Responses(1))
'Determine string name of SlideImage or SlideText
'object at mouse click coordinates.
'Assign that value to strHit
strHit = theState.HitTest(theMouseResponseData.CursorX,
theMouseResponseData.CursorY)
Select Case strHit
Case "UpperLeft"
	c.setattrib "CorrectAnswer", 1
Case "UpperRight"
	c.setattrib "CorrectAnswer", 2
Case "BottomLeft"
	c.setattrib "CorrectAnswer", 3
Case "BottomRight"
	c.setattrib "CorrectAnswer", 4
Case Else
	Goto Label3
End Select
'Compare string name where mouse click occurred to
'CorrectAnswer attribute on each trial, and score
'response
'NOTE: This comparison is case sensitive
	If strHit = c.GetAttrib ("CorrectAnswer") Then
		Motor.ACC = 1
	Else
		Motor.ACC = 0
	End If
End If
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime-unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---
    
    
More information about the Eprime
mailing list