我在[a,b,c ..... i]阶段有9个mc,并且每个mc的这个itemIndex[]
内容索引是,我想从itemIndex[]
中删除特定项目,但是我发现的问题是,当我在其他项目上单击同一mc并继续从itemIndex []删除时,
导入flash.events.MouseEvent;
var myarray: Array = [a, b, c, d, e, f, g, h, i];
var itemIndex: Array = [];
for (var j: int = 0; j < myarray.length; j++) {
myarray[j].addEventListener(MouseEvent.CLICK, goto);
myarray[j].index = j;
itemIndex.push(j);
}
function goto(e: MouseEvent): void {
var r = e.target.index;
itemIndex.splice(e.target.index, 1);// for exemple wen i click to this movieClip with the name a
//the index of a is 0 ; but
trace(itemIndex);
}
//output = 1,2,3,4,5,6,7,8
// 1,2,3,4,5,6,7
// 1,2,3,4,5,6
// 1,2,3,4,5
// 1,2,3,4
// 1,2,3
// 1,2
// 1