0

位置 i の要素を削除するだけです。要素を直接削除するにはどうすればよいですか。直接関数はありますか。配列から arr[i] を削除したいだけです。どうすればフレックス3.0になりますか。

indexpoly = 3;

for(indexpoint = 0; indexpoint < indexpoly; indexpoint++)
{ 
    temp.points[indexpoint].x = intpoints[indexpoint].x+this.x;
    temp.points[indexpoint].y = intpoints[indexpoint].y+this.y;
}

for(indexpoint = indexpoint + 1; indexpoint <= intpoints.length; indexpoint++)
{
    temp.points[indexpoint-1].x = intpoints[indexpoint].x + this.x;
    temp.points[indexpoint-1].y = intpoints[indexpoint].y + this.y;
}

これを行うと機能しません。

4

1 に答える 1

2

使用できます.splice()

var index:int = 3;
temp.points.splice(index, 1);
于 2013-03-04T02:12:31.803 に答える