我是新来的,对 AS3 也很陌生。所以这是我的疯狂问题:
为什么我会收到此错误:TypeError: Error #1010: A term is undefined and has no properties。在 MethodInfo-1()
对于我正在处理的这个功能:
/* a universal function for all the movieclips */
function clickAndPlay(element):Function {
/* return the click event */
return function(e:Event):void {
/* stop the event from propagating */
e.stopPropagation();
/* get the labels from the clip */
var labels:Array = element.currentLabels;
var numFrm:Number = labels.length; /* count them */
/* if there are no labels for this clip, get the frame length instead */
if(numFrm == 0) {
/* get the number of frames */
numFrm = element.totalFrames;
trace(numFrm);
if(element.currentFrame < numFrm) {
element.nextFrame();
}else{
element.gotoAndStop(1);
}
}else{
/* get the current index of the labels array */
for(var i:Number = 0; i < numFrm; i++) {
if(labels[i].name == element.currentLabel) {
if(i < numFrm) {
/* get the next label's name */
var labelName:String = labels[(i+1)].name;
/* go to the next label */
trace(labelName);
element.gotoAndStop(labelName);
}else{
element.gotoAndStop(1);
}
}
}
}
};
}
我不知道这个函数是指什么。我已经检查以确保框架上的标签准确无误,并且确实如此。我敢肯定它有些愚蠢,但任何帮助将不胜感激。提前致谢。
肖恩