I want to call an object’s method from a string containing the name of the object.
There is an Object “sh”
It has a method “play”
There is a string “grapheme” whose value is “sh”
I could code: sh.play();
I want to code something like: grapheme.play();
Or to put it another way: getActorNamed(grapheme).play();
I could solve this with a large “switch” block, but there must be a better way.
Thanks.