问题
My question is that how we can convert a string to to act like a movie clip OR How to convert each field of an array to to act like a movie clip.
For example:
var days:Array = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
and I want "Sun" to become a movie clip Or
var str:String;
for (var i=0; i<days.length; i++)
{
str = days[i];
//and then I need to convert str to to act like a movie clip each time
}
Thanks for your help in advance.
回答1:
The easiest way to do this is as Follows:
- create a
movieclip
mc - create a 'TextField' text
- make text be the child of mc
- text.text = "Sun"
Then, you can use mc instead of "Sun"
来源:https://stackoverflow.com/questions/41087467/how-to-convert-string-and-or-array-fields-to-act-like-a-movie-clip-as3