TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.as3::enemyslime/frame23()
I got this error when I wrote the line
enemy_no.gotoAndStop(Math.ceil(Math.random()*3))
enemy_no is an instance of the object enemy slime. The mc has 25 frames with the last frame having the code to remove the mc on being played.
EDIT: I solved the problem by adding a stop in the first frame of the mc.
Why was this happening?