Search code examples
actionscript-3flashadobe

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


TypeError: Error #1009: Cannot access a property or method of a null object reference. at RadioSkonto_fla::MainTimeline/onEnterFrame()[RadioSkonto_fla.MainTimeline::frame1:30]

There is the code!

http://radosi.lv/2/screen.png

Please help!


Solution

  • It's because, on the first call to onEnterFrame, fl_SC has not been defined - fl_SC is only set to s.play() when the user clicks play_btn.
    Either check that fl_SC has been defined before checking a property of it, or change the sequence of events so that there's an instance of fl_SC at the first call to onEnterFrame.