# Buttons leading to different frames

**URL:** https://forum.kirupa.com/t/buttons-leading-to-different-frames/108367
**Category:** Uncategorized
**Created:** [April 24, 2004, 6:45am UTC](https://forum.kirupa.com/t/buttons-leading-to-different-frames/108367 "2004-04-24T06:45:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pearlkid](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@pearlkid](https://forum.kirupa.com/u/pearlkid)
#### Post date: [April 24, 2004, 6:45am UTC](https://forum.kirupa.com/t/buttons-leading-to-different-frames/108367/1 "2004-04-24T06:45:28Z")

</div>

I have a few buttons, each with the actionscript of

this.gotoAndStop (frame);

and when I test out my project I get this in output :  
**Error** Scene=Scene 1, layer=more1, frame=3:Line 1: Statement must appear within on handler  
this.gotoAndStop (2);  
**Error** Scene=Scene 1, layer=more2, frame=4:Line 1: Statement must appear within on handler  
this.gotoAndStop (3);  
**Error** Scene=Scene 1, layer=back1, frame=4:Line 1: Statement must appear within on handler  
this.gotoAndStop (1);  
**Error** Scene=Scene 1, layer=more3, frame=5:Line 1: Statement must appear within on handler  
this.gotoAndStop (4);  
**Error** Scene=Scene 1, layer=back2, frame=5:Line 1: Statement must appear within on handler  
this.gotoAndStop (2);  
**Error** Scene=Scene 1, layer=back3, frame=6:Line 1: Statement must appear within on handler  
this.gotoAndStop (3);  
Total ActionScript Errors: 6 Reported Errors: 6

Wondering what this means and how to fix it, thanks!
