Skip to main content
Known Participant
August 19, 2014
Question

Flash keyframe and vector graphics bug that causes an Error #1009

  • August 19, 2014
  • 1 reply
  • 310 views

TypeError: Error #1009: Cannot access a property or method of a null object reference. at flashbug_fla::MainTimeline/frame2()[flashbug_fla.MainTimeline::frame2:10] at flash.display::MovieClip/gotoAndStop() at flashbug_fla::MainTimeline/ChangeGameStatus()[flashbug_fla.MainTimeline::frame3:55] at flashbug_fla::MainTimeline/pauseScrMenuCl()[flashbug_fla.MainTimeline::frame3:10]

This shows up when gotoAndStop is triggered.

But there is no error in my code, so there is no reason to paste the code in here.

There is one keyfreme in which if I put vector graphics (just graphics, not interactive object), the error goes away.

I copied all the content of "Dets 1" layer to other new layer and the bug was gone.

But after some days of work the error came back, but this time my project is much more complicated and I can't find the problem source.

I made my old, NOT complicated project copy and cleaned it from everything what's not needed to read easyly. It's here for download on wetransfer: http://we.tl/XDNpDcK1YY

All the info about how to throw the error are in the FLA file.

I cant put vector graphics in all keyframes. Maybe if you can help me identify the cause of this bug, I could then fix my big project too.

My system: Win 8, Flash CS6 12.0.0.481

Tested on Flash CC 2014 too. Same.

Thanks!

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
August 20, 2014

While your code might be correctly written, a 1009 error is not about incorrect code.  The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....

 

- is declared but not instantiated

- doesn't have an instance name (or the instance name is mispelled)

- does not exist in the frame where that code is trying to talk to it

- is animated into place but is not assigned instance names in every keyframe for it

- is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).

 

If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.