get the name of a group |SOLVED|

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Johan_VH
Posts: 67
Joined: Fri Mar 28, 2014 2:46 pm

get the name of a group |SOLVED|

Post by Johan_VH » Mon Jul 07, 2014 10:54 am

Hi all,

another day, another question it seems... I'm currently scripting an onscreen keyboard, which I have done many times in Flash and Director so I know LC will certainly be able to do what I need but the syntax still takes adjusting for me...

I want to fill the keyboard's buttons with the names of the keys, which can change. I'd do this with a repeat loop, but in order to do that I first need to be able to get the name of the group (each button is a group consisting of the button graphic and 2 text layers). In Flash I would use the keyword 'this' to indicate the code has to focus on the current group (or movieclip as it is called there) and then I could get the name of it and thus fill the buttons correctly from within my group and have them respond correctly to the user interactions.

I tried with "target" to get at least something just for the fun of it, and unfortunately got the names of the text layers instead of the group. But so far LC hasn't dissapointed me, so I keep my hopes up! :-)

Johan
Last edited by Johan_VH on Mon Jul 07, 2014 11:51 am, edited 1 time in total.

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: get the name of a group

Post by bangkok » Mon Jul 07, 2014 10:59 am

Code: Select all

answer the short name of the owner of me

answer the id of the owner of me

Johan_VH
Posts: 67
Joined: Fri Mar 28, 2014 2:46 pm

Re: get the name of a group

Post by Johan_VH » Mon Jul 07, 2014 11:44 am

Thanks for the reply Bangkok, but unfortunately, that gives me the name of the card, not of the group...

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: get the name of a group

Post by bangkok » Mon Jul 07, 2014 11:50 am

Johan_VH wrote:Thanks for the reply Bangkok, but unfortunately, that gives me the name of the card, not of the group...
you have to put this script within an object inside your group.

Johan_VH
Posts: 67
Joined: Fri Mar 28, 2014 2:46 pm

Re: get the name of a group

Post by Johan_VH » Mon Jul 07, 2014 11:51 am

Ok, I figured it out, the 'me' keyword in Bangkok's reply was the solution: "the short name of group me" does the trick!

Post Reply