Possible Duplicate:
Can you have "ByRef" arguments in AS3 functions?
AS3的主要类型按价值而不是参考。 是否有办法推翻这一行为,并参照某些变量? 采用以下法典:
for (var i=0; i<4; i++) {
for (var j=0; j<4; j++) {
if(i==0 && j==0){
switch(currentRotation){
case 0:
var1 = j; //I want var 1 to be a reference to j, not the value of j
break;
}
}
if(someArray[var1][var2]){
//stuff
}
}
}
如果是这样,我猜测,我只得复制和复制这部法典几度:
增 编