How do I change the instance name of a dynamic text field (via action script that is)?!
textfield instance name myText
myText._name = “myothertext”;
Cool, thanx.
I presume i can also rename movie clips that way?!
But what if the text field does not have a name?
I guess I would ask why you would want to change the name of a dynamic text field?
And if your text field doesn’t have a name how are you going to reference it to rename it?
Its a good question from Green L and a little unusual to rename textfields.
Yes you can do it with mcs
To name something without an instance name do something like this
for (var obj in this) {
if (this[obj] instanceof Textfield) {
this[obj]._name = “myText”;
}
}
if you have several textfields, maybe you could pick some property by which to differentiate.
eg/in the loop above
this[obj]._name = “myText”+Math.round(this[obj]._x);