[MX] - using a variable to point out an instance name

Hello,

Lets say I have a function that asks me for my name [whatsyourname(user)]. and I enter ‘adam’.
And lets say I have an instance named “adamtwenty”, for example, I’d like to modify using the function.

How do I add the ‘twenty’ to the user name input (‘adam’), so I could change the instance?

adamtwenty,
metwenty,
youtwenty,
thanksalottwenty,

adam.

erm
name+“twenty”
:h:

Prophet.

Thanks. I tryed that. It says “Left side of assignment operator must be variable or property. user+“cover”._alpha = 50;”

any ideas?

thanks,
adam.

http://www.kirupaforum.com/forums/showthread.php?t=12082

I’m sorry for being a pain, but I still couldn’t find an answer to my problem…

 _root.bla = _root.user+"cover";
 _root.bla._alpha = 50;
 trace(_root.usercover._alpha);
 trace(_root.bla._alpha);

why does the first trace gives out “100”, and the second “undefined”?
and, go****, why none of them gives out 50?? :slight_smile:

thanks!
adam.

im stil not quite sure what your asking for here…
if you have a variable calld user and you want to add the string twenty to it, use this:
user+=“twenty”

if you are trying to address an instance with instance name user plus a string, use this:
_root[user+“twenty”]

hope u got what you wanted…

Prophet.

I still can’t make it work… but thanks anyway all!

adam.