|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/19/2008 6:17:05 PM
Posts: 3,
Visits: 15
|
|
[font=Comic Sans MS]Hello,
I am trying to essentially use radio buttons as you would in Microsoft
visual studio and/or
other programs in E-Prime by inserting a script into an inline slide.
I was wondering if this
was even possible to use radio buttons in e-prime. And was wondering
if anyone actually had a script that would work to achieve this
desired design in the experiment. Thanks!
-Mary [/font]
|
|
|
|
|
Forum MVP
      
Group: Administrators
Last Login: Yesterday @ 9:26:59 AM
Posts: 576,
Visits: 1,254
|
|
| You would have to use images that looked like the radio buttons with a on/off version of each. A number of users have implemented paradigms like this via the Slide object using "HitTest", but primarily for check boxes which are easier to keep track of the state. Since radio buttons work as a group (only one can be selected) then some additional logic would need to be considered.
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Yesterday @ 4:03:21 PM
Posts: 34,
Visits: 153
|
|
Just make an array of booleans to represent your radio buttons, and a function for making them all false.
When a button is pressed, call the function to clear them all, and set the one that was pressed as true.
Also, nice try with the comic sans.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/19/2008 6:17:05 PM
Posts: 3,
Visits: 15
|
|
Brandon.Cernicky, Thanks for the reply but I am not sure what you mean by "HitTest"
RedTurtle,
Do you have any examples of a script that would involve an array of booleans? I am not quit sure what you mean by that and neither does my supervisor. Thanks for the reply though!
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Yesterday @ 4:03:21 PM
Posts: 34,
Visits: 153
|
|
The following code makes an array of 4 booleans and sets the values. Then the contents of the array are ouput to the console.
Dim buttonArray(4) As Boolean
buttonArray(0) = false
buttonArray(1) = true
buttonArray(2) = false
buttonArray(3) = false
Dim i As Variant
For Each i In buttonArray
debug.print "i is " & i
Next i
|
|
|
|
|
Forum Guru
      
Group: Moderators
Last Login: 10/30/2008 3:23:17 PM
Posts: 127,
Visits: 924
|
|
(Cross-posted from the E-Prime Google Group)
Hi Mary,
While this is possible, it cannot be done directly through the E-Prime interface. What you would need to do is use two images - one would be an "empty" (not selected) radio button while the other would be a "full" (selected) radio button. You could then present these images as needed via a Slide object or the Canvas object. Script would be necessary in order to fill the radio button when it is clicked and/or empty the previously selected radio button should a new one be selected.
I would recommend taking a look at the LoadImageUponMouseClick.zip
sample experiment I have attached. This example is very close to what you have described, except that you would replace the "checkbox" images with radio button images. Note that this example allows the subject to select multiple items. Typically, radio buttons allow for only one response, so additional script would be necessary to restrict the subject in this manner.
Please let me know if you have any questions about the sample.
- Matt
PST Technical Consultant
http://pstnet.com
|
|
|
|