Page 1 of 3
Grouped Buttons & clickText - Solved
Posted: Mon Aug 26, 2013 11:38 pm
by DR White
I have five buttons in a group.
What is wrong with the code below that keeps the clickText from returning the text from the button label that I clicked?
if the clickText contains "Easy" then Correct
Does it work with labels?
How can I make this work?
Thanks So Much,
DR White
Re: Grouped Buttons & clickText
Posted: Mon Aug 26, 2013 11:48 pm
by Simon
Ohhh... a button has a word attached but you are clicking on the button not the word.
on mouseUp
if the label of me contains "Easy" then put "Correct"
end mousingAround
Now you could add a custom property to the button because I don't think you want to show the answer?
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:01 am
by DR White
Simon,
Your suggestion seemed logical, but it did not work.
Thanks,
David
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:05 am
by Simon
Ahh, you have to have a label assigned,
Check the property inspector for the button.
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:09 am
by Simon
Got some more for you.
set the name of the button to "Correct" and the Label of the button to "Answer 1" -- this isn't code
Then it wont show as Correct.
if the short name of me = "Correct" then put "Correct" -- this is code
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:12 am
by DR White
Simon,
I have the label set as "easy" of the one the buttons in the group, but the label of me comes back empty
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:15 am
by DR White
Simon,
When I use the short name, it just returns the group ID
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:23 am
by Simon
Works here???
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:35 am
by DR White
Simon,
When you say "label assigned" exactly how do you mean?
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:39 am
by Simon
See the above attached stack.
(was an edit)
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:52 am
by DR White
Simon,
Show me your code that returns the button label, when you click on it.
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:53 am
by Simon
ummm...
it's in the buttons? No?
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 12:56 am
by DR White
Simon,
Please see my first post.
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 1:01 am
by Simon
Well I guess I completely misunderstood your question.
Could you elaborate?
If the difference is just name or lable then it's an easy change.
"put the label of me"
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 1:30 am
by dunbarx
The clickText only returns a value in a control that contains actual text. Like fields. The properties of a button are not pertinent, even though those properties devolve to text, like the label. They live in a different world.
What you need to do is change to something like:
on mouseUp
answer the label of me
end mouseUp
Or you can use a handler higher up in the hierarchy that puts the label of the target.
Craig