Error flash output TypeError 1009:Cannot access a property or method of a null object reference

放肆的年华 提交于 2020-01-07 08:44:04

问题


Why I get output

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at Untitled_1_fla::MainTimeline/asd()

this my code

stage.addEventListener(Event.ENTER_FRAME,asd)
function asd(e:Event){
    if(test.pemukul.hitTestObject(musuh)){
        musuh.visible=false
    }
}

回答1:


some object you trying to access is null so check this objects:

test
pemukul
musuh


来源:https://stackoverflow.com/questions/24530439/error-flash-output-typeerror-1009cannot-access-a-property-or-method-of-a-null-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!