I am trying to get my scroll bar to 'on the fly' change an image field, I am using the following code on the scrollbar:
global stimlist, photopath, trialnum
Code: Select all
on scrollbardrag
put the thumbpos of scrollbar "slider2" into x
set the itemdelimiter to tab
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&x&".bmp"
end scrollbardrag
How do I get the scrollbardrag to understand the stimlist variable that I have compiled? Strangely, when I used very similar code:
Code: Select all
put 0 into x
repeat until x>50
set the filename of image "photo" to photopath&item 6 of line trialnum of stimlist&"-"&50+x&".bmp"
set the thumbposition of scrollbar "slider" to 50+x
wait 10 milliseconds
add 1 to x
end repeat
After deleting all the code from my "experiment" card it appears that the scrollbardrag then 'understands' what 'item 6 of line 1 of stimlist' means (not trialnum because this is specified in the experimental card). It appears as if there are some conflicts in my code... Any suggestions would be helpful, is it possible to use the "on scrollbardrag" message in my card code? Should I use 2 separate cards to avoid conflicts?
Any suggestions would be helpful
-Brandon