【发布时间】:2014-04-17 13:29:11
【问题描述】:
您知道导致此错误的原因吗? TypeError:错误 #1006:setChildIndex 不是函数。 在函数/()[iVision_Game_fla.MainTimeline::frame83:151]
这就是我认为错误发生的地方......
function dragObject(indx1:int,indx2:int):Function {
return function(event:MouseEvent){
var item:MovieClip=MovieClip(event.currentTarget);
item.startDrag();
var topPos:uint=this.numChildren-1;
var itemSound:Sound = new Sound();
itemSound.load(new URLRequest("sounds/"+dirArray[indx1])+indx2+".mp3"));
if(!activeSound)
{
itemSound.play();
activeSound=true;
}
this.setChildIndex(item, topPos);
}
}
//在另一个函数上调用它
var functionOnDrag:Function = dragObject(indexc[count-1],index[count2]);
pb[i].addEventListener(MouseEvent.MOUSE_DOWN,functionOnDrag);
【问题讨论】:
标签: actionscript-3 flash