Setting a property of one group member inside another group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 665
- Joined: Tue Jul 29, 2014 12:52 am
Setting a property of one group member inside another group
I have a card with one "big" group named BigGroup that consists of 5 small groups called SmallGroup including one graphic (Rounded Rectangle) and one label each (Label).
Who can show me the best way to write the script that will let me set the linesize property of the Rounded Rectangle over which the user has clicked (or tapped).
As always, many thanks in advance
Who can show me the best way to write the script that will let me set the linesize property of the Rounded Rectangle over which the user has clicked (or tapped).
As always, many thanks in advance
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
Re: Setting a property of one group member inside another gr
Hi Simon,
try this as script of the BigGroup
This works as long as there is only one graphic in the smallGroups.
Kind regards
Bernd
try this as script of the BigGroup
Code: Select all
on mouseUp
put the target into tTarget
put the long id of the owner of the target into tOwner
if the owner of tOwner is me then
lock screen
repeat with i = 1 to the number of groups of me
set the lineSize of grc 1 of group i of me to 1
end repeat
set the lineSize of grc 1 of tOwner to 4
unlock screen
end if
end mouseUp
Kind regards
Bernd
Re: Setting a property of one group member inside another gr
Perhaps I am misunderstanding.
What is wrong with:
Now you could always first check the target to make sure it is a graphic, or even a particular graphic. Grouping, however nested, is transparent to "the target".
Craig Newman
What is wrong with:
Code: Select all
on mouseUp
ask "Enter lineSize"
set the lineSize of the target to it
end mouseUp
Craig Newman
-
- Posts: 665
- Joined: Tue Jul 29, 2014 12:52 am
Re: Setting a property of one group member inside another gr
Craig and Bernd, many thanks to both of you for your answers.
Bernd, the script never gets into the repeat loop because it seems "the owner of tOwner" is never equal to "me".
Bernd, the script never gets into the repeat loop because it seems "the owner of tOwner" is never equal to "me".
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
Re: Setting a property of one group member inside another gr
Simon
try this stack. It works for me.
Kind regards
Bernd
try this stack. It works for me.
Kind regards
Bernd
- Attachments
-
- groupInGroup.livecode.zip
- (1.31 KiB) Downloaded 234 times
-
- Posts: 665
- Joined: Tue Jul 29, 2014 12:52 am
Re: Setting a property of one group member inside another gr
Dear Bernd, works like a charm, many thanks!
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question