Skip to main content
December 19, 2013
Question

gotoAndStop not working at all...

  • December 19, 2013
  • 1 reply
  • 640 views

Idk why but when ever I use gotoAndStop(3); (3 is just for example) it doesnt work. It has nothing to do with the code around it. Ive tried it in my first function like this,

function BeginCode(event:Event):void{

     gotoAndStop(3);

}

BeginCode();

AND IT DOESNT WORK! It keeps coming up with the error "Cannot access a property or method of a null object reference." and I cant figure it out ive searched EVERYWHERE ON THE FORUMS. I made an account to only post this one question. My project is due tommorow and Ive been trying to fix this one bug for several day, (I am a student in grade 8). Ive coded before and used other languages. PLEASE HELP ME I WANNA KILL MYSELF OVER THIS STUPID BUG!!!! (sarcasm about killing myself, just realllllyyy stressed.). Is there some preference or option im not seletcting or what!?! I just cant use gotoAndStop at all!!!!

Please help quickly ;(

Thanks for any help you can send my way.

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
December 19, 2013

If there is no event driving that function then get rid of the event:Event part of it.  You have to have passed an event in order to have that mean anything.

function BeginCode():void{

     gotoAndStop(3);

}

BeginCode();

December 19, 2013

I did have a event in the function that was just a snipit example.

kglad
Community Expert
Community Expert
December 19, 2013

you need to find your null object reference.  otherwise, none of your code will work after that error appears.

click file>publish settings>swf and tick "permit debugging".  the location of the problematic line of code will be in the error message.

if that doesn't make the solution obvious to you, copy and paste the error message along with the line of code mentioned in the error message.