HI. I have a project in which I am trying to have
people look at a cross (sprite(2)) on the screen and
then when they press a key, a spot (sprite(1)) is
presented in any one of five locations on the screen.
The locations are stored in a list and a repeat loop
goes through the list. Each time, I want the cross to
appear first and I want the viewer must press a key
before the spot appears. I want this whole thing to
happen 5 times�so they see 25 spots.
Here�s my code:
on numTimesThroughList
repeat with listLength = 1 to count(newDistanceList)
sprite(1).loc = getAt(newDistanceList,listLength)
keepTime
go to "fixation" --This is the cross; it's in
another frame.
end repeat
end
--This determines how long the spot will appear
on keepTime
startTimer
repeat while the timer < 20
go to the frame
end repeat
end
-- This counts the # times through entire list
on countTimesThroughList
gnumTrials = gnumTrials + 1
put "gnumTrials = " && gnumTrials
if gnumTrials > 5 then
go to "finish"
end if
end
What actually happens is that the first time, the
program lets me see the fixation cross and press any
key. Then the spot appears where I�d like it to, but
then things go wrong: the repeat loop goes through the
rest of the list (1) without going back to the
fixation point, (2) without allowing me to press any
key and (3) without displaying the spot in thosefour
other locations. The last handler (on
countTimesThroughList) repeats the whole thing 5
times. I couldn�t get this handler to work in a
repeat loop either�though I thought it was possible.
So, what am I doing wrong? Thanks.
Paul
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]