Making image dissappear

Brandon Cernicky brandon_cernicky at yahoo.com
Wed Nov 8 17:40:25 UTC 2006


Petra,

Having the image disappear after a given time can be
accomplished by the following:

1)	Create a Procedure that has a Slide, InLine, Label
named Slide1, InLine1, Label1 respectively.
2)	On the Slide, drop a SlideText and SlideImage where
you would like them to go, assign any other properties
3)	Place “Label1” in the Label field of duration/input
property page
4)	Setup the response devices to collect input, ensure
the “End Action” is set to jump.
5)	Set the duration and time limit of the total time
you want the text and response to be enabled
6)	Set the PreRelease value to be the total time of
duration minus the time you want the image to
disappear.  For example, if the total time is 5000 and
you want the image to disappear after 1 second, then
enter 4000 in the PreRelease field.
7)	Add the code below in the InLine.

	'Get the slide image
	Dim theSlideImage As SlideImage
	Set theSlideImage =
CSlideImage(Slide1.States(Slide1.ActiveState).Objects("Image1"))

	'If this assert fires, then confirm the slide image
named above exists
	Debug.Assert Not theSlideImage Is Nothing

	'Save the original width and height of the slide
image
	Dim strSaveWidth As String
	Dim strSaveHeight As String
	strSaveWidth = theSlideImage.Width
	strSaveHeight = theSlideImage.Height

	'Set the width and height of the slide to zero
	theSlideImage.Width = 0
	theSlideImage.Height = 0	

	'Redraw the slide, this effectively makes the image
invisible
	Slide1.Draw

	'Restore the image width and height
	theSlideImage.Width = strSaveWidth
	theSlideImage.Height = strSaveHeight

	'Loop until the remaining time of the slide is done	
	While Slide1.InputMasks.IsPending

		Sleep 5
		DoEvents
	Wend

This method uses PreRelease to enter the InLine object
prior to the object total duration occurring.
It then assigns an E-Basic variable to the slide
image, saves its width/height, sets the width/height
to zero and redraws the slide, which makes the image
disappear.
The remainder of the InLine loops while the time limit
of the response occurs.
If the max count is reached either during the object
running or in the prerelease time in the inline, the
proper jump occurs to end.
Note that setting the end action to “terminate” will
likely result in unexpected results where the “next”
object will get terminated and not the main stimulus
which is why the jump and label are in need.

-Brandon

>> hej,
 >> 
>> I have 20 slides which I present in a sequential
order. 
>> Each slide consists of one picture and one text
field. I
>> 'd like that the picture disappears after one
second but the 
>> text field should disappear only when the
participant has pressed a certain 
>> key on the keyboard. That's important because I'
>> d like to measure the reaction time. How can I do 
>> this?
 >> 
>> petra
>> 
>> 
>> 



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail.
http://new.mail.yahoo.com



More information about the Eprime mailing list