0
我想用動畫片段跟蹤鼠標的X位置。AS3:無法訪問空對象引用的屬性
我迄今所做的:
public class LuckyHitBeta extends MovieClip {
var ballReady:ballReady_mc;
private function liveIcon():void {
ballReady=new ballReady_mc();
addChild(ballReady);
ballReady.y=1;
}
private function onEnterFrm(e:Event):void
{
ballReady.x=mouseX;
}
}
運行時錯誤:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at LuckyHitBeta/onEnterFrm()
謝謝,我不得不放置liveIcon();在主要功能上。現在它工作了! – 2011-12-19 22:56:42