作者icedesign (不可或缺的咖啡因)
看板Flash
标题[问题] 指定变数的问题
时间Sat Aug 11 13:53:03 2007
^^"有个问题想来这发问,请高手教一下,因为一直想不通。
var testNumA : Number = 0;
var testNumD : Number = 0;
function testFunB(){
for (testNumA=1;testNumA<=x;testNumA++){
this["test"+testNumA].onRelease = function (){
testNumD = this["test"+testNumA].testNumA
testFunE()
}
}
}
function testFunE(){
for (i=0;i<y;i++){
testWord_txt.text = ["xxx"+i+"_Array"][testNumD].xxxxx
}
}
^^"想请问,因为上面是我原本写错的方式,要如何才能够将
this["test"+testNumA].onRelease的testNumA的值
代入testNumD呢?
麻烦各位,谢谢。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.135.178.144
1F:推 scars:你好像没有指定 this["test"+testNumA].testNumA 的值啊 08/11 19:56
2F:推 icedesign:= = 意思是说,要先指定吗?可以教我一下吗?高手^^ 08/12 00:04
3F:推 scars:其实你的程式蛮微妙的 我看不出来你要干嘛XDD 08/12 13:10
4F:→ scars:在 onRelease 函数的前面你要先 08/12 13:11
5F:→ scars:this["test"+testNumA].testNumA=testNumA 08/12 13:12
6F:推 icedesign:^^感谢!真的发现是自己写错噜~3Q 08/12 14:20