Background:
In a shared Object in AS3, I saved the names (as Strings) of certain MovieClips that appear on stage time in my game.
Issue:
I'm trying to reverse this and the only way I found so far is a method like this:
function objectNameFromString(objectNameAsString): MovieClip {
switch (objectNameAsString): {
case "myobject":
return myobject;
break;
}
}
The problem is that I have to make like 20 case statements to get this done which seems unneccesary =( is there anyway you can just reference a MovieClip from a String?
I think what you're looking for is this:
getChildByName()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With