Page 1 of 1

get the name of a group |SOLVED|

Posted: Mon Jul 07, 2014 10:54 am
by Johan_VH
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

Re: get the name of a group

Posted: Mon Jul 07, 2014 10:59 am
by bangkok

Code: Select all

answer the short name of the owner of me

answer the id of the owner of me

Re: get the name of a group

Posted: Mon Jul 07, 2014 11:44 am
by Johan_VH
Thanks for the reply Bangkok, but unfortunately, that gives me the name of the card, not of the group...

Re: get the name of a group

Posted: Mon Jul 07, 2014 11:50 am
by bangkok
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.

Re: get the name of a group

Posted: Mon Jul 07, 2014 11:51 am
by Johan_VH
Ok, I figured it out, the 'me' keyword in Bangkok's reply was the solution: "the short name of group me" does the trick!