Variables actionscript动态变量
我有一个关于动作脚本的问题 例如,三个名为country1、country2、country3的文本框 如何使用动态变量将文本插入这些文本框 e、 g a=“1” b=“2” c=“3” [“国家”+a].text=“AAA” [“国家”+a].text=“BBB” [“国家”+a].text=“CCC” 谢谢嗨 如果你能去,就让我知道你把代码放在正确的地方Variables actionscript动态变量,variables,actionscript,Variables,Actionscript,我有一个关于动作脚本的问题 例如,三个名为country1、country2、country3的文本框 如何使用动态变量将文本插入这些文本框 e、 g a=“1” b=“2” c=“3” [“国家”+a].text=“AAA” [“国家”+a].text=“BBB” [“国家”+a].text=“CCC” 谢谢嗨 如果你能去,就让我知道你把代码放在正确的地方 country1.text = "hello"; // I assume that works. 那你就可以走了 this["count
country1.text = "hello"; // I assume that works.
那你就可以走了
this["country" + a].text = "AAA"; // Then that will work.
嗨
如果你能去,就让我知道你把代码放在正确的地方
country1.text = "hello"; // I assume that works.
那你就可以走了
this["country" + a].text = "AAA"; // Then that will work.
this[“country”+a].text=“AAA”
或者更复杂的事情:
var countries:Array = new Array();
countries['1'] = "UK";
countries['2'] = "Poland";
countries['3'] = "France";
for (key in countries){
this["country" + key] = countries[key];
}
this[“country”+a].text=“AAA”
或者更复杂的事情:
var countries:Array = new Array();
countries['1'] = "UK";
countries['2'] = "Poland";
countries['3'] = "France";
for (key in countries){
this["country" + key] = countries[key];
}
你在说什么actionscript版本?你在说什么actionscript版本?