Scrollbardrag path problem
Posted: Wed Sep 02, 2009 11:31 pm
Hello all,
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
The problem is that the image is not obtaining the proper information in that it does not include "item 6 of line trialnum of stimlist" but simply has the "-" and the thumbposition (eg. -50). However, when I directly input a 1 or 2 (image names) then the scrollbar and images update as desired.
How do I get the scrollbardrag to understand the stimlist variable that I have compiled? Strangely, when I used very similar code:
in the actual card, not the scrollbar, it does what it is supposed to. It is as if the scrollbar does not understand my stimlist container yet the actual card does.
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
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