如何将字符串和/或数组字段转换为类似于影片剪辑AS3的行为 [英] How to convert string and/or array fields to act like a movie clip AS3
本文介绍了如何将字符串和/或数组字段转换为类似于影片剪辑AS3的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的问题是,如何将字符串转换为像电影剪辑
或
如何将数组的每个字段转换为像电影剪辑一样。 b
$ b
例如:
var days:Array = new Array(Sun,星期一, 星期二, 星期三, 星期四, 星期五, 星期六);
我想让Sun成为影片剪辑
或
var str:String;
for(var i = 0; i {
str = days [i];
//然后我需要将str转换为每次
感谢您的帮助。
解决方案
最简单的方法如下: p>
- 创建
movieclip
mc - 'textField'text
- 使文本成为mc的子
- text.text =Sun ol>
然后,您可以使用mc来代替Sun
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.
解决方案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"
这篇关于如何将字符串和/或数组字段转换为类似于影片剪辑AS3的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- create a
查看全文