changing border color of a slide image after clicking on it

David McFarlane mcfarla9 at msu.edu
Mon Oct 14 18:31:42 UTC 2013


So, the line

     Image1.BorderColor = CColor("cyan")

tells E-Prime to use that border color the next time that it draws 
your SlideImage, but of course, that will not happen until you tell 
E-Prime to redraw it.  Try something like the following:

     Image1.BorderColor = CColor("cyan")
     Image1.Draw

and see the SlideImage and SlideImage.Draw topics in the E-Basic Help facility.

-----
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 https://support.pstnet.com , 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 10/9/2013 10:23 AM Wednesday, haslinger.hans11 at gmail.com wrote:
>At the moment I am programming a multiple choice test.
>In this test, there is a Stimulus (a slide image) and 4 possible 
>answers (slide images) given.
>The subjects have to choose one of the 4 answers by clicking on it.
>
>At the same time there is a sound-file presented, which is a little 
>story describing the stimulus-image.
>The subjects can answer until the complete story is presented.
>So far it was no huge problem for me.
>
>But now i want to highlight the given answer by changing the border 
>color of the slide image that has been clicked.
>
>By now I could only accomplish, that the border color changes in the 
>following slide state but not in the current one.
>I also didn't accomplish, that the border color changes back to the 
>original color in the next slide states.
>
>I hope you understand what my Problem is and could give me a hand.
>
>Best regards
>Hans
>
>
>
>Here is the inline code I produced so far (the green part is what 
>i've tried by myself to solve my problem. The rest of the code works 
>fine so far):
>
>
>  Dim theState as SlideState
>  Set theState = ExternalCausesSlide.States("Default")
>  Dim next_mX as Long, next_mY as Long
>   Dim strHit As String
>   Dim theMouseResponseData As MouseResponseData
>
>        'Was there a response?
>         If ExternalCausesSlide.InputMasks.Responses.Count > 0 Then
>                 'Get the mouse response
>                     Set theMouseResponseData = 
> CMouseResponseData(ExternalCausesSlide.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)
>
>                 'if strHit equals the two buttons, then strHit will 
> be logged, game will move onto next trial.
>
>                       If strHit = ("Image1") or strHit = ("Image2") 
> or strHit = ("Image3")or strHit = ("Image4")  Then
>                      c.SetAttrib "response", strHit
>                 'if click is off, then restart slide 2 so nothing 
> changes on the screen. no data will be logged in this case.
>                      Else
>                      Goto restart2
>                         End If
>
>'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("CorrectEmotion") Then
>ExternalCausesSlide.ACC = 1
>Else
>ExternalCausesSlide.ACC = 0
>End If
>
>
>If strHit = ("Image1") Then
>Dim Image1 As SlideImage
>Set Image1 = 
>CSlideImage(ExternalCausesSlide.States("Default").Objects("Image1"))
>Image1.BorderColor = CColor("cyan")
>End If
>       End if

-- 
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/525c3897.8570320a.7abf.7f24SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/groups/opt_out.



More information about the Eprime mailing list