如何将字符串作为变量actionscript 2传递

时间:2013-12-09 14:52:12

标签: string variables actionscript-2

说我有这些变量

var word1 ='wordA';
var word2 ='wordB';
var word3 ='wordC';
var word4 ='wordD';
var word5 ='wordE';

我有这个循环

for (var i=1; i<6; i++) {
    // make word + i = ''; (an empty string)
}

我将如何使用Actionscript 2进行此操作?

1 个答案:

答案 0 :(得分:2)

尝试this

for (var i=1; i<6; i++) {
    this[ "word" + i ] = ''; (an empty string)
}