How to convert string and/or array fields to act like a movie clip AS3

家住魔仙堡 提交于 2019-12-12 04:29:46

问题


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:

  1. create a movieclip mc
  2. create a 'TextField' text
  3. make text be the child of mc
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!