Page 2 of 3
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 1:46 am
by DR White
Craig,
I tried that exact code
"answer label of me"
and the reply was empty
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 1:51 am
by Simon
Did you try that script in the stack I posted?
Simon
EDIT I get Answer 1 , Answer 2 and Answer 3
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 1:53 am
by DR White
Craig,
I used that exact code and it returned empty!
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 1:55 am
by DR White
Craig,
I used that exact code and it returned empty!
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 1:56 am
by dunbarx
Doc.
The label is a basic property of a button, and if it is not empty (the default) then you will get text back. Go to the property inspector and see if, in fact, there is a label or not.
If there is, and you are getting empty, we need to know about it. But I bet you not.
I do not suppose that the mouseUp message is being diverted somehow, and that the button script is not actually being executed? Put a breakpoint at the "on mouseup" line and make sure that the button handler is being run.
Craig
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 2:00 am
by Simon
Maybe post your stack.
This is not a difficult task, answering the label of the button.
Really, it shouldn't be.
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 2:07 am
by DR White
Simon and Craig,
The label of my group is empty.
I want to get the label of one the the buttons in the group, when I click on the button.
My stack is the beginning of a large program and is a mess at this stage.
Thanks,
David
Re:answer label of me
Posted: Tue Aug 27, 2013 2:30 am
by DR White
Grouped Buttons & clickText - NOT Solved

Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 2:42 am
by Simon
You have not responded to my question of replacing
put the short name of me
with
put the label of me.
As I said it does work here using the stack I posted!
Anybody else want to test the posted stack with the change?
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 2:49 am
by DR White
Simon,
I tried the code below and it does not work for me:
on MouseDown
answer label of me
if the label of me contains "Easy" then Correct
end MouseDown
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 2:51 am
by Simon
Please update the stack I posted with your updated code save it and post it here.
I will figure out what is wrong.
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 3:17 am
by DR White
Simon,
Here a test file that I cannot get the button label from one of the buttons in the group to return when I click on it with the mouse.
I got to get up at 5AM and I need to go to bed now.
Thanks for your effort,
David
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 3:20 am
by Simon
Sorry, looks like you forgot to attach??
I'm in no rush
Simon
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 3:28 am
by DR White
Simon,
This file is for you!
Re: Grouped Buttons & clickText
Posted: Tue Aug 27, 2013 3:50 am
by Simon
Ok.
Commenting out the group "on mouseDown" fixed the problem.
the "Answer.." in mouseDown threw the message path of the buttons on mouseUp.
But your code did respond as it was told to, you had "answer the label of me in the group" and since the label of the group was empty that is what you got.
You should drop some breakpoints throughout your code to see if the handler is even getting executed.
Not sure why you have so many nested groups, but it's your code.
Simon