1
大部分是工作,即使有錯誤,則會繼續以部分工作:AS3這段代碼有什麼問題?
// Make PostItNote MC draggable and keep ON TOP
mcMXredBox.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
var q:int = 1;
// Add multiple copies of PostItNote when used
function fl_ClickToDrag(event:MouseEvent):void
{
event.currentTarget.parent.startDrag();
event.currentTarget.parent.parent.setChildIndex(DisplayObject(event.currentTarget.parent),87);
var my_PIN = new postItNote();
my_PIN.name = "my_RTC" + q; // Doesn;t like this line
this.parent.addChild(my_PIN);
trace("my_PIN = " + my_PIN);
this.my_PIN[q].x = 1388.05; // Doesn't like this line
this.my_PIN[q].y = 100;
q++;
}
的錯誤是
TypeError: Error #1010: A term is undefined and has no properties.
at postItNote/fl_ClickToDrag()[postItNote::frame1:71]"
你可能需要提供更多的信息。 this.my_PIN在哪裏聲明?它是一個數組? (你正在作爲一個訪問它)。 postItNode中是否有名稱公共屬性?等 – Ben 2012-03-08 10:29:11