Image Buttons Going To Labels

David McFarlane mcfarla9 at msu.edu
Wed Jul 3 16:35:07 UTC 2013


Katie,

So, it acts as if the HitTest on either button returns the string 
value "Another".  My next debugging step would be to add a 
Debug.Print, c.SetAttrib, or MsgBox statement right after the HitTest 
in order to see exactly what value it returns before the If-ElseIf statement.

-----
David McFarlane
E-Prime training 
online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter:  @EPrimeMaster (https://twitter.com/EPrimeMaster)

/----
Stock reminder:  1) I do not work for PST.  2) PST's trained staff 
take any and all questions at 
http://support.pstnet.com/e%2Dprime/support/login.asp , and they 
strive to respond to all requests in 24-48 hours, so make full use of 
it.  3) In addition, PST offers several instructional videos on their 
YouTube channel (http://www.youtube.com/user/PSTNET ).  4) If you do 
get an answer from PST staff, please extend the courtesy of posting 
their reply back here for the sake of others.
\----


At 6/26/2013 04:02 PM Wednesday, Katarina Morowsky wrote:
>I am trying to create a slide with two buttons (made from images). 
>One button (named Another) will take you back to the practice list 
>and the other button (named Proceed) will proceed to the 
>instructions for the first task.  If you click anywhere outside the 
>buttons you will stay on the screen.
>
>I have created a code that directs where you go via labels.  My code 
>to stay on the screen works fine. The code that recognizes the 
>images as buttons also works.  The problem I am running into is the 
>locations that the buttons go to...
>
>With the current code when I click on both the "Another" and 
>"Proceed" buttons I end up at Label 3.  I tried switching what image 
>corresponds to each label (i.e. Another going to Label11 and Proceed 
>going to Label3) to see if the problem was in the Elseif statement, 
>but then both buttons ended up at Label11.
>
>Would anyone know how to have each button go to their intended location?
>
>
>Thank you,
>
>Katie
>
>_________________________________________________________________________
>
>'Designate "theState" as the Default Slide State, which is the
>'current ActiveState on the Slide object "morepractice".
>Dim theState As SlideState
>Set theState = morepractice.States("Default")
>Dim theSlideImage As SlideImage
>Dim strHit As String
>Dim theMouseResponseData As MouseResponseData
>
>'Was there a response?
>  If morepractice.InputMasks.Responses.Count > 0 Then
>   debug.print "Line 16"
>   'Get the mouse response.
>   Set theMouseResponseData = 
> CMouseResponseData(morepractice.InputMasks.Responses(1))
>   'Determine string name of SlideImage object at
>   'mouse click coordinates. Assign that value to strHit
>   strHit = theState.HitTest(theMouseResponseData.CursorX, 
> theMouseResponseData.CursorY)
>
>   'If you hit image for Another Practice Trial you will go to a 
> label before the practice list'
>   If strHit = "Another" Then
>    Sleep 350
>    GoTo Label3
>
>   'If you hit the image for Proceed to Task1 you will go to a label 
> before the intro slide for Task1'
>   ElseIf strHit = "Proceed" Then
>    Sleep 350
>    GoTo Label11
>
>   'If you hit anywhere else on the screen you will stay at that screen'
>   Else
>    GoTo Label4
>
>   End If
>  End If
>
>
>Set theMouseResponseData = Nothing
>Mouse.ShowCursor False

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/51d452c6.619a320a.422d.0b8eSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/groups/opt_out.



More information about the Eprime mailing list