0

i tried making a button that makes it go to the next frame but when i tried it there was an output that said "TypeError: Error #1010: A term is undefined and has no properties." i tried to find any script errors but cant find any, heres the script

stop();
this.nextbutton.addEventListener(MouseEvent.CLICK, click);

function click(e:MouseEvent):void
{
    nextFrame();
}

this was my first time trying to do actionscript3

  • 1
    The script has no problems, but it seems that **nextbutton** does not exist at the moment the script executes. Either you put the button instance to another frame, or maybe **nextbutton** is not its instance name, or something else like that. – Organis Sep 04 '20 at 02:20
  • thanks! i have been trying to find why it was not working – user14216776 Sep 04 '20 at 03:51
  • The buttons you refer in the script **must** exist on the **same** timeline at the moment of the script execution and must have instance name "nextbutton" (instance name is not a Library symbol name and not a class name either, when you select the object on the stage, there's an Instance Name blank on the Properties panel). Also, Publish Settings > ActionScript3 Settings must have an option "Auto-declare stage instances" on, it is on by default, but still. – Organis Sep 04 '20 at 07:42

0 Answers0